java - Wildfly Remote EJB Invocation -
i trying invoke stateless ejb, deployed on remote server. can invoke bean local jboss environment when change remote.connection.default.host
remote machine's host, client code not work.
this jboss-ejb-client.properties
:
endpoint.name=client-endpoint remote.connectionprovider.create.options.org.xnio.options.ssl_enabled=false remote.connections=default remote.connection.default.host=serverip/hostname remote.connection.default.port=8080 remote.connection.default.connect.options.org.xnio.options.sasl_policy_noanonymous=false remote.connection.default.username=username remote.connection.default.password=password
and client code looks this:
properties properties = new properties(); properties.put(context.url_pkg_prefixes, "org.jboss.ejb.client.naming"); string jndi = "jndi_name"; context context = new initialcontext(properties); obj = context.lookup(jndi);
please help.
thanks all. jack.
this answer may late faced same problem, none of above answers helped me, solve problem, refer following : http://blog.jonasbandi.net/2013/08/jboss-remote-ejb-invocation-unexpected.html
the code works me below:
properties jndiproperties=new properties(); jndiproperties.put(context.initial_context_factory, "org.jboss.naming.remote.client.initialcontextfactory"); jndiproperties.put(context.url_pkg_prefixes, "org.jboss.ejb.client.naming"); jndiproperties.put(context.provider_url, "http-remoting://127.0.0.1:8080/"); //this property important remote resolving jndiproperties.put("jboss.naming.client.ejb.context", true); //this propert not important remote resolving jndiproperties.put("org.jboss.ejb.client.scoped.context", "true"); context context=new initialcontext(jndiproperties); /* java:global/jeetest_project/ejbtest_project/genericstateless!test.stateless.genericstateless java:app/ejbtest_project/genericstateless!test.stateless.genericstateless java:module/genericstateless!test.stateless.genericstateless java:jboss/exported/jeetest_project/ejbtest_project/genericstateless!test.stateless.genericstateless java:global/jeetest_project/ejbtest_project/genericstateless java:app/ejbtest_project/genericstateless java:module/genericstateless */ //none of above names work remote ejb resolution works - //"/jeetest_project/ejbtest_project/genericstateless!test.stateless.genericstateless" genericstateless bean=(genericstateless)context.lookup("/jeetest_project/ejbtest_project/genericstateless!test.stateless.genericstateless"); //genericstateless bean=(genericstateless)c.lookup("genericstateless!test.stateless.genericstateless"); system.out.println(bean.getint());
Comments
Post a Comment