Bas Ven
2013-07-24 15:54:01 UTC
Bas Ven [https://community.jboss.org/people/batter] created the discussion
"Accessing spring beans that are deployed in a war."
To view the discussion, visit: https://community.jboss.org/message/829560#829560
--------------------------------------------------------------
We are converting a huge Spring 3 based application to eventually be a JEE application using jBoss 7.1.1.Final.
As a first step we wrapped our application inside a war file which deploys inside jboss and works well.
I am trying to see if I can inject some of the spring beans inside this jar into a simple EJB. Both the war and EJB are packaged in an ear and I moved all jars from the war to the ear lib.
As a side note, I tried to build the sportsclub example but it can't find the jpl-util 1.0 (which is not avaliable on maven central); it also looks very outdated and I am wondering if there is a newer example distribution for snowdrop 2.x?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/829560#829560]
Start a new discussion in Snowdrop at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2082]
"Accessing spring beans that are deployed in a war."
To view the discussion, visit: https://community.jboss.org/message/829560#829560
--------------------------------------------------------------
We are converting a huge Spring 3 based application to eventually be a JEE application using jBoss 7.1.1.Final.
As a first step we wrapped our application inside a war file which deploys inside jboss and works well.
I am trying to see if I can inject some of the spring beans inside this jar into a simple EJB. Both the war and EJB are packaged in an ear and I moved all jars from the war to the ear lib.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" " http://www.springframework.org/dtd/spring-beans.dtd http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
   <description>BeanFactory=(*Commander*)</description>
   <bean id="*dataSourceManager*" class="database.DataSourceManagerImpl" />
</beans>
09:01:46,211 INFOÂ [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (MSC service thread 1-2) Loading XML bean definitions from "/content/assembly.ear/commander.war/META-INF/jboss-spring.xml"
Caused by: java.lang.IllegalStateException: javax.naming.NameNotFoundException: *Commander* -- service jboss.naming.context.java.jboss.Commander
   at org.jboss.spring.support.SpringInjectionSupport.lookup(SpringInjectionSupport.java:180) [snowdrop-deployers.jar:2.1.0.Final]
   at org.jboss.spring.support.SpringInjectionSupport.getObjectFromBeanFactory(SpringInjectionSupport.java:136) [snowdrop-deployers.jar:2.1.0.Final]
Any ideas? Is this setup even supported or instead of wrapping our spring application inside a servlet should we 'just' make its jars avaliable and have some dummy EJB or sar start the application?<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" " http://www.springframework.org/dtd/spring-beans.dtd http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
   <description>BeanFactory=(*Commander*)</description>
   <bean id="*dataSourceManager*" class="database.DataSourceManagerImpl" />
</beans>
09:01:46,211 INFOÂ [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (MSC service thread 1-2) Loading XML bean definitions from "/content/assembly.ear/commander.war/META-INF/jboss-spring.xml"
Caused by: java.lang.IllegalStateException: javax.naming.NameNotFoundException: *Commander* -- service jboss.naming.context.java.jboss.Commander
   at org.jboss.spring.support.SpringInjectionSupport.lookup(SpringInjectionSupport.java:180) [snowdrop-deployers.jar:2.1.0.Final]
   at org.jboss.spring.support.SpringInjectionSupport.getObjectFromBeanFactory(SpringInjectionSupport.java:136) [snowdrop-deployers.jar:2.1.0.Final]
As a side note, I tried to build the sportsclub example but it can't find the jpl-util 1.0 (which is not avaliable on maven central); it also looks very outdated and I am wondering if there is a newer example distribution for snowdrop 2.x?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/829560#829560]
Start a new discussion in Snowdrop at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2082]