This discussion is archived
1 Reply Latest reply: Jun 23, 2011 2:07 AM by 870538 RSS

Can't find JNDI name ,Unable to lookup reference java:comp/env/ .problem

870538 Newbie
Currently Being Moderated
Hi,

i have the same problem with yours

This is my annotation with EJB3.0:


@Stateless(mappedName="ConSession")
@Remote(ConBeanRemote.class)
@Local(ConBean.class)



and i have a weblogic-ejb-jar.xml to define my jndi name

<?xml version="1.0" encoding="UTF-8"?>

<weblogic-ejb-jar xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-ejb-jar"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd
          http://www.bea.com/ns/weblogic/weblogic-ejb-jar
          http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd">

<weblogic-enterprise-bean>
     <ejb-name>ConSession</ejb-name>
<stateless-session-descriptor>
     <business-interface-jndi-name-map>
          <business-remote>com.staffware.ConBeanRemote</business-remote>
          <jndi-name>ConSession#com/staffware/ConBeanRemote</jndi-name>
          </business-interface-jndi-name-map>
          </stateless-session-descriptor>
          <local-jndi-name>com/ConfigurationManagerBeanLocal</local-jndi-name>
     </weblogic-enterprise-bean>
</weblogic-ejb-jar>

[ the most important: I also have specify JNDI in a java file like this
          beanRemoteJNDIs.put("ConBeanRemote","ConSession#com/staffware/ConBeanRemote");
     
          beanLocalJNDIs.put("ConBean","java:comp/env/com/ConBean");
]

and i can find the ConSession#com/staffware/ConBeanRemote in the jndi tree . but it shows like Multilevel directory tree

and when i login the website and click the button

.another error comes out :


13:35:55,046 ERROR [EJBDelegate] Unable to lookup reference java:comp/env/com/ConBean for ConBean!
javax.naming.LinkException: [Root exception is javax.naming.LinkException:  [Root exception is javax.naming.NameNotFoun
dException: While trying to look up /app/ejb/CONFIG-ejb-2.0.jar#ConSession/local-home in /app/webapp/CO
M/18328287.; remaining name '/app/ejb/CONFIG-ejb-2/0/jar#ConfigurationManagerSession/local-home']; Link Remaining Name:
'java:app/ejb/CONFIG-ejb-2.0.jar#ConSession/local-home']; Link Remaining Name: 'com/ConBean'
at weblogic.jndi.internal.WLNamingManager.getObjectInstance(WLNamingManager.java:104)
at weblogic.jndi.internal.BasicNamingNode.resolveObject(BasicNamingNode.java:884)
at weblogic.jndi.internal.ApplicationNamingNode.resolveObject(ApplicationNamingNode.java:187)

。。。。。。。。。。。。。


what should i do ?

and should i specify the jndi name in the java file . the JNDI-name defined in the weblogic-ejb-jar.xml is right?
who can help me?

this problme make me dead , and i only have a little time to solve it /


thanks very much in advance!!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points