-
1. Re: problem with multiple seam component jars in a WAR
zjsun Jan 21, 2008 10:37 PM (in response to zjsun)my WAR looks like :
---------------------------------------------my-application.war/ META-INF/ MANIFEST.MF WEB-INF/ web.xml components.xml faces-config.xml pages.xml lib/ jboss-seam.jar jboss-seam-ui.jar jboss-el.jar jsf-facelets.jar jsf-api.jar jsf-impl.jar ... classes/ META-INF/ persistence.xml my-module1.jar/ META-INF/ MANIFEST.MF components.xml(blank) org/ jboss/ module1/ User.class Login.class LoginBean.class Register.class RegisterBean.class seam.properties ... my-module2.jar/ META-INF/ MANIFEST.MF components.xml(blank) org/ jboss/ module2/ Entity2.class seam.properties ... login.jsp register.jsp ...
-
2. Re: problem with multiple seam component jars in a WAR
zjsun Jan 22, 2008 12:15 AM (in response to zjsun)my WAR looks like :
---------------------------------------------my-application.war/ META-INF/ MANIFEST.MF WEB-INF/ web.xml components.xml faces-config.xml pages.xml lib/ jboss-seam.jar jboss-seam-ui.jar jboss-el.jar jsf-facelets.jar jsf-api.jar jsf-impl.jar my-module1.jar/ META-INF/ MANIFEST.MF components.xml(blank) org/ jboss/ module1/ User.class Login.class LoginBean.class Register.class RegisterBean.class seam.properties ... my-module2.jar/ META-INF/ MANIFEST.MF components.xml(blank) org/ jboss/ module2/ Entity2.class seam.properties ... ... classes/ META-INF/ persistence.xml login.jsp register.jsp ...
-
3. Re: problem with multiple seam component jars in a WAR
nickarls Jan 22, 2008 2:09 AM (in response to zjsun)Well, I'm no expert but I'm guessing that the same classloader that picks up persistence.xml need to see all the entities that should be used by that persistence context.
-
4. Re: problem with multiple seam component jars in a WAR
zjsun Jan 22, 2008 2:42 AM (in response to zjsun)then, any idea about solving my problem?
-
5. Re: problem with multiple seam component jars in a WAR
techieexchange Jan 22, 2008 4:42 AM (in response to zjsun)Hi,
If you want to load your Entities (with or without Seam component) from a seperate JAR then you should register those entities in your persistence.xml file like this:<persistence-unit name="4cWebDatabase" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <class>com.fpc.carconfig.frontoffice.entity.Allocation</class> <class>com.fpc.carconfig.frontoffice.entity.LoginData</class> <class>com.fpc.carconfig.frontoffice.entity.EndUser</class> <class>com.fpc.carconfig.frontoffice.entity.TestClass</class> <class>com.fpc.carconfig.frontoffice.entity.UserData</class> <class>com.fpc.carconfig.frontoffice.entity.Offer</class> <properties> <property name="hibernate.hbm2ddl.auto" value="update"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/> <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/> </properties> </persistence-unit>
Hope this helps.
http://techieexchange.wordpress.com -
6. Re: problem with multiple seam component jars in a WAR
zjsun Jan 22, 2008 8:28 PM (in response to zjsun)i want to use <jar-file> config element with a relative path, instead of the element, how to config a <jar-file> in a relative path?
Thanks! -
7. Re: problem with multiple seam component jars in a WAR
srini.ragu Jan 23, 2008 1:15 AM (in response to zjsun)try this...
<jar-file>file:../lib/myapp1.jar</jar-file>
i.e. file:<relative-path> in the entry for jar file.
or something like file:/WEB-INF/lib/myapp.jar -
8. Re: problem with multiple seam component jars in a WAR
zjsun Jan 23, 2008 1:29 AM (in response to zjsun)"srini.ragu" wrote:
try this...
<jar-file>file:../lib/myapp1.jar</jar-file>
i.e. file:<relative-path> in the entry for jar file.
or something like file:/WEB-INF/lib/myapp.jar
i have all tries, only absolute path works! -
9. Re: problem with multiple seam component jars in a WAR
srini.ragu Jan 23, 2008 5:56 PM (in response to zjsun)in case you want relative path
try this..
<jar-file>file:my-application.war!/WEB-INF/lib/myapp1.jar</jar-file>
otherwise the best/cleaner option is to bundle your application as ear, with the entity jars directly inside the ear
myapp.ear
---entity.jar
---mywebapp.war
------WEB-INF
---------lib
on that case you will just need to specify as <jar-file>entity.jar<jar-file> in the persistence.xml
or just bundle your persistence.xml inside the entity.jar/META-INF
post this question in hibernate forum, you could get better answers.