-
1. Re: Jboss 7 ejb remote client lookup
jaikiran Nov 28, 2012 1:23 AM (in response to ashvish)ashvish V wrote:
If I do the lookup with "ejb:example//CalculatorBean!com.avn.slsb.CalculatorRemote" I get the exception java.lang.IllegalStateException: No EJB receiver available for handling [appName:example,modulename:,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@1424bf0.
You have a typo there. It should be:
ejb:/example//CalculatorBean!com.avn.slsb.CalculatorRemote
-
2. Re: Jboss 7 ejb remote client lookup
ashvish Nov 28, 2012 5:53 AM (in response to jaikiran)I changed as you suggested and get the exception given below
javax.ejb.NoSuchEJBException: No such EJB[appname=,modulename=example,distinctname=,beanname=CalculatorBean,viewclassname=com.avn.slsb.CalculatorRemote]
at org.jboss.ejb.client.remoting.NoSuchEJBExceptionResponseHandler.processMessage(NoSuchEJBExceptionResponseHandler.java:64)
at org.jboss.ejb.client.remoting.ChannelAssociation$ResponseReceiver.handleMessage(ChannelAssociation.java:395)
at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:437)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
-
3. Re: Jboss 7 ejb remote client lookup
jaikiran Nov 28, 2012 6:03 AM (in response to ashvish)Is CalculatorRemote really a remote interface? What does the bean and the interface code look like, including the annotations?
-
4. Re: Jboss 7 ejb remote client lookup
ashvish Nov 28, 2012 6:10 AM (in response to jaikiran)@javax.ejb.Remote
public interface CalculatorRemote {
public float add(float x, float y);
public float subtract(float x, float y);
public float multiply(float x, float y);
public float division(float x, float y);
}
@Stateless(name="CalculatorBean")
@Remote(CalculatorRemote.class)
@RemoteBinding(jndiBinding="CalculatorBeanJNDI")
public class CalculatorBean implements CalculatorRemote{
public float add(float x, float y) {
return x + y;
}
public float subtract(float x, float y) {
return x - y;
}
public float multiply(float x, float y) {
return x * y;
}
public float division(float x, float y) {
return x / y;
}
}
-
5. Re: Jboss 7 ejb remote client lookup
nickarls Nov 28, 2012 6:20 AM (in response to ashvish)Do you really need that much annotations? Tried just a @Remote on the interface and then plain @Stateless on the Calculcator implements CalculatorRemote?
-
6. Re: Jboss 7 ejb remote client lookup
jaikiran Nov 28, 2012 6:22 AM (in response to ashvish)I don't see a reason why that would fail, unless ofcourse your client classpath is missing the jboss-ejb-client.properties.
By the way, @RemoteBinding which was a JBoss specific annotation is no longer supported in AS7.
-
7. Re: Jboss 7 ejb remote client lookup
ashvish Nov 28, 2012 6:26 AM (in response to jaikiran)I have added jboss-ejb-client.properties to the client classpath
endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=localhost
remote.connection.default.port = 4447
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.default.username=somename
remote.connection.default.password=somepassword
-
8. Re: Jboss 7 ejb remote client lookup
ashvish Nov 28, 2012 11:28 PM (in response to ashvish)Answers anyone?
-
9. Re: Jboss 7 ejb remote client lookup
jaikiran Nov 29, 2012 3:07 AM (in response to ashvish)Please enable TRACE level logs of org.jboss.ejb.client package on the client side and post/attach the output here.
-
10. Re: Jboss 7 ejb remote client lookup
cfillot Nov 29, 2012 12:07 PM (in response to ashvish)It looks strange that you don't have any mapping prefixed by "java:jboss/exported/" , if I'm correct, the remote lookup will only work for objects with this prefix.
-
11. Re: Jboss 7 ejb remote client lookup
ashvish Dec 6, 2012 2:06 AM (in response to cfillot)Hello,
I have deployed a sample application (downloaded from the net) and deployed as it is. This is what I see in the jboss console;
java:global/example/CalculatorBean!com.javajazzup.examples.ejb3.stateless.CalculatorRemote
java:app/example/CalculatorBean!com.javajazzup.examples.ejb3.stateless.CalculatorRemote
java:module/CalculatorBean!com.javajazzup.examples.ejb3.stateless.CalculatorRemote
java:jboss/exported/example/CalculatorBean!com.javajazzup.examples.ejb3.stateless.CalculatorRemote
java:global/example/CalculatorBean
java:app/example/CalculatorBean
java:module/CalculatorBean
As you said there is a mapping prefixed with "java:jboss/exported/". But I am still getting the remote client look up error. I cannot understand why the people at JBoss has made things a lot more complicated rather than simplifying it. I have am doing the look up as ejb:example//CalculatorBean!com.javajazzup.examples.ejb3.stateless.CalculatorRemote. The exception stack trace is
java.lang.IllegalStateException: No EJB receiver available for handling [appName:example,modulename:,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@b9e55c
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:584)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:119)
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
at $Proxy0.multiply(Unknown Source)
at com.avn.utils.EjbLookup.main(EjbLookup.java:26)
Could someone tell me what this is all about?
-
12. Re: Jboss 7 ejb remote client lookup
ashvish Dec 6, 2012 2:10 AM (in response to ashvish)Just giving example//CalculatorBean!com.javajazzup.examples.ejb3.stateless.CalculatorRemote withouth the prefix "ejb:" worked which is even more confusing.
-
13. Re: Jboss 7 ejb remote client lookup
jaikiran Dec 6, 2012 4:12 AM (in response to ashvish)Like I said earlier:
Please enable TRACE level logs of org.jboss.ejb.client package on the client side and post/attach the output here.
-
14. Re: Jboss 7 ejb remote client lookup
jaikiran Dec 6, 2012 4:13 AM (in response to ashvish)ashvish V wrote:
Just giving example//CalculatorBean!com.javajazzup.examples.ejb3.stateless.CalculatorRemote withouth the prefix "ejb:" worked which is even more confusing.