fiacobelli
Feb 11th, 2005, 03:16 PM
Hi!
I am new to spring and I wanted to know how to call an EJB residing on a different machine. I am getting a
Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContex
does anybody know which jar should I include for this? I am working with IBM Rational Developer and WS 6.
Am I missing something?
Here's myBeanConfig.xml file and my code:
<beans>
<bean id="myController"
lazy-init="true"
class="org.springframework.ejb.access.SimpleRemoteStatele ssSessionProxyFactoryBean">
<property name="jndiName">
<value>ejb/mybean/MyBeanHome</value>
</property>
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.initial">com.ibm.websphere.naming.WsnInitialContex</prop>
<prop key="java.naming.provider.url">iiop://someMachineName:9080</prop>
</props>
</property>
</bean>
</beans>
and I am using it in my code like this:
ClassPathXmlApplicationContext beanFactory = new ClassPathXmlApplicationContext("myBeanConfig.xml");
MyController mC=
(MyController)beanFactory.getBean("myController");
and then I call a method in mC.
I'll appreciate any advice. Thanks!
I am new to spring and I wanted to know how to call an EJB residing on a different machine. I am getting a
Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContex
does anybody know which jar should I include for this? I am working with IBM Rational Developer and WS 6.
Am I missing something?
Here's myBeanConfig.xml file and my code:
<beans>
<bean id="myController"
lazy-init="true"
class="org.springframework.ejb.access.SimpleRemoteStatele ssSessionProxyFactoryBean">
<property name="jndiName">
<value>ejb/mybean/MyBeanHome</value>
</property>
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.initial">com.ibm.websphere.naming.WsnInitialContex</prop>
<prop key="java.naming.provider.url">iiop://someMachineName:9080</prop>
</props>
</property>
</bean>
</beans>
and I am using it in my code like this:
ClassPathXmlApplicationContext beanFactory = new ClassPathXmlApplicationContext("myBeanConfig.xml");
MyController mC=
(MyController)beanFactory.getBean("myController");
and then I call a method in mC.
I'll appreciate any advice. Thanks!