javax.naming.NameNotFoundException:com.javacodegeeks.example.service.AccountServiceRemote

时间:2015-11-15 20:08:20

标签: java java-ee glassfish

我已经完成了本教程,并且在运行时崩溃了。我尝试下载了教程的代码,它也崩溃了。本教程中的代码已经完成。

http://examples.javacodegeeks.com/enterprise-java/ejb3/ejb-tutorial-beginners/

我用过

  • NetBeans版本8.1
  • Glassfish 4.1.1
  • JDK 1.7
  • Windows 8.1

我可以构建并运行,在Servlet中填写两个字符串。

然后点击"创建"我明白了: Image of the error, in the web browser

完整的错误消息:

type Exception report
messageInternal Server Error
descriptionThe server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Error instantiating servlet class com.javacodegeeks.example.tester.AccountController
root cause
com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class com.javacodegeeks.example.tester.AccountController
root cause
com.sun.enterprise.container.common.spi.util.InjectionException: Exception attempting to inject Remote ejb-ref name=com.javacodegeeks.example.tester.AccountController/accountService,Remote 3.x interface =com.javacodegeeks.example.service.AccountServiceRemote,ejb-link=null,lookup=,mappedName=,jndi-name=com.javacodegeeks.example.service.AccountServiceRemote,refType=Session into class com.javacodegeeks.example.tester.AccountController: Lookup failed for 'java:comp/env/com.javacodegeeks.example.tester.AccountController/accountService' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}
root cause
javax.naming.NamingException: Lookup failed for 'java:comp/env/com.javacodegeeks.example.tester.AccountController/accountService' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NamingException: Exception resolving Ejb for 'Remote ejb-ref name=com.javacodegeeks.example.tester.AccountController/accountService,Remote 3.x interface =com.javacodegeeks.example.service.AccountServiceRemote,ejb-link=null,lookup=,mappedName=,jndi-name=com.javacodegeeks.example.service.AccountServiceRemote,refType=Session' .  Actual (possibly internal) Remote JNDI name used for lookup is 'com.javacodegeeks.example.service.AccountServiceRemote#com.javacodegeeks.example.service.AccountServiceRemote' [Root exception is javax.naming.NamingException: Lookup failed for 'com.javacodegeeks.example.service.AccountServiceRemote#com.javacodegeeks.example.service.AccountServiceRemote' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: com.javacodegeeks.example.service.AccountServiceRemote#com.javacodegeeks.example.service.AccountServiceRemote not found]]]
root cause
javax.naming.NamingException: Exception resolving Ejb for 'Remote ejb-ref name=com.javacodegeeks.example.tester.AccountController/accountService,Remote 3.x interface =com.javacodegeeks.example.service.AccountServiceRemote,ejb-link=null,lookup=,mappedName=,jndi-name=com.javacodegeeks.example.service.AccountServiceRemote,refType=Session' .  Actual (possibly internal) Remote JNDI name used for lookup is 'com.javacodegeeks.example.service.AccountServiceRemote#com.javacodegeeks.example.service.AccountServiceRemote' [Root exception is javax.naming.NamingException: Lookup failed for 'com.javacodegeeks.example.service.AccountServiceRemote#com.javacodegeeks.example.service.AccountServiceRemote' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: com.javacodegeeks.example.service.AccountServiceRemote#com.javacodegeeks.example.service.AccountServiceRemote not found]]
root cause
javax.naming.NamingException: Lookup failed for 'com.javacodegeeks.example.service.AccountServiceRemote#com.javacodegeeks.example.service.AccountServiceRemote' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: com.javacodegeeks.example.service.AccountServiceRemote#com.javacodegeeks.example.service.AccountServiceRemote not found]
root cause
javax.naming.NameNotFoundException: com.javacodegeeks.example.service.AccountServiceRemote#com.javacodegeeks.example.service.AccountServiceRemote not found
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.1.1 logs.

0 个答案:

没有答案