PDA

View Full Version : cannot get an initial context.



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&#58;//someMachineName&#58;9080</prop>
</props>
</property>
</bean>
</beans>


and I am using it in my code like this:


ClassPathXmlApplicationContext beanFactory = new ClassPathXmlApplicationContext&#40;"myBeanConfig.xml"&#41;;
MyController mC=
&#40;MyController&#41;beanFactory.getBean&#40;"myController"&#41;;


and then I call a method in mC.
I'll appreciate any advice. Thanks!

Rod Johnson
Feb 12th, 2005, 07:33 AM
Looks like your context class name is incomplete:


com.ibm.websphere.naming.WsnInitialContex