-
1. Re: JBoss AS 7 - trouble with Spring application deploying
marius.bogoevici Oct 3, 2011 2:41 PM (in response to sigthor)This is an issue with JBoss Modules: https://issues.jboss.org/browse/AS7-1928
The namespace configuration files are in META-INF, but that directory is not visible (nor is it configurable via jboss-deployment-structure.xml)
-
2. Re: JBoss AS 7 - trouble with Spring application deploying
marius.bogoevici Oct 6, 2011 12:15 AM (in response to marius.bogoevici)Actually, it seems like jboss-deployment-structure.xml supports this already. Therefore, instead of using MANIFEST.MF, you may add this in /WEB-INF/jboss-deployment-structure.xml (this is assuming that you have a web application - otherwise it's /META-INF/jboss-deployment-structure.xml):
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
<dependencies>
<module name="org.apache.commons.logging"/>
<module name="org.springframework" >
<imports>
<include path="META-INF**"/>
<include path="org**"/>
</imports>
</module>
</dependencies>
</jboss-deployment-structure>
-
3. Re: JBoss AS 7 - trouble with Spring application deploying
sigthor Oct 6, 2011 6:17 AM (in response to marius.bogoevici)Thanks!!! It really works with jboss-deployment-structure.xml, but another trouble with Spring has been surfaced:
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141) [org.springframework.beans-3.0.6.RELEASE.jar:]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74) [org.springframework.beans-3.0.6.RELEASE.jar:]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958) [org.springframework.beans-3.0.6.RELEASE.jar:]
... 69 more
I made the following configuration in jboss-deployment-structure.xml:
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
<dependencies>
<module name="org.apache.commons.logging" />
<module name="org.apache.log4j" />
<module name="org.hibernate" />
<module name="org.jdom" />
<module name="org.springframework">
<imports>
<include path="META-INF**" />
<include path="org**" />
</imports>
</module>
</dependencies>
</deployment>
</jboss-deployment-structure>
It seems spring doesn't see hibernate.jar, but it is deployed as a module in jboss 7 by default(I changed default Hibernate 4 to 3.6.7)
-
4. Re: JBoss AS 7 - trouble with Spring application deploying
marius.bogoevici Oct 6, 2011 9:28 AM (in response to sigthor)As this is a modified version of AS7, I can't really say what went wrong, but an alternative solution that worked better would be to package hibernate inside the application, and exclude the hibernate module (might not be necessary, if this is a native Hibernate application).
-
5. Re: JBoss AS 7 - trouble with Spring application deploying
holger.lierse Feb 5, 2013 7:38 PM (in response to sigthor)Hi,
Did yoyu ever figure out what the problem is? Facing the same issue here...
Thanks.
-
6. Re: JBoss AS 7 - trouble with Spring application deploying
sigthor Feb 6, 2013 3:53 AM (in response to holger.lierse)What issue? spring doesn't see hibernate? You should use the latest Spring version(with 3.2 it works well on my side) or place hibernate jars within war
-
7. Re: JBoss AS 7 - trouble with Spring application deploying
holger.lierse Feb 6, 2013 6:02 PM (in response to sigthor)Hi Sigurd,
We're using Spring 2.5.6.SEC03 with Snowdrop 2.0.4 and we're not defining any Hibernate dependency (i.e. Hibernate 4 would be used). It seems to be working when packaging Snowdrop and the Sping libs into the EAR however, when trying to use the JBoss deployment descriptor and defining the modules get the error above.
Are you using the Snowdrop module? Do you have a dependency on the Spring module in your Snowdrop module.xml? How does your Spring module.xml look like? Is there a spring-orm dependency and a dependency on Hibernate? The issue might be that Spring 2.5.6.SEC03 can't wrap Hibernate 4, however why is it working when placing the Spring libs into the EAR?
Thanks for your help.
Holger