Ho ottenuto @Remote EJB su JBoss AS 7, disponibile per nome java:global/RandomEjb/DefaultRemoteRandom!pl.lechglowiak.ejbTest.RemoteRandom
.Spring <jee: remote-slsb> e JBoss AS7 - Nessun ricevitore EJB disponibile per la gestione
Il client standalone è un'applicazione Spring che utilizza il bean <jee:remote-slsb>
. Quando provo ad usare quel bean ottengo java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:, moduleName:RandomEjb, distinctName:] combination for invocation context [email protected]
.
Ecco parte rilevante del applicationContext.xml:
<jee:remote-slsb id="remoteRandom"
jndi-name="RandomEjb/DefaultRemoteRandom!pl.lechglowiak.ejbTest.RemoteRandom"
business-interface="pl.lechglowiak.ejbTest.RemoteRandom"
<jee:environment>
java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
java.naming.provider.url=remote://localhost:4447
jboss.naming.client.ejb.context=true
java.naming.security.principal=testuser
java.naming.security.credentials=testpassword
</jee:environment>
</jee:remote-slsb>
<bean id="remoteClient" class="pl.lechglowiak.RemoteClient">
<property name="remote" ref="remoteRandom" />
</bean>
RemoteClient.java public class RemoteClient {
private RemoteRandom random;
public void setRemote(RemoteRandom random){
this.random = random;
}
public Integer callRandom(){
try {
return random.getRandom(100);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
mio JBoss vaso cliente: org.jboss .as jboss-as-ejb-client-bom 7.1.2.Finale pom
pl.lechglowiak.ejbTest.RemoteRandom è disponibile per il classpath dell'applicazione client. jndi.properties contiene proprietà esatte come in <jee:environment>
di <jee:remote-slsb>
.
Tale codice viene eseguito senza eccezione:
Context ctx2 = new InitialContext();
RemoteRandom rr = (RemoteRandom) ctx2.lookup("RandomEjb/DefaultRemoteRandom!pl.lechglowiak.ejbTest.RemoteRandom");
System.out.println(rr.getRandom(10000));
Ma questo:
ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
RemoteClient client = ctx.getBean("remoteClient", RemoteClient.class);
System.out.println(client.callRandom());
termina con eccezione: java.lang.IllegalStateException: EJBCLIENT000025: No Ricevitore EJB disponibili per la gestione [appName :, moduleName : RandomEjb, distinctName:] combinazione per il contesto di chiamata [email protected]
jboss.naming.client.ejb.context=true
impostato. Hai idea di cosa sto impostando errato in <jee:remote-slsb>
?
Questo è un miglioramento https://jira.primekey.se/browse/ECA-3607 – eluish192