没有可用于在jboss上处理的EJB接收器 - 仅在新线程中

时间:2014-04-09 17:48:29

标签: java jboss ejb-3.1

在此代码中:

Context ctx = new InitialContext(jndiProps);
System.out.println("AB");
for (int i = 0; i < 5; i++) {
    final LancadorDeDado lancadorTeste = (LancadorDeDado) ctx.lookup("dadoWeb/LancadorDeDadoBean!br.com.k19.sessionbeans.LancadorDeDado");
    System.out.println("Dado: " + lancadorTeste.lanca());
    Thread thread = new Thread(new Runnable() {
        @Override
        public void run() {
            for (int i = 0; i < 2; i++) {
                System.out.println("Dado Nova Thread: " + lancadorTeste.lanca());
            }
        }
    });
    thread.start();
}

行:

System.out.println("Dado: " + lancadorTeste.lanca());

whorks很好,但行:

System.out.println("Dado Nova Thread: " + lancadorTeste.lanca());

不要工作并说出这个例子:

Exception in thread "Thread-2" java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:dadoWeb,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@15def7ff

什么错了?!

DRauber!

0 个答案:

没有答案