Paul-123
May 24th, 2005, 08:07 PM
Hi,
I wonder if anyone can help - I'm currently trying to call a legacy SS Bean service from a Struts/Spring Web App (both deployed on JBOSS).
I seem to have some JNDI issue when trying to lookup the service. This is my spring context :-
<beans>
<bean name="/springTest" class="com.spring.struts.action.SpringTestAction">
<property name="testServiceSpring">
<ref bean="testServiceSpring"/>
</property>
</bean>
<bean id="testServiceSpring" class="com.spring.struts.springTest.TestServiceSpring">
<property name="businessMethods">
<ref bean="SpringProxy"/>
</property>
</bean>
<bean id="SpringProxy" class="org.springframework.ejb.access.SimpleRemoteStatele ssSessionProxyFactoryBean" lazy-init="true">
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>
<prop key="java.naming.provider.url">localhost</prop>
</props>
</property>
<property name="resourceRef">
<value>false</value>
</property>
<property name="jndiName">
<value>ejb/SpringSessionRemote</value>
</property>
<property name="businessInterface">
<value>com.spring.struts.ejb.interfaces.BusinessEJBStruts</value>
</property>
</bean>
</beans>
Now, the jndi name of the SS bean is registered in JBOSS as :-ejb/SpringSessionRemote. I have verified this with an independent command line client which can call the service ok. However, when I deploy the spring/struts webapp, I receive the following error :-
17:56:27,719 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '/springTest' defined in ServletContext resource [/WEB-INF/action-servlet.xml]: Can't resolve reference to bean 'testServiceSpring' while setting property 'testServiceSpring'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'testServiceSpring' defined in ServletContext resource [/WEB-INF/action-servlet.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: jndiName is required
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'testServiceSpring' defined in ServletContext resource [/WEB-INF/action-servlet.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: jndiName is required
java.lang.IllegalArgumentException: jndiName is required
So must be something to do with JNDI lookup - When I change the lookup to something incorrect, I receive a different error however :-
javax.naming.NameNotFoundException: SpringSdsfsessionRemote not bound
at org.jnp.server.NamingServer.getBinding(NamingServe r.java:491)
So can anyone suggest why I am getting the error "jndiName is required" when the name is obviously being resolved to a certain degree?! I have been stuck at this point for a couple of days now - Aaaarrggghh!!!!!
Thanks!
-Paul-
I wonder if anyone can help - I'm currently trying to call a legacy SS Bean service from a Struts/Spring Web App (both deployed on JBOSS).
I seem to have some JNDI issue when trying to lookup the service. This is my spring context :-
<beans>
<bean name="/springTest" class="com.spring.struts.action.SpringTestAction">
<property name="testServiceSpring">
<ref bean="testServiceSpring"/>
</property>
</bean>
<bean id="testServiceSpring" class="com.spring.struts.springTest.TestServiceSpring">
<property name="businessMethods">
<ref bean="SpringProxy"/>
</property>
</bean>
<bean id="SpringProxy" class="org.springframework.ejb.access.SimpleRemoteStatele ssSessionProxyFactoryBean" lazy-init="true">
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>
<prop key="java.naming.provider.url">localhost</prop>
</props>
</property>
<property name="resourceRef">
<value>false</value>
</property>
<property name="jndiName">
<value>ejb/SpringSessionRemote</value>
</property>
<property name="businessInterface">
<value>com.spring.struts.ejb.interfaces.BusinessEJBStruts</value>
</property>
</bean>
</beans>
Now, the jndi name of the SS bean is registered in JBOSS as :-ejb/SpringSessionRemote. I have verified this with an independent command line client which can call the service ok. However, when I deploy the spring/struts webapp, I receive the following error :-
17:56:27,719 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '/springTest' defined in ServletContext resource [/WEB-INF/action-servlet.xml]: Can't resolve reference to bean 'testServiceSpring' while setting property 'testServiceSpring'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'testServiceSpring' defined in ServletContext resource [/WEB-INF/action-servlet.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: jndiName is required
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'testServiceSpring' defined in ServletContext resource [/WEB-INF/action-servlet.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: jndiName is required
java.lang.IllegalArgumentException: jndiName is required
So must be something to do with JNDI lookup - When I change the lookup to something incorrect, I receive a different error however :-
javax.naming.NameNotFoundException: SpringSdsfsessionRemote not bound
at org.jnp.server.NamingServer.getBinding(NamingServe r.java:491)
So can anyone suggest why I am getting the error "jndiName is required" when the name is obviously being resolved to a certain degree?! I have been stuck at this point for a couple of days now - Aaaarrggghh!!!!!
Thanks!
-Paul-