EJB3.1 remote look up using jboss 7.1.1
alif Feb 16, 2014 7:08 AMHi I have deployed ejbs remote session beans in jboss 7.1.1 .It looks as follows
java:global/TCPro/Domain/EnterpriseServiceSessionBean!com.ingenix.transact.domain.enterprise.interfaces.EnterpriseManager
java:app/Domain/EnterpriseServiceSessionBean!com.ingenix.transact.domain.enterprise.interfaces.EnterpriseManager
java:module/EnterpriseServiceSessionBean!com.ingenix.transact.domain.enterprise.interfaces.EnterpriseManager
java:jboss/exported/TCPro/Domain/EnterpriseServiceSessionBean!com.ingenix.transact.domain.enterprise.interfaces.EnterpriseManager
java:global/TCPro/Domain/EnterpriseServiceSessionBean
java:app/Domain/EnterpriseServiceSessionBean
java:module/EnterpriseServiceSessionBean
I have written EJB client project to lookup remote ejbs.
Properties jndiProperties = new Properties();
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
jndiProperties.put(Context.PROVIDER_URL, "remote://localhost:4447");
jndiProperties.put("jboss.naming.client.ejb.context", true);
jndiProperties.put(Context.SECURITY_PRINCIPAL, "root123");
jndiProperties.put(Context.SECURITY_CREDENTIALS, "password123");
InitialContext ctx = new InitialContext(jndiProperties);
Object mObject= ctx.lookup("ejb:TCPro/Domain//EnterpriseServiceSessionBean!com.ingenix.transact.domain.enterprise.interfaces.EnterpriseManager");
EnterpriseManager enterpriseManager=(EnterpriseManager)mObject;
Upto here look up is success full. But if I acees any Ejb methods for example enterpriseManager.save(EnterPriseDTO) it is giving following exception.
ERROR [org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver] (Remoting "lh7u0cnu3379btz" task-4) Exception on channel Channel ID 288519a1 (inbound) of Remoting connection 50dc73bd to /127.0.0.1:50090 from message org.jboss.remoting3.remote.InboundMessage$3@36b355be: java.io.EOFException: Read past end of file
at org.jboss.marshalling.SimpleDataInput.eofOnRead(SimpleDataInput.java:126) [jboss-marshalling-1.3.11.GA.jar:1.3.11.GA]
at org.jboss.marshalling.SimpleDataInput.readUnsignedByteDirect(SimpleDataInput.java:263) [jboss-marshalling-1.3.11.GA.jar:1.3.11.GA]
at org.jboss.marshalling.SimpleDataInput.readUnsignedByte(SimpleDataInput.java:224) [jboss-marshalling-1.3.11.GA.jar:1.3.11.GA]
at org.jboss.marshalling.river.RiverUnmarshaller.start(RiverUnmarshaller.java:1186)
at org.jboss.as.ejb3.remote.protocol.versionone.AbstractMessageHandler.prepareForUnMarshalling(AbstractMessageHandler.java:240)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.processMessage(MethodInvocationMessageHandler.java:104)
at org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver.handleMessage(VersionOneProtocolChannelReceiver.java:170)
at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:437) [jboss-remoting-3.2.3.GA.jar:3.2.3.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
Not that I have put Jboss7.1.1home/bin /client/jboss-client jar in my client project.
I also tried putting below jars..but still getting the same exception
\jboss-as-7.1.1.Final\modules\org\jboss\ejb-client\main\jboss-ejb-client-1.0.5.Final.jar
..\jboss-as-7.1.1.Final\modules\org\jboss\ejb3\main\jboss-ejb3-ext-api-2.0.0.jar
..\jboss-as-7.1.1.Final\modules\org\jboss\logging\main\jboss-logging-3.1.0.GA.jar
..\jboss-as-7.1.1.Final\modules\org\jboss\xnio\main\xnio-api-3.0.3.GA.jar
..\jboss-as-7.1.1.Final\modules\org\jboss\sasl\main\jboss-sasl-1.0.0.Final.jar
..\jboss-as-7.1.1.Final\modules\org\jboss\marshalling\river\main\jboss-marshalling-river-1.3.11.GA.jar
..\jboss-as-7.1.1.Final\modules\org\jboss\marshalling\main\jboss-marshalling-1.3.11.GA.jar
..\jboss-as-7.1.1.Final\modules\javax\ejb\api\main\jboss-ejb-api_3.1_spec-1.0.1.Final.jar
..\jboss-as-7.1.1.Final\modules\org\jboss\remoting3\main\jboss-remoting-3.2.3.GA.jar
..\jboss-as-7.1.1.Final\modules\org\jboss\xnio\nio\main\xnio-nio-3.0.3.GA.jar
..\jboss-as-7.1.1.Final\modules\javax\transaction\api\main\jboss-transaction-api_1.1_spec-1.0.0.Final.jar
Please help .
Thanks in advance,
Fakaruddin