在此代码中:
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!