用于java的CORBA查找:comp / env /或java:global

时间:2014-10-12 05:49:45

标签: java-ee netbeans glassfish rmi corba

CORBA查找EntAppLookup尽可能有效,better than运行appclient。但是,我至少想使用standard naming。具体而言,java:comp/envor similar conventions用于引用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日志显示正在部署的EAR:

[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

当我尝试使用java:comp/env/类型语法查找EJB时,我会收到命名错误:

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:~$ 

如何使用传统的java:comp/env/类型语法部署企业应用程序并使用CORBA查找?为什么这次查找在运行时失败了?

0 个答案:

没有答案