"Also, I found it quite simple to configure the output of POJO classed to /WEB-INF/dev for hot-swap of changed POJOs (yes, class structure change is supported here by seam)"
Any Idea how to configure my project on this way, cause I don't find it so simple.
But everytime I re-import my maven files it's overriden by IDEA again. Not sure yet which maven setting to change to keep it.
What I also needed to for the workaround to function properly, I had to define an ant-task (in Maven) to copy the non-class files (e.g. persistence.xml) from the /dev folder to the /classes folder: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <configuration> <tasks> <echo>Moving non-classes to /classes</echo> <move todir="${project.build.directory}/exploded/WEB-INF/classes" overwrite="true"> <fileset dir="${project.build.directory}/exploded/WEB-INF/dev"> <exclude name="**/*.class"/> </fileset> </move> </tasks> </configuration> </plugin> </plugins> </build>
I put this into a special 'dev'-profile in maven and call it once everytime I start Tomcat. This way all the class changes are directly hot deployed when doing Make instead of having an ant-task EVERY time I want to hot deploy.
PS: I get this error: SEVERE: Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener org.jboss.seam.InstantiationException: Could not instantiate Seam component: PU at org.jboss.seam.Component.newInstance(Component.java:2106) at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304) at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278) .... Caused by: javax.persistence.PersistenceException: [PersistenceUnit: PU] Unable to configure EntityManagerFactory at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:265) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125) ....
Is there any easier way to enable compiling to WEB-INF/dev?
I have 4 source folders, one of which is for my hot-deployed classes. How can I set this source folder to compile to WEB-INF/dev so that Jboss will pick it up? I'm not using Maven.
Workaround is to use an Ant task to compile the classes and set it to run after compilation (right click on the Ant task -> Execute On -> After Compilation.)
I think that I found a clue:
http://www.theserverside.com/news/thread.tss?thread_id=46560
"Also, I found it quite simple to configure the output of POJO classed to /WEB-INF/dev for hot-swap of changed POJOs (yes, class structure change is supported here by seam)"
Any Idea how to configure my project on this way, cause I don't find it so simple.
Thanks in advance
Did you make it work?
I just found a suboptimal workaround, by changing the URI to 'WEB-INF/dev' in my .iml-file:
<containerElement type="module" name="%MODULE-NAME%">
<attribute name="method" value="1" />
<attribute name="URI" value="/WEB-INF/classes" />
</containerElement>
But everytime I re-import my maven files it's overriden by IDEA again. Not sure yet which maven setting to change to keep it.
What I also needed to for the workaround to function properly, I had to define an ant-task (in Maven) to copy the non-class files (e.g. persistence.xml) from the /dev folder to the /classes folder:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<configuration>
<tasks>
<echo>Moving non-classes to /classes</echo>
<move todir="${project.build.directory}/exploded/WEB-INF/classes"
overwrite="true">
<fileset dir="${project.build.directory}/exploded/WEB-INF/dev">
<exclude name="**/*.class"/>
</fileset>
</move>
</tasks>
</configuration>
</plugin>
</plugins>
</build>
I put this into a special 'dev'-profile in maven and call it once everytime I start Tomcat. This way all the class changes are directly hot deployed when doing Make instead of having an ant-task EVERY time I want to hot deploy.
PS: I get this error:
SEVERE: Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
org.jboss.seam.InstantiationException: Could not instantiate Seam component: PU
at org.jboss.seam.Component.newInstance(Component.java:2106)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
....
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: PU] Unable to configure EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:265)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
....
Cheers,
Stephan
Is there any easier way to enable compiling to WEB-INF/dev?
I have 4 source folders, one of which is for my hot-deployed classes. How can I set this source folder to compile to WEB-INF/dev so that Jboss will pick it up? I'm not using Maven.
Is this approach the recommended method : http://stackoverflow.com/questions/690676/achieving-seam-hot-deployment-with-intellij-idea
Thanks,
Damian.
Workaround is to use an Ant task to compile the classes and set it to run after compilation (right click on the Ant task -> Execute On -> After Compilation.)