-
1. Re: How to invoke Stateful SessionBean from remote Standalone Client
wdfink Jan 27, 2014 10:24 AM (in response to trvajjala)You give a bit less information, please provide how you set the invocation context and how the error look like.
Also the used server version will be helpful.
-
2. Re: How to invoke Stateful SessionBean from remote Standalone Client
trvajjala Jan 27, 2014 9:43 PM (in response to wdfink)Jboss Server version 6.10 EAP.
initial context is created as shown below
final Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jboss.naming.remote.client.InitialContextFactory");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
env.put(Context.PROVIDER_URL, "remote://localhost:4447");
Context context = new InitialContext(env);
context.lookup("ejb:" + SERVICE_NAME + "/"
+ serviceMapper.get(serviceBean) + "//" + serviceBean + "!"
+ service.getName());
with this i can able lookup stateless session beans but the issue with stateful session which is giving
Caused by: java.lang.IllegalStateException: JBAS014366: Session id hasn't been set for stateful component:
i have suffixed with?stateful
context.lookup("ejb:" + SERVICE_NAME + "/"
+ serviceMapper.get(serviceBean) + "//" + serviceBean + "!"
+ service.getName()+"?stateful"); but there is no luck.
i used jboss-client.jar from JBoss\bin\client folder. is there any other jar files required.
-
3. Re: How to invoke Stateful SessionBean from remote Standalone Client
wdfink Jan 28, 2014 7:57 AM (in response to trvajjala)You are mixing the ejb-client and remote-naming approach.
If you use URL=remote:// you use remote naming and in this case you need to drop the ejb: prefix from your lookup string.
That should work.