-
1. Re: How to list all the EJB deployed in jboss server 7.1.1 and transaction manager through remote client jndi lookup ?
jaysensharma Nov 3, 2015 11:57 AM (in response to beingmansoor)Hello Mansoor,
Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
Although the reason for the above error is very differen However, Context.listBinding() or listing will not work in JBoss AS 7.1.1 due to : https://issues.jboss.org/browse/AS7-5492
Please try the later versions. May be JBoss EAP 6.1 and above.
Regards
Jay SenSharma
-
2. Re: How to list all the EJB deployed in jboss server 7.1.1 and transaction manager through remote client jndi lookup ?
jaysensharma Nov 3, 2015 12:17 PM (in response to beingmansoor)Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
Additionally.... in order to avoid the exception which you are getting as above you will need to make sure that you are creating the InitialContext as mentioned in the below link, And need to make sure that the JBOSS_HOME/bin/client/jboss-client-7.1.0.Final.jar jar is present in client classpath along with the jboss-ejb-client.properties file in the classpath of the client.
EJB invocations from a remote client using JNDI - JBoss AS 7.1 - Project Documentation Editor
-
3. Re: How to list all the EJB deployed in jboss server 7.1.1 and transaction manager through remote client jndi lookup ?
beingmansoor Nov 4, 2015 1:35 AM (in response to jaysensharma)Hi Jay,
I have jboss-client*.jar and jboss-ejb-client.properties file in my class path. I am able to invoke EJBs remotely, but unable to get user transaction through JNDI lookup. Its throwing above mentioned exception.
Any thoughts on this will be appreciated...
Regards,
Mansoor
-
4. Re: How to list all the EJB deployed in jboss server 7.1.1 and transaction manager through remote client jndi lookup ?
wdfink Nov 4, 2015 2:36 AM (in response to beingmansoor)To get a UserTransaction you need to use this
EJBClient.getUserTransaction(<nodeName>)
in JBossAS7, there is no other way. As you see you need to know at least one of the target node names.
WildFly is about to change that, but I'm not sure when that will happen.
-
5. Re: How to list all the EJB deployed in jboss server 7.1.1 and transaction manager through remote client jndi lookup ?
beingmansoor Nov 4, 2015 4:15 AM (in response to wdfink)Thank you Wolf-Dieter Fink.
Do you have any idea about how to get all the EJBs that are deployed in Jboss AS7?
In previous versions, context.list("") use to do the job.
Regards,
Mansoor
-
6. Re: How to list all the EJB deployed in jboss server 7.1.1 and transaction manager through remote client jndi lookup ?
jaysensharma Nov 4, 2015 5:18 AM (in response to beingmansoor)Hello Mansoor,
As mentioned earlier there were some issues reported: https://issues.jboss.org/browse/AS7-5492
That is fixed on JBoss EAP 6.1.0.Alpha (7.2.0.Final)
So first try the upgraded version of JBoss ^^
Once that is done then you will have to use the "remote-naming" approach here if you want to call the "context.listBindings()"
Example:
Properties<String, String> prop = new Properties<String, String>();
prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
prop.put(Context.PROVIDER_URL,"remote://localhost:4447");
prop.put(Context.SECURITY_PRINCIPAL, "admin");
prop.put(Context.SECURITY_CREDENTIALS, "admin@1");
new InitialContext(prop);
NOTE: If you will try with the "ejb-client-api" based approach to call "context.listBindings()" then it won't work as it is not supported by "ejb-client-api" approach