CORBA的查找, EntAppLookup ,工作至今,因为它去, 优于运行appclient
。 不过,我想至少要使用标准命名 。 具体而言, java:comp/env
, 或类似的惯例 ,以引用EJB。 部署企业应用程序,与EJB模块,并运行CORBA查找:
thufir@dur:~$
thufir@dur:~$ ll NetBeansProjects/EntAppEJB/dist/EntAppEJB.ear
-rw-rw-r-- 1 thufir thufir 4659 Oct 11 22:17 NetBeansProjects/EntAppEJB/dist/EntAppEJB.ear
thufir@dur:~$
thufir@dur:~$ glassfish-4.1/glassfish/bin/asadmin
Use "exit" to exit and "help" for online help.
asadmin>
asadmin> list-applications
Nothing to list.
No applications are deployed to this target server.
Command list-applications executed successfully.
asadmin>
asadmin> deploy NetBeansProjects/EntAppEJB/dist/EntAppEJB.ear
Application deployed with name EntAppEJB.
Command deploy executed successfully.
asadmin>
asadmin> list-jndi-entries
UserTransaction: com.sun.enterprise.transaction.startup.TransactionLifecycleService$2
ejb.EJBRemoteInterface__3_x_Internal_RemoteBusinessHome__: javax.naming.Reference
ejb: com.sun.enterprise.naming.impl.TransientContext
ejb.EJBRemoteInterface: javax.naming.Reference
java:global: com.sun.enterprise.naming.impl.TransientContext
jdbc: com.sun.enterprise.naming.impl.TransientContext
concurrent: com.sun.enterprise.naming.impl.TransientContext
com.sun.enterprise.container.common.spi.util.InjectionManager: com.sun.enterprise.container.common.impl.util.InjectionManagerImpl
jms: com.sun.enterprise.naming.impl.TransientContext
ejb.EJBRemoteInterface#ejb.EJBRemoteInterface: javax.naming.Reference
Command list-jndi-entries executed successfully.
asadmin>
asadmin> list-jndi-resources
Command list-jndi-resources executed successfully.
asadmin>
asadmin> exit
Command multimode executed successfully.
thufir@dur:~$
thufir@dur:~$ glassfish-4.1/glassfish/bin/appclient -client NetBeansProjects/EntAppLookup/dist/EntAppLookup.jar
Oct 11, 2014 10:21:55 PM entapplookup.EntAppLookup main
INFO: This is My Session Bean
thufir@dur:~$
表示挖耳的GlassFish日志部署:
[2014-10-11T22:25:43.750-0700] [glassfish 4.1] [INFO] [AS_ACDEPL-00104] [javax.enterprise.system.container.appclient] [tid: _ThreadID=141 _ThreadName=admin-listener(7)] [timeMillis: 1413091543750] [levelValue: 800] [[
Java Web Start services stopped for the app client EntAppEJB/EntAppClient.jar]]
[2014-10-11T22:27:06.364-0700] [glassfish 4.1] [INFO] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=41 _ThreadName=admin-listener(4)] [timeMillis: 1413091626364] [levelValue: 800] [[
visiting unvisited references]]
[2014-10-11T22:27:06.390-0700] [glassfish 4.1] [INFO] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=41 _ThreadName=admin-listener(4)] [timeMillis: 1413091626390] [levelValue: 800] [[
visiting unvisited references]]
[2014-10-11T22:27:06.444-0700] [glassfish 4.1] [INFO] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=41 _ThreadName=admin-listener(4)] [timeMillis: 1413091626444] [levelValue: 800] [[
visiting unvisited references]]
[2014-10-11T22:27:06.724-0700] [glassfish 4.1] [INFO] [AS-EJB-00054] [javax.enterprise.ejb.container] [tid: _ThreadID=41 _ThreadName=admin-listener(4)] [timeMillis: 1413091626724] [levelValue: 800] [[
Portable JNDI names for EJB MySession: [java:global/EntAppEJB/EntAppEJB-ejb/MySession, java:global/EntAppEJB/EntAppEJB-ejb/MySession!ejb.EJBRemoteInterface]]]
[2014-10-11T22:27:06.724-0700] [glassfish 4.1] [INFO] [AS-EJB-00055] [javax.enterprise.ejb.container] [tid: _ThreadID=41 _ThreadName=admin-listener(4)] [timeMillis: 1413091626724] [levelValue: 800] [[
Glassfish-specific (Non-portable) JNDI names for EJB MySession: [ejb.EJBRemoteInterface#ejb.EJBRemoteInterface, ejb.EJBRemoteInterface]]]
[2014-10-11T22:27:07.529-0700] [glassfish 4.1] [WARN] [] [org.jboss.weld.Event] [tid: _ThreadID=41 _ThreadName=admin-listener(4)] [timeMillis: 1413091627529] [levelValue: 900] [[
WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.]]
[2014-10-11T22:27:07.538-0700] [glassfish 4.1] [WARN] [] [org.jboss.weld.Event] [tid: _ThreadID=41 _ThreadName=admin-listener(4)] [timeMillis: 1413091627538] [levelValue: 900] [[
WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.]]
[2014-10-11T22:27:07.559-0700] [glassfish 4.1] [WARN] [] [org.jboss.weld.Event] [tid: _ThreadID=41 _ThreadName=admin-listener(4)] [timeMillis: 1413091627559] [levelValue: 900] [[
WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.gf.cdi.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.]]
[2014-10-11T22:27:09.402-0700] [glassfish 4.1] [WARNING] [AS-ACDEPL-00112] [javax.enterprise.system.container.appclient] [tid: _ThreadID=41 _ThreadName=admin-listener(4)] [timeMillis: 1413091629402] [levelValue: 900] [[
The following extensions or libraries are referenced from the manifest of /home/thufir/glassfish-4.1/glassfish/domains/domain1/applications/EntAppEJB/EntAppClient.jar but were not found where indicated: EJBRemoteInterface.jar ; ignoring and continuing]]
[2014-10-11T22:27:09.434-0700] [glassfish 4.1] [INFO] [AS-ACDEPL-00103] [javax.enterprise.system.container.appclient] [tid: _ThreadID=41 _ThreadName=admin-listener(4)] [timeMillis: 1413091629434] [levelValue: 800] [[
Java Web Start services started for the app client EntAppEJB/EntAppClient.jar (contextRoot: /EntAppEJB/EntAppClient)]]
[2014-10-11T22:27:09.554-0700] [glassfish 4.1] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=41 _ThreadName=admin-listener(4)] [timeMillis: 1413091629554] [levelValue: 800] [[
EntAppEJB was successfully deployed in 3,216 milliseconds.]]
对我的进步github上一般文件条目:
https://github.com/THUFIR/EntAppClientJWS
它包括联结到以下内容:
企业应用程序和EJB模块:EntAppEJB https://github.com/THUFIR/EntAppEJB
在CLI appclient:EntAppClient https://github.com/THUFIR/EntAppClient
远程接口库:EJBRemoteInterface https://github.com/THUFIR/EJBRemoteInterface
在CORBA查找:EntAppLookup https://github.com/THUFIR/EntAppLookup
当我尝试查找与EJB java:comp/env/
类型的语法,我得到命名错误:
thufir@dur:~$
thufir@dur:~$ glassfish-4.1/glassfish/bin/appclient -client NetBeansProjects/EntAppLookup/dist/EntAppLookup.jar
Exception in thread "main" javax.naming.NamingException: Lookup failed for 'java:comp/env/ejb.EJBRemoteInterface' in SerialContext[myEnv={org.omg.CORBA.ORBInitialPort=3700, java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, Context.SECURITY_CREDENTIALS=pass123, org.omg.CORBA.ORBInitialHost=localhost, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, Context.SECURITY_PRINCIPAL=user1} [Root exception is javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb.EJBRemoteInterface]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:491)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:438)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at entapplookup.EntAppLookup.main(EntAppLookup.java:17)
Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb.EJBRemoteInterface
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:741)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:715)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:159)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:471)
... 3 more
thufir@dur:~$
thufir@dur:~$ glassfish-4.1/glassfish/bin/appclient -client NetBeansProjects/EntAppLookup/dist/EntAppLookup.jar
Exception in thread "main" javax.naming.NamingException: Lookup failed for 'java:comp/env/EJBRemoteInterface' in SerialContext[myEnv={org.omg.CORBA.ORBInitialPort=3700, java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, Context.SECURITY_CREDENTIALS=pass123, org.omg.CORBA.ORBInitialHost=localhost, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, Context.SECURITY_PRINCIPAL=user1} [Root exception is javax.naming.NameNotFoundException: No object bound to name java:comp/env/EJBRemoteInterface]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:491)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:438)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at entapplookup.EntAppLookup.main(EntAppLookup.java:16)
Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/EJBRemoteInterface
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:741)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:715)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:159)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:471)
... 3 more
thufir@dur:~$
我怎样才能部署企业应用程序,并使用CORBA常规看它java:comp/env/
类型的语法? 为什么当我运行此查找失败?