-
1. Re: Batch job is not finding EJB by JNDI name
jboss234 May 30, 2015 8:24 AM (in response to jboss234)any suggestions,
thanks
-
2. Re: Batch job is not finding EJB by JNDI name
wdfink May 30, 2015 1:56 PM (in response to jboss234)Not sure whats wrong, what you mean by batch, the JEE7 batching API? Or a simple standalone client as batch?
Could you elaborate on this?
-
3. Re: Batch job is not finding EJB by JNDI name
jboss234 May 30, 2015 9:48 PM (in response to wdfink)Simple standalone client as batch.
Standalone java program trying to invoke EJB, its throwing exception while JNDI lookup: Can not find EJB by JNDI name:
Same JNDI lookup works fine while accessing in Web application.
Thanks,
-
4. Re: Batch job is not finding EJB by JNDI name
wdfink May 31, 2015 4:58 AM (in response to jboss234)In the dass you should real the er documentation how to connect to the server. You Meer to usw a jboss-ejb-client.properties file.If you have questions onthat you should attach the Client code.
-
5. Re: Batch job is not finding EJB by JNDI name
jboss234 May 31, 2015 2:43 PM (in response to wdfink)Here is the code, its working fine when I call from struts action which is part of WAR file.
Application is deployed as EAR which has WAR and EJB Jar.
String homeInterfaceName = AppointmentProcessHome.class.getName(); Properties jndiProps = new Properties(); jndiProps.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.as.naming.InitialContextFactory"); jndiProps.setProperty(Context.PROVIDER_URL,"remote://localhost:4447"); Context context = new InitialContext(jndiProps); Object objref = context.lookup("ejb:PatientInfoEAR/PatientInfoEJB/AppointmentProcessEJB!"+homeInterfaceName); AppointmentProcessHome home = (AppointmentProcessHome)PortableRemoteObject.narrow(objref, AppointmentProcessHome.class); AppointmentProcess aptProcess = home.create();
when I use this code in standalone Java client (called inside main() method) it throws exception: Can not find EJB by JNDI name:
While calling from standalone java clinet, EAR is deployed on Wildfly server and its running.
I am trying to run standalone Java client from another command prompt.
Thanks
-
6. Re: Batch job is not finding EJB by JNDI name
jboss234 Jun 1, 2015 11:26 AM (in response to jboss234)Any suggestions?
Thanks,
-
7. Re: Batch job is not finding EJB by JNDI name
jboss234 Jun 2, 2015 2:22 PM (in response to jboss234)It worked after adding jboss-ejb-client.properties file in classpath.
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=localhost
remote.connection.default.port=8080
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
Thanks for help,