• Post Reply Bookmark Topic Watch Topic
  • New Topic

javax.naming.NameNotFoundException in EJB 2.x +Jboss 7,JNDI lookup exception

 
anupama mane
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a small application in EJB2.0 and while deployed into JBOSS 7.1.1.final .I am getting the error in the screen...

1.Ejb2Servlet .java



2.ejb-jar.xml



I have added datasource in the standalone.xml but i get this error on the run.




Can you please guide me this problem.
 
Anand Bansal
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anupama,

Can you try looking up in the following way?

XXLocalHome obj = (XXLocalHome) context.lookup("ejb:/<package>//XXBean!<package>.XXLocalHome");

I verified that lookup passes and I get a proxy object

(com.sun.proxy.$Proxy15) Proxy for remote EJB StatelessEJBLocator{appName='', moduleName='<package name>', distinctName='', beanName='XXBean', view='interface <package>.XXLocalHome'}

However, just to add I am getting a EJB receiver error after this. So, I am also stuck on a similar issues. Please try and let me know if it creates a magic in your case.
 
Anand Bansal
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the solution.

Entity beans 2.X are not supported in the lightweight configuration of JBoss AS 7 onwards. We have to use the use the standalone-full configuration or standalone-full-ha configuration for entity beans deployment in AS7.
Start the server using the standalone full.xml and and you'll see the entity beans being bound to JNDI:
17:27:31,762 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-7) JNDI bindings for session bean named XXXBean in deployment unit subdeployment "XXXEJB.jar" of deployment "XXXEAR.ear" are as follows:

java:global/XXXEAR/XXXXEJB/<ejb bean name>!<package name><ejb local home>
java:app/XXXXEJB/<ejb bean name>!<package name><ejb local home>
java:module/<ejb bean name>!<package name><ejb local home>
java:global/XXXEAR/XXXXEJB/<ejb beanname>!<package name><ejb local>
java:app/XXXXEJB/<ejb bena name>!<package name><ejb local>
java:module/<ejb bean name>!<package name><ejb local>

The JNDI should be looked up by the java:global binding :
java:global/XXXEAR/XXXXEJB/<ejb beanname>!<package name><ejb local home>.
It works good..!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!