`

javax.naming.NameNotFoundException: While trying to lookup 。。。

阅读更多
错误大致如下:

javax.naming.NameNotFoundException: While trying to lookup 'HelloWorldApp.HelloWorldBean/local' didn't find subcontext 'HelloWorldApp'. Resolved ''; remaining name 'HelloWorldApp/HelloWorldBean/local' at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1138) at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:246) at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:171) at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:205) at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254) at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:367) at javax.naming.InitialContext.lookup(InitialContext.java:351) at ejb.learning.Locator.getBean(Ljava.lang.String  Ljava.lang.Object;(Unknown Source) at ejb.learning.web.HelloWorldServlet.processRequest(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse  V(Unknown Source) at ejb.learning.web.HelloWorldServlet.doGet(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse  V(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3370) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedAction  Ljava.lang.Object;(Unknown Source) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2117) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2023) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200) at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)




解决办法:


在bean里面加上
@Stateless(mappedName="HelloWorldBean")



客户端访问的时候只需要

helloWorld = (HelloWorld) ctx.lookup("HelloWorldBean#"+ HelloWorld.class.getName());

ok,问题解决
分享到:
评论

相关推荐

    Javax.naming.NameNotFoundException

    在IT行业中,我们经常遇到各种异常,其中之一是“Javax.naming.NameNotFoundException”。这个异常通常在Java命名和目录接口(JNDI)中出现,当我们尝试查找一个在命名上下文中不存在的名称时,就会抛出这个异常。...

    javax.naming.NamingException: Cannot create resource instance

    javax.naming.NamingException: Cannot create resource instance类加载异常,希望可以帮助跟我一样错误的人。

    javax.activation.UnsupportedDataTypeException: no object DCH for MIME type

    ORA-29532: Java call terminated by uncaught Java exception: javax.mail.MessagingException: IOException while sending message; nested exception is: javax.activation.UnsupportedDataTypeException: no ...

    图片处理 javax.imageio.IIOException: Unsupported Image Type

    在Java编程环境中,图片处理是一项常见的任务,但有时可能会遇到“javax.imageio.IIOException: Unsupported Image Type”的错误。这个异常通常表示Java的`ImageIO`类库无法识别或支持所尝试读取或写入的图像格式。...

    javax.servlet-3.0.0.v201112011016-API文档-中文版.zip

    赠送jar包:javax.servlet-3.0.0.v201112011016.jar; 赠送原API文档:javax.servlet-3.0.0.v201112011016-javadoc.jar; 赠送源代码:javax.servlet-3.0.0.v201112011016-sources.jar; 赠送Maven依赖信息文件:...

    javax.servlet-3.0.0.v201112011016-API文档-中英对照版.zip

    赠送jar包:javax.servlet-3.0.0.v201112011016.jar; 赠送原API文档:javax.servlet-3.0.0.v201112011016-javadoc.jar; 赠送源代码:javax.servlet-3.0.0.v201112011016-sources.jar; 赠送Maven依赖信息文件:...

    javax.annotation-api-1.3.2-API文档-中文版.zip

    赠送jar包:javax.annotation-api-1.3.2.jar; 赠送原API文档:javax.annotation-api-1.3.2-javadoc.jar; 赠送源代码:javax.annotation-api-1.3.2-sources.jar; 赠送Maven依赖信息文件:javax.annotation-api-...

    javax.mail-1.5.6-API文档-中文版.zip

    赠送jar包:javax.mail-1.5.6.jar; 赠送原API文档:javax.mail-1.5.6-javadoc.jar; 赠送源代码:javax.mail-1.5.6-sources.jar; 赠送Maven依赖信息文件:javax.mail-1.5.6.pom; 包含翻译后的API文档:javax.mail...

    javax.mail-1.6.2-API文档-中英对照版.zip

    赠送jar包:javax.mail-1.6.2.jar; 赠送原API文档:javax.mail-1.6.2-javadoc.jar; 赠送源代码:javax.mail-1.6.2-sources.jar; 赠送Maven依赖信息文件:javax.mail-1.6.2.pom; 包含翻译后的API文档:javax.mail...

    javax.servlet-api-3.1.0.jar中文文档.zip

    javax.servlet-api-***.jar中文文档.zip,java,javax.servlet-api-***.jar,javax.servlet,javax.servlet-api,***,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,javax,servlet,api,中文API文档,手册,开发...

    javax.servlet jar包---解决找不到javax.servlet.*等问题

    当你遇到“找不到javax.servlet.*”这样的错误时,通常是因为你的项目缺少了这个库,所以需要引入`javax.servlet.jar`来解决问题。 1. **Java Servlet简介** Java Servlet是Java平台上的一个标准,用于扩展服务器...

    javax.transaction-api-1.2-API文档-中文版.zip

    赠送jar包:javax.transaction-api-1.2.jar; 赠送原API文档:javax.transaction-api-1.2-javadoc.jar; 赠送源代码:javax.transaction-api-1.2-sources.jar; 赠送Maven依赖信息文件:javax.transaction-api-1.2....

    javax.activation-1.2.0-API文档-中文版.zip

    赠送jar包:javax.activation-1.2.0.jar; 赠送原API文档:javax.activation-1.2.0-javadoc.jar; 赠送源代码:javax.activation-1.2.0-sources.jar; 赠送Maven依赖信息文件:javax.activation-1.2.0.pom; 包含...

    javax.annotation-api-1.2-API文档-中文版.zip

    赠送jar包:javax.annotation-api-1.2.jar; 赠送原API文档:javax.annotation-api-1.2-javadoc.jar; 赠送源代码:javax.annotation-api-1.2-sources.jar; 赠送Maven依赖信息文件:javax.annotation-api-1.2.pom;...

    android DES加密解密 javax.crypto.IllegalBlockSizeException: last block incomplete in

    本话题将围绕在Android中使用DES加密和解密时遇到的一个常见问题展开:`javax.crypto.IllegalBlockSizeException: last block incomplete in decryption`。 这个异常通常发生在解密过程中,当输入的数据块大小与DES...

    jar包_javax.annotation.zip

    在本例中,我们关注的`jar`包是`javax.annotation.zip`,它包含了`javax.annotation`相关的API,主要用于处理Java的注解(Annotation)。 `javax.annotation`是Java标准版(Java SE)的一部分,提供了标准的注解,...

    javax.servlet-api-4.0.1.jar中文文档.zip

    javax.servlet-api-***.jar中文文档.zip,java,javax.servlet-api-***.jar,javax.servlet,javax.servlet-api,***,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,javax,servlet,api,中文API文档,手册,开发...

    javax.xml.rpc相关jar包

    描述中提到的“解决javax.xml jar包缺失的问题,引进javax.xml.rpc-api-1.1.1.jar”,意味着在开发或运行某个Java项目时,可能会遇到由于缺少`javax.xml.rpc`相关的jar包导致的编译或运行错误。为了解决这个问题,...

    com.springsource.javax.media.jai.core-1.1.3.jar

    import javax.media.jai.JAI; import javax.media.jai.RenderedOp; jai_core-1.1.3.jar jai_codec-1.1.3.jar

    javax.websocket-api-1.1-API文档-中文版.zip

    赠送jar包:javax.websocket-api-1.1.jar; 赠送原API文档:javax.websocket-api-1.1-javadoc.jar; 赠送源代码:javax.websocket-api-1.1-sources.jar; 赠送Maven依赖信息文件:javax.websocket-api-1.1.pom; ...

Global site tag (gtag.js) - Google Analytics