-
1. Re: How to package an entity jar inside a WAR?
luke.poldo.mailinator.com Dec 12, 2008 10:49 AM (in response to nbhatia.bhatian.comcast.net)put your jar with everything inside YourProgect-ear/EarContent and modify application.xml like this:
<module> <java>xstream-1.3.1.jar</java> </module>
it works for me...
-
2. Re: How to package an entity jar inside a WAR?
sarnac Dec 12, 2008 4:48 PM (in response to nbhatia.bhatian.comcast.net)Hi,
I had the same problem with my WAR application. For reference, my app is JPA-based (Hibernate Entity Manager is the JPA provider) deployed as a WAR in JBoss. Anyway it seems that HEM is not able to resolve relative paths in jar-file tags when the application is deployed as a WAR.
I know of two ways to solve this:
1. Deploy your app as a EAR, like the above poster said.
2. If you wish to deploy as a WAR, instead of using jar-file in persistence.xml you can define all the entities that are in your jar explicitly:
<class>com.foo.Bar</class> <class>...</class>
Mathieu
-
3. Re: How to package an entity jar inside a WAR?
nbhatia.bhatian.comcast.net Dec 12, 2008 5:51 PM (in response to nbhatia.bhatian.comcast.net)Luke and Mathieu, thank you both for your help.
Just to set some context, I had the application configured as an EAR before and everything worked fine. The only issue was that I was not able to hot-deploy - hence the development cycle was very-very slow. After reading the reference manual, I decided to give JBoss Tools a try. Of course, it doesn't support hot deploying to an EAR, so I decided to switch to a WAR. Of course there are couple of glitches here too:
1) JBoss Tools puts all classes (front-end and entities) in the same project (probably because of the very problem we are discussing) - I don't like this from an architecture perspective.
2) I am loyal to Maven and JBoss Tools layout is not Maven friendly.
I really like Seam, but frustrated with it at this point - it's really coming in the way of productivity. Committer's, please guide if there is anyway out of this - without putting everything into one massive project.
Thanks.
Naresh -
4. Re: How to package an entity jar inside a WAR?
serkan.s.eskici.online.nl Feb 2, 2011 2:58 PM (in response to nbhatia.bhatian.comcast.net)If you're using Maven you can unpackage your entity.jar from WEB-INF/lib to WEB-INF/classes and this should solve the problem.
See http://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html.
-
5. Re: How to package an entity jar inside a WAR?
mana.hotmana76.gmail.com Feb 3, 2011 2:36 PM (in response to nbhatia.bhatian.comcast.net)Well, it is not directly bug of Seam or JBoss Tools but JPA provider - Hibernate EntityManager - look at HHH-4161.
AFAIK JBoss Tools for WAR projects creates special classpath entries for entities and other action classes in Web project. That is because hot-deploy doesn't work for entities.
You should find there src/main and src/hot directories.
Anyway if you place your persistence descriptor like WAR/WEB-INF/classes/META-INF/persistence.xml and your entity classes in WAR/WEB-INF/classes/ it should work.
According to Maven, If you know M2eclipse plugins, you can use it together with JBoss Tools. Some tutorial is at http://relation.to/Bloggers/UsingMavenWithJBossTools.