This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Error creating bean with name 'helloWorldService' defined in class path resource &#91;beans.xml&#93;&#58; Initialization of bean failed; nested exception is javax.naming.NameNotFoundException&#58; Name comp/env/ejb not found in context "java&#58;".
javax.naming.NameNotFoundException&#58; Name comp/env/ejb not found in context "java&#58;".
at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal&#40;NameSpace.java&#58;1716&#41;
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal&#40;NameSpace.java&#58;1062&#41;
at com.ibm.ws.naming.ipbase.NameSpace.lookup&#40;NameSpace.java&#58;985&#41;
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup&#40;UrlContextImpl.java&#58;1263&#41;
at com.ibm.ws.naming.java.javaURLContextRoot.lookup&#40;javaURLContextRoot.java&#58;198&#41;
at com.ibm.ws.naming.java.javaURLContextRoot.lookup&#40;javaURLContextRoot.java&#58;139&#41;
at javax.naming.InitialContext.lookup&#40;InitialContext.java&#58;361&#41;
at org.springframework.jndi.JndiTemplate$1.doInContext&#40;JndiTemplate.java&#58;123&#41;
at org.springframework.jndi.JndiTemplate.execute&#40;JndiTemplate.java&#58;85&#41;
at org.springframework.jndi.JndiTemplate.lookup&#40;JndiTemplate.java&#58;121&#41;
at org.springframework.jndi.JndiLocatorSupport.lookup&#40;JndiLocatorSupport.java&#58;71&#41;
at org.springframework.jndi.JndiObjectLocator.lookup&#40;JndiObjectLocator.java&#58;85&#41;
at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.refreshHome&#40;AbstractSlsbInvokerInterceptor.java&#58;102&#41;
at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.afterPropertiesSet&#40;AbstractSlsbInvokerInterceptor.java&#58;90&#41;
at org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean.afterPropertiesSet&#40;LocalStatelessSessionProxyFactoryBean.java&#58;83&#41;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods&#40;AbstractAutowireCapableBeanFactory.java&#58;962&#41;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean&#40;AbstractAutowireCapableBeanFactory.java&#58;354&#41;
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean&#40;AbstractBeanFactory.java&#58;223&#41;
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean&#40;AbstractBeanFactory.java&#58;147&#41;
at org.springframework.context.support.AbstractApplicationContext.getBean&#40;AbstractApplicationContext.java&#58;536&#41;
at HelloWorldServlet.doGet&#40;HelloWorldServlet.java&#58;37&#41;

Has anybody any tipps, what to do, to get EJB support running on a WebSphere enviroment?

Comment

1. In your JNDI look of the session bean you are not giving the long jndi name like 'cell/nodes/machineNameNode03/servers/server1/ejb/ejbs/EventPublisher'
which I had to give, to access from a test client not using spring.
Your session bean jndi name looks very simple unlike mine.

So, what Provider URL and naming factory did you use to just access local:ejb/someService

2. Have you deployed your application in the same JVM as the Websphere server to access the session beans locally?

Error creating bean with name 'helloWorldService' defined in class path resource [beans.xml]: Initialization of bean failed; nested exception is javax.naming.NameNotFoundException: Name comp/env/ejb not found in context "java:".
javax.naming.NameNotFoundException: Name comp/env/ejb not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1716)
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1062)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:985)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:198)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:139)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:123)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:71)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:85)
at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.refreshHome(AbstractSlsbInvokerInterceptor.java:102)
at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.afterPropertiesSet(AbstractSlsbInvokerInterceptor.java:90)
at org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean.afterPropertiesSet(LocalStatelessSessionProxyFactoryBean.java:83)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:962)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:354)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:536)
at HelloWorldServlet.doGet(HelloWorldServlet.java:37)

Has anybody any tipps, what to do, to get EJB support running on a WebSphere enviroment?