This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

WildFly: IllegalStateException When Calling Remote EJB Method

 
Saloon Keeper
Posts: 2650
333
Android Eclipse IDE Angular Framework TypeScript MySQL Database Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a simple application which attempts to remotely invoke an EJB hosted on Wildfly. Connection to WildFly is successful, name look-up is okay, and a proxy is created, but when I try to call a method on the EJB, an IllegalStateException exception is thrown. Any suggestions on where I should look?

INFO: XNIO version 3.2.2.Final
Jul 03, 2014 11:09:15 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.2.2.Final
Jul 03, 2014 11:09:15 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version (unknown)
Jul 03, 2014 11:09:15 AM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 2.0.1.Final
Exception in thread "main" java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:InventoryManagement, moduleName:InventoryManager, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@cf834c8
    at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:749)
    at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)
    at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
    at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253)
    at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198)
    at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
    at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
    at com.sun.proxy.$Proxy0.getEquipmentBundles(Unknown Source)
    at net.starsolutions.test.Main.<init>(Main.java:33)
    at net.starsolutions.test.Main.main(Main.java:15)






 
Ron McLeod
Saloon Keeper
Posts: 2650
333
Android Eclipse IDE Angular Framework TypeScript MySQL Database Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Configured an application user on Wildfly, and added the following property file to the client application:

jboss-ejb-client.properties
endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.username=my-username-here
remote.connection.default.password=my-password-here
remote.connection.default.host=localhost
remote.connection.default.port=8080
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false


Using tcpdump, I do not see the client attempt to connect the server. I have also tried running the client on a different platform (with a different OS) - same results.

I am using the jboss-client.jar file which in included in wildfly-8.1.0.Final.
 
Ron McLeod
Saloon Keeper
Posts: 2650
333
Android Eclipse IDE Angular Framework TypeScript MySQL Database Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It turns-out that the EJB client properties were the key. It didn't initially resolve the problem because I didn't have the properties file in the class path (d'oh!). Here some reference output for anyone else who may have issues with this.

Console
Jul 04, 2014 6:14:53 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.2.2.Final

Jul 04, 2014 6:14:54 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.2.2.Final

Jul 04, 2014 6:14:54 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version (unknown)

Jul 04, 2014 6:14:54 PM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 2.0.1.Final

Jul 04, 2014 6:14:54 PM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: EJBCLIENT000017: Received server version 2 and marshalling strategies [river]

Jul 04, 2014 6:14:54 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@202de670, receiver=Remoting connection EJB receiver [connection=org.jboss.ejb.client.remoting.ConnectionPool$PooledConnection@2573d391,channel=jboss.ejb,nodename=ifonestar]} on channel Channel ID b18aa95d (outbound) of Remoting connection 12baa77e to localhost/127.0.0.1:8080

Network Trace
GET / HTTP/1.1
Sec-JbossRemoting-Key: sbLPhGbxcJ4OxH6F8wZDAw==
Upgrade: jboss-remoting
Host: localhost:8080
Connection: upgrade

HTTP/1.1 101 Switching Protocols
Connection: Upgrade
Upgrade: jboss-remoting
Content-Length: 0



 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!