Okay, I am sure this question gets asked a million times. And I bet the reason is because there is so many documents created with so many variations which for some crazy reason never seemed to work in my case. Its too bad how to do this couldnt be standardized and then remove all the wrong ways which are suggested out there. The implementation I am about to present came from a post who said they finally got it to work and this is how they did it. Except it didnt work for me.
First my environment:
Windows 7
Eclipse
IDE Luna
Wildfly AS 8.1 using Standalone only no EAP
Have created a manager user which is the user I am using.
Database I am using as a datasource is DB2 9.7
EJB:
SampleBean is Webservice and Local which extends EJBInterface
EJBInterface:
SampleBeanInterface is Remote
Swing app has jboss-client.jar in build path as well as the EJB
ClientUtility:
Table Model Lookup function:
Error:
Jul 10, 2014 8:24:04 AM org.xnio.Xnio <clinit>
INFO: XNIO version 3.2.2.Final
Jul 10, 2014 8:24:05 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.2.2.Final
Jul 10, 2014 8:24:05 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version (unknown)
Jul 10, 2014 8:24:05 AM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 2.0.1.Final
Jul 10, 2014 8:24:07 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: EJBCLIENT000017: Received server version 2 and marshalling strategies [river]
Jul 10, 2014 8:24:07 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@554850, receiver=Remoting connection EJB receiver [connection=org.jboss.ejb.client.remoting.ConnectionPool$PooledConnection@c2c34a,channel=jboss.ejb,nodename=s160]} on channel Channel ID a8700422 (outbound) of Remoting connection 00aaeda6 to s160/10.143.74.86:8080
javax.naming.CommunicationException: Failed to connect to any server. Servers tried: [http:remoting://s160:8080 (No connection provider for URI scheme "http" is installed)]
at org.jboss.naming.remote.client.HaRemoteNamingStore.failOverSequence(HaRemoteNamingStore.java:244)
at org.jboss.naming.remote.client.HaRemoteNamingStore.namingStore(HaRemoteNamingStore.java:149)
at org.jboss.naming.remote.client.HaRemoteNamingStore.namingOperation(HaRemoteNamingStore.java:130)
at org.jboss.naming.remote.client.HaRemoteNamingStore.lookup(HaRemoteNamingStore.java:272)
at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:87)
at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:129)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.cs.db2Sample.swing.PlacesModel.lookup(PlacesModel.java:140)
at com.cs.db2Sample.swing.PlacesModel.<init>(PlacesModel.java:23)
at com.cs.db2Sample.swing.PeopleTable.<init>(PeopleTable.java:23)
at com.cs.db2Sample.swing.PeopleTable.createAndShowGUI(PeopleTable.java:57)
at com.cs.db2Sample.swing.PeopleTable.access$0(PeopleTable.java:47)
at com.cs.db2Sample.swing.PeopleTable$2.run(PeopleTable.java:74)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception in
thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.cs.db2Sample.swing.PlacesModel.getAllPlaces(PlacesModel.java:113)
at com.cs.db2Sample.swing.PlacesModel.<init>(PlacesModel.java:24)
at com.cs.db2Sample.swing.PeopleTable.<init>(PeopleTable.java:23)
at com.cs.db2Sample.swing.PeopleTable.createAndShowGUI(PeopleTable.java:57)
at com.cs.db2Sample.swing.PeopleTable.access$0(PeopleTable.java:47)
at com.cs.db2Sample.swing.PeopleTable$2.run(PeopleTable.java:74)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
So, what am I doing wrong?