Glassfish上EJB的便携式JNDI语法查询 [英] Portable JNDI Syntax lookup for EJB on Glassfish

查看:148
本文介绍了Glassfish上EJB的便携式JNDI语法查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以前的尝试是让Netbeans部署EJB模块,它作为JAR而不是EAR构建到Netbeans可以访问的Glassfish服务器上。但是,通过使用 asadmin 可能遇到错误的CLI将该JAR部署到Glassfish



EAR通过CLI部署而不会发生问题 - 但是,EJB的JNDI名称似乎不起作用。什么是差异?


32.4.1.1便携式JNDI语法



三个JNDI命名空间用于便携式JNDI查找:java:global,
java:module和java:app。



java:全局JNDI命名空间是便携式使用JNDI查找找到远程
企业bean。 JNDI地址是
以下格式:java:全局[/应用程序名称] /模块名称/企业
bean名称[/ interface name]应用程序名称和模块名称默认
为应用程序和模块减去文件扩展名。
仅当应用程序在EAR中打包
时,才需要应用程序名称。仅当企业
bean实现多个业务界面时,才需要该接口名称。


http://docs.oracle.com/javaee/7/tutorial/doc/ejb- intro004.htm



查找这个bean的正确语法是什么?是否 java:global / HelloEAR / HelloEAR-ejb / greetings.GreetingsBeanRemote ?我已经尝试了不少成功的变种。



部署应用程序:

  thufir @ dur:〜$ 
thufir @ dur:〜$ glassfish-4.1 / glassfish / bin / asadmin list-applications
HelloEAR< ear,ejb>
命令列表 - 应用程序执行成功。
thufir @ dur:〜$
thufir @ dur:〜$ glassfish-4.1 / glassfish / bin / asadmin undeploy HelloEAR
命令取消部署成功执行。
thufir @ dur:〜$
thufir @ dur:〜$ glassfish-4.1 / glassfish / bin / asadmin list-applications
无需列出。
没有应用程序部署到此目标服务器。
命令列表 - 应用程序执行成功。
thufir @ dur:〜$
thufir @ dur:〜$ glassfish-4.1 / glassfish / bin / asadmin deploy NetBeansProjects / HelloEAR / dist / HelloEAR.ear
使用名称为HelloEAR的应用程序。
命令部署成功执行。
thufir @ dur:〜$

server.log:

  thufir @ dur:〜$ 
thufir @ dur:〜$ tail glassfish-4.1 / glassfish / domains / domain1 / logs / server.log -n 15
[2014-09-22T04:58:42.666-0700] [glassfish 4.1] [INFO] [AS-EJB-00055] [javax.enterprise.ejb.container] [tid:_ThreadID = 650 _ThreadName = admin-listener(9)] [timeMillis:1411387122666] [levelValue:800] [[
用于EJB的Glassfish特定(非便携式)JNDI名称GreetingsBean:[greetings.GreetingsBeanRemote#greetings.GreetingsBeanRemote,greetings.GreetingsBeanRemote ]]]

[2014-09-22T04:58:43.619-0700] [glassfish 4.1] [WARN] [] [org.jboss.weld.Event] [tid:_ThreadID = 650 _ThreadName = admin-listener(9)] [timeMillis:1411387123619] [levelValue:900] [[
WELD-000411:Observer方法[BackedAnnotatedMethod] private org.glassfish.jersey.gf.cdi.internal.CdiComponentProvider.processAnnotatedType(@观察ProcessAnnotatedType< Object>)接收所有注释类型的事件。考虑使用@WithAnnotations或具有边界的泛型类型限制事件。]]

[2014-09-22T04:58:43.628-0700] [glassfish 4.1] [WARN] [] [org.jboss。 weld.Event] [tid:_ThreadID = 650 _ThreadName = admin-listener(9)] [timeMillis:1411387123628] [levelValue:900] [[
WELD-000411:Observer方法[BackedAnnotatedMethod] org.glassfish.sse。 impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType< Object>,BeanManager)接收所有注释类型的事件。考虑使用@WithAnnotations或通用类型限制事件。]]

[2014-09-22T04:58:43.634-0700] [glassfish 4.1] [WARN] [] [org.jboss。 weld.Event] [tid:_ThreadID = 650 _ThreadName = admin-listener(9)] [timeMillis:1411387123634] [levelValue:900] [[
WELD-000411:Observer方法[BackedAnnotatedMethod] public org.glassfish.jms .injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType< Object>)接收所有注释类型的事件。考虑使用@WithAnnotations或具有边界的泛型类型限制事件。]]

[2014-09-22T04:58:44.757-0700] [glassfish 4.1] [INFO] [] [javax.enterprise。 system.core] [tid:_ThreadID = 650 _ThreadName = admin-listener(9)] [timeMillis:1411387124757] [levelValue:800] [[
HelloEAR成功部署在2,312毫秒]]

thufir @ dur:〜$

尝试查找:


NetBeansProjects / RemoteJNDI / dist / RemoteJNDI .jar
javax.naming.NamingException:Lookup failed for'[greetings.GreetingsBeanRemote'in SerialContext] [myEnv = {org.omg.CORBA.ORBInitialPort = 3700,java.naming.factory.initial = com.sun.enterprise上传文件.sun.corba .ee.impl.presentation.rmi.JNDIStateFactoryImpl,Context.SECURITY_PRINCIPAL = user1} [根异常是javax.naming.NameNotFoundException:[greetings.GreetingsBeanRemote not found]
在com.sun.enterprise.naming.impl.SerialContext .lookup(SerialContext.java:491)
在com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:438)
在javax.naming.InitialContext.lookup(InitialContext.java :411)
在net.bounceme.dur.jndi.RemoteJNDI.main(RemoteJNDI.java:15)
导致:javax.naming.NameNotFoundException:[greetings.GreetingsBeanRemote not found
at com.sun.enterprise.naming.impl.TransientContext.doLookup(TransientContext.java:237)
在com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:204)
在com.sun.enterprise.naming.impl.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:66)
在com.sun.enterprise.naming.impl.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProvider Impl.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect。 DelegatingMethodMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java:606)
在com.sun.corba.ee.impl.presentation.rmi。 ReflectiveTie.dispatchToMethod(ReflectiveTie.java:143)
在com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:173)
在com.sun.corba。 ee.impl.protocol.ServerRequestDispatcherImpl.dispatchToServant(ServerRequestDispatcherImpl.java:528)
在com.sun.corba.ee.impl.protocol.ServerRequestDispatcherImpl.dispatch(ServerRequestDispatcherImpl.java:199)
在com。 sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequestRequest(MessageMediatorImpl.java:1549)
在com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequest(MessageMediatorImpl.java :1425)
在com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleInput(MessageMediatorImpl.java:930)
在com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2 .callback(RequestMessage_1_2.java:213)
在com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequest(MessageMediatorImpl.java:694)
在com.sun.corba.ee.impl .protocol.MessageMediatorImpl.dispatch(MessageMediatorImpl.java:496)
在com.sun.corba.ee.impl.protocol.MessageMediatorImpl.doWork(MessageMediatorImpl.java:2222)
在com.sun.corba .ee.impl.threadpool.ThreadPoolImpl $ WorkerThread.performWork(ThreadPoolImpl.java:497)
在com.sun.corba.ee.impl.threadpool.ThreadPoolImpl $ WorkerThread.run(ThreadPoolImpl.java:540)
thufir @ dur:〜$


解决方案

为什么是没有java:或类似的东西的调用?



成功:

  thufir @ dur:〜$ 
thufir @ dur:〜$ glassfish-4.1 / glassfish / bin / asadmin list-applications
没有列表。
没有应用程序部署到此目标服务器。
命令列表 - 应用程序执行成功。
thufir @ dur:〜$
thufir @ dur:〜$ glassfish-4.1 / glassfish / bin / asadmin deploy NetBeansProjects / HelloEAR / dist / HelloEAR.ear
使用名称为HelloEAR的应用程序。
命令部署成功执行。
thufir @ dur:〜$
thufir @ dur:〜$ glassfish-4.1 / glassfish / bin / asadmin list-applications
HelloEAR< ear,ejb>
命令列表 - 应用程序执行成功。
thufir @ dur:〜$
thufir @ dur:〜$ glassfish-4.1 / glassfish / bin / appclient -client NetBeansProjects / RemoteJNDI / dist / RemoteJNDI.jar
hello world
thufir @ dur:〜$
thufir @ dur:〜$

客户端代码: p>

  package net.bounceme.dur.jndi; 

import greetings.GreetingsBeanRemote;
import java.util.logging.Logger;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class RemoteJNDI {

private static final Logger log = Logger.getLogger(RemoteJNDI.class.getName());

public static void main(String ... args){
try {
InitialContext ctx = new InitialContext();
// Object obj = ctx.lookup(java:global / HelloEAR / HelloEAR-ejb / greetings.GreetingsBeanRemote);
对象obj = ctx.lookup(greetings.GreetingsBeanRemote);
GreetingsBeanRemote gbr =(GreetingsBeanRemote)obj;
System.out.println(gbr.hi());
} catch(NamingException ex){
ex.printStackTrace();
}
}

}

ejb:

 包裹问候; 

import javax.ejb.Stateless;

@Stateless
public class GreetingsBean implements GreetingsBeanRemote {

@Override
public String hi(){
returnhello world;
}

@Override
public String bye(){
returnbye;
}

}

界面:

 包裹问候; 

import javax.ejb.Remote;

@Remote
public interface GreetingsBeanRemote {

public String hi();

public String bye();
}

服务器日志:

  [2014-09-22T17:55:56.091-0700] [glassfish 4.1] [INFO] [] [javax.enterprise.system.tools.deployment.common] [tid:_ThreadID = 40 _ThreadName = admin-listener(3)] [timeMillis:1411433756091] [levelValue:800] [[
visit unvisited references]]

[2014-09-22T17:55:56.233 -0700] [glassfish 4.1] [INFO] [AS-EJB-00054] [javax.enterprise.ejb.container] [tid:_ThreadID = 40 _ThreadName = admin-listener(3)] [timeMillis:1411433756233] [levelValue:800 ] [[
可移植的JNDI名称为EJB GreetingsBean:[java:global / HelloEAR / HelloEAR-ejb / GreetingsBean!greetings.GreetingsBeanRemote,java:global / HelloEAR / HelloEAR-ejb / GreetingsBean]]]

[2014-09-22T17:55:56.235-0700] [glassfish 4.1] [INFO] [AS-EJB-00055] [javax.enterprise.ejb.container] [tid:_ThreadID = 40 _ThreadName = admin-listener (3)] [timeMillis:1411433756235] [levelValue:800] [[
EJB GreetingsB的Glassfish特定(不可移植)JNDI名称ean:[greetings.GreetingsBeanRemote#greetings.GreetingsBeanRemote,greetings.GreetingsBeanRemote]]

[2014-09-22T17:55:56.321-0700] [glassfish 4.1] [WARN] [] [org。 jboss.weld.Event] [tid:_ThreadID = 40 _ThreadName = admin-listener(3)] [timeMillis:1411433756321] [levelValue:900] [[
WELD-000411:Observer方法[BackedAnnotatedMethod] public org.glassfish .jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType< Object>)接收所有注释类型的事件。考虑使用@WithAnnotations或具有边界的泛型类型限制事件。]]

[2014-09-22T17:55:56.341-0700] [glassfish 4.1] [WARN] [] [org.jboss。 weld.Event] [tid:_ThreadID = 40 _ThreadName = admin-listener(3)] [timeMillis:1411433756341] [levelValue:900] [[
WELD-000411:Observer方法[BackedAnnotatedMethod] org.glassfish.sse。 impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType< Object>,BeanManager)接收所有注释类型的事件。考虑使用@WithAnnotations或具有边界的泛型类型限制事件。]]

[2014-09-22T17:55:56.349-0700] [glassfish 4.1] [WARN] [] [org.jboss。 weld.Event] [tid:_ThreadID = 40 _ThreadName = admin-listener(3)] [timeMillis:1411433756349] [levelValue:900] [[
WELD-000411:Observer方法[BackedAnnotatedMethod] private org.glassfish.jersey .gf.cdi.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType< Object>)接收所有注释类型的事件。考虑使用@WithAnnotations或具有边界的泛型类型限制事件。]]

[2014-09-22T17:55:56.819-0700] [glassfish 4.1] [INFO] [] [javax.enterprise。 system.core] [tid:_ThreadID = 40 _ThreadName = admin-listener(3)] [timeMillis:1411433756819] [levelValue:800] [[
HelloEAR成功部署在842毫秒]]

thufir @ dur:〜$


Previous attempts were to have Netbeans deploy an EJB module, which builds as a JAR rather than an EAR, onto the Glassfish server which Netbeans has access to. However, deploying that JAR to Glassfish through the CLI with asadmin possibly runs into a bug.

The EAR deploys through the CLI without issue -- however, the JNDI names for the EJB doesn't appear to work. What is the discrepancy?

32.4.1.1 Portable JNDI Syntax

Three JNDI namespaces are used for portable JNDI lookups: java:global, java:module, and java:app.

The java:global JNDI namespace is the portable way of finding remote enterprise beans using JNDI lookups. JNDI addresses are of the following form: java:global[/application name]/module name /enterprise bean name[/interface name ] Application name and module name default to the name of the application and module minus the file extension. Application names are required only if the application is packaged within an EAR. The interface name is required only if the enterprise bean implements more than one business interface.

http://docs.oracle.com/javaee/7/tutorial/doc/ejb-intro004.htm

What is the correct syntax to lookup this bean? Is it java:global/HelloEAR/HelloEAR-ejb/greetings.GreetingsBeanRemote? I've tried more than a few variants of that without success.

deploying the app:

thufir@dur:~$ 
thufir@dur:~$ glassfish-4.1/glassfish/bin/asadmin list-applications
HelloEAR  <ear, ejb>  
Command list-applications executed successfully.
thufir@dur:~$ 
thufir@dur:~$ glassfish-4.1/glassfish/bin/asadmin undeploy HelloEAR
Command undeploy executed successfully.
thufir@dur:~$ 
thufir@dur:~$ glassfish-4.1/glassfish/bin/asadmin list-applications
Nothing to list.
No applications are deployed to this target server.
Command list-applications executed successfully.
thufir@dur:~$ 
thufir@dur:~$ glassfish-4.1/glassfish/bin/asadmin deploy NetBeansProjects/HelloEAR/dist/HelloEAR.ear 
Application deployed with name HelloEAR.
Command deploy executed successfully.
thufir@dur:~$ 

the server.log:

thufir@dur:~$ 
thufir@dur:~$ tail glassfish-4.1/glassfish/domains/domain1/logs/server.log -n 15
[2014-09-22T04:58:42.666-0700] [glassfish 4.1] [INFO] [AS-EJB-00055] [javax.enterprise.ejb.container] [tid: _ThreadID=650 _ThreadName=admin-listener(9)] [timeMillis: 1411387122666] [levelValue: 800] [[
  Glassfish-specific (Non-portable) JNDI names for EJB GreetingsBean: [greetings.GreetingsBeanRemote#greetings.GreetingsBeanRemote, greetings.GreetingsBeanRemote]]]

[2014-09-22T04:58:43.619-0700] [glassfish 4.1] [WARN] [] [org.jboss.weld.Event] [tid: _ThreadID=650 _ThreadName=admin-listener(9)] [timeMillis: 1411387123619] [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-09-22T04:58:43.628-0700] [glassfish 4.1] [WARN] [] [org.jboss.weld.Event] [tid: _ThreadID=650 _ThreadName=admin-listener(9)] [timeMillis: 1411387123628] [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-09-22T04:58:43.634-0700] [glassfish 4.1] [WARN] [] [org.jboss.weld.Event] [tid: _ThreadID=650 _ThreadName=admin-listener(9)] [timeMillis: 1411387123634] [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-09-22T04:58:44.757-0700] [glassfish 4.1] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=650 _ThreadName=admin-listener(9)] [timeMillis: 1411387124757] [levelValue: 800] [[
  HelloEAR was successfully deployed in 2,312 milliseconds.]]

thufir@dur:~$     

attempting the lookup:

thufir@dur:~$ 
thufir@dur:~$ glassfish-4.1/glassfish/bin/appclient -client NetBeansProjects/RemoteJNDI/dist/RemoteJNDI.jar 
javax.naming.NamingException: Lookup failed for '[greetings.GreetingsBeanRemote' 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: [greetings.GreetingsBeanRemote not found]
    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 net.bounceme.dur.jndi.RemoteJNDI.main(RemoteJNDI.java:15)
Caused by: javax.naming.NameNotFoundException: [greetings.GreetingsBeanRemote not found
    at com.sun.enterprise.naming.impl.TransientContext.doLookup(TransientContext.java:237)
    at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:204)
    at com.sun.enterprise.naming.impl.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:66)
    at com.sun.enterprise.naming.impl.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:109)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie.dispatchToMethod(ReflectiveTie.java:143)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:173)
    at com.sun.corba.ee.impl.protocol.ServerRequestDispatcherImpl.dispatchToServant(ServerRequestDispatcherImpl.java:528)
    at com.sun.corba.ee.impl.protocol.ServerRequestDispatcherImpl.dispatch(ServerRequestDispatcherImpl.java:199)
    at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequestRequest(MessageMediatorImpl.java:1549)
    at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequest(MessageMediatorImpl.java:1425)
    at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleInput(MessageMediatorImpl.java:930)
    at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:213)
    at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequest(MessageMediatorImpl.java:694)
    at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.dispatch(MessageMediatorImpl.java:496)
    at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.doWork(MessageMediatorImpl.java:2222)
    at com.sun.corba.ee.impl.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
    at com.sun.corba.ee.impl.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
thufir@dur:~$ 

解决方案

Why is the invocation of the bean without "java:" or anything like that?

success:

thufir@dur:~$ 
thufir@dur:~$ glassfish-4.1/glassfish/bin/asadmin list-applications
Nothing to list.
No applications are deployed to this target server.
Command list-applications executed successfully.
thufir@dur:~$ 
thufir@dur:~$ glassfish-4.1/glassfish/bin/asadmin deploy NetBeansProjects/HelloEAR/dist/HelloEAR.ear 
Application deployed with name HelloEAR.
Command deploy executed successfully.
thufir@dur:~$ 
thufir@dur:~$ glassfish-4.1/glassfish/bin/asadmin list-applications
HelloEAR  <ear, ejb>  
Command list-applications executed successfully.
thufir@dur:~$ 
thufir@dur:~$ glassfish-4.1/glassfish/bin/appclient -client NetBeansProjects/RemoteJNDI/dist/RemoteJNDI.jar 
hello world
thufir@dur:~$ 
thufir@dur:~$ 

client code:

package net.bounceme.dur.jndi;

import greetings.GreetingsBeanRemote;
import java.util.logging.Logger;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class RemoteJNDI {

    private static final Logger log = Logger.getLogger(RemoteJNDI.class.getName());

    public static void main(String... args) {
        try {
            InitialContext ctx = new InitialContext();
//            Object obj = ctx.lookup("java:global/HelloEAR/HelloEAR-ejb/greetings.GreetingsBeanRemote");
            Object obj = ctx.lookup("greetings.GreetingsBeanRemote");
            GreetingsBeanRemote gbr = (GreetingsBeanRemote) obj;
            System.out.println(gbr.hi());
        } catch (NamingException ex) {
            ex.printStackTrace();
        }
    }

}

ejb:

package greetings;

import javax.ejb.Stateless;

@Stateless
public class GreetingsBean implements GreetingsBeanRemote {

    @Override
    public String hi() {
        return "hello world";
    }

    @Override
    public String bye() {
        return "bye";
    }

}

interface:

package greetings;

import javax.ejb.Remote;

@Remote
public interface GreetingsBeanRemote {

    public String hi();

    public String bye();
}

server log:

[2014-09-22T17:55:56.091-0700] [glassfish 4.1] [INFO] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=40 _ThreadName=admin-listener(3)] [timeMillis: 1411433756091] [levelValue: 800] [[
  visiting unvisited references]]

[2014-09-22T17:55:56.233-0700] [glassfish 4.1] [INFO] [AS-EJB-00054] [javax.enterprise.ejb.container] [tid: _ThreadID=40 _ThreadName=admin-listener(3)] [timeMillis: 1411433756233] [levelValue: 800] [[
  Portable JNDI names for EJB GreetingsBean: [java:global/HelloEAR/HelloEAR-ejb/GreetingsBean!greetings.GreetingsBeanRemote, java:global/HelloEAR/HelloEAR-ejb/GreetingsBean]]]

[2014-09-22T17:55:56.235-0700] [glassfish 4.1] [INFO] [AS-EJB-00055] [javax.enterprise.ejb.container] [tid: _ThreadID=40 _ThreadName=admin-listener(3)] [timeMillis: 1411433756235] [levelValue: 800] [[
  Glassfish-specific (Non-portable) JNDI names for EJB GreetingsBean: [greetings.GreetingsBeanRemote#greetings.GreetingsBeanRemote, greetings.GreetingsBeanRemote]]]

[2014-09-22T17:55:56.321-0700] [glassfish 4.1] [WARN] [] [org.jboss.weld.Event] [tid: _ThreadID=40 _ThreadName=admin-listener(3)] [timeMillis: 1411433756321] [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-09-22T17:55:56.341-0700] [glassfish 4.1] [WARN] [] [org.jboss.weld.Event] [tid: _ThreadID=40 _ThreadName=admin-listener(3)] [timeMillis: 1411433756341] [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-09-22T17:55:56.349-0700] [glassfish 4.1] [WARN] [] [org.jboss.weld.Event] [tid: _ThreadID=40 _ThreadName=admin-listener(3)] [timeMillis: 1411433756349] [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-09-22T17:55:56.819-0700] [glassfish 4.1] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=40 _ThreadName=admin-listener(3)] [timeMillis: 1411433756819] [levelValue: 800] [[
  HelloEAR was successfully deployed in 842 milliseconds.]]

thufir@dur:~$ 

这篇关于Glassfish上EJB的便携式JNDI语法查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆