javax.naming.NameNotFoundException: While trying to lookup 'abc' didn't find subcontext 'abc'

后端 未结 1 923
醉梦人生
醉梦人生 2021-01-24 19:11

I\'ve developed a EJB application, with a Remote interface. This application was deployed on weblogic 12.

With a java application, i\'m trying use my EJB application, b

相关标签:
1条回答
  • 2021-01-24 19:46

    You could see your JNDI tree through the following path in Weblogic's console

    Environment -> servers -> select your server -> click on view JNDI tree link

    I always check JNDI tree for lookup problems.

    Why do not you use JNDI portable name for lookup?

    https://docs.oracle.com/cd/E19798-01/821-1841/girgn/index.html

    If you had deployed your implementation as a separate EAR, you could use the following lookup

    ctx.lookup("java:global/[your ear name]/[your jar file name(module name)]/NewSessionBean!co.com.tutorial.stateless.NewSessionBeanRemote");
    

    If you had deployed your implementation as a separate jar, you could use the following lookup

    ctx.lookup("java:global/[your jar file name(module name)]/NewSessionBean!co.com.tutorial.stateless.NewSessionBeanRemote");
    

    If you want to look up in the same EAR but in a different jar

    ctx.lookup("java:app/[your jar file name(module name)]/NewSessionBean!co.com.tutorial.stateless.NewSessionBeanRemote");
    

    If you want to look up in the same EAR and in the same jar

    ctx.lookup("java:module//NewSessionBean!co.com.tutorial.stateless.NewSessionBeanRemote");
    
    0 讨论(0)
提交回复
热议问题