-
1. Re: Problem in invoking a Remote EJB in JBoss.5.1.0 GA Server from my local desktop ejb in same jboss version
wdfink Nov 13, 2013 2:12 AM (in response to velraman)Hello Velmurugan,
welcome to the forums.
Do you say that both sides are JBoss5.1, right?
Why you add such libraries? As far as I see you use WildFly libraries which will definitive not work in that environment.
Drop all this additional libs and it should work.
-
2. Re: Problem in invoking a Remote EJB in JBoss.5.1.0 GA Server from my local desktop ejb in same jboss version
velraman Nov 13, 2013 2:58 AM (in response to wdfink)1 of 1 people found this helpfulHi Jboss expert Wolf-Dieter Fink,
1. Yes both sides are JBoss5.1
2. I added such libraries, because initially Jboss thrown ClassNotFoundException for org.jboss.naming.remote.client.InitialContextFactory class and org.xnio.Options class and other few classes, so I added the above jars, The jars I mentioned above are downloaded from grepcode and jboss sites. I dont see why such jars from WildFly libraries will affect this environement since doesn't show any conflicts so far.
3. I have all the required jars I believe, but the jboss-logging-3.1.0.CR2.jar which has class org.jboss.logging.Logger.tracef(Ljava/lang/String;Ljava/lang/Object;)V] method, this Logger class is not considered in jboss classpath, but instead the org.jboss.logging.Logger class is taken from jboss-logging-spi.jar. which doesnt have required method org.jboss.logging.Logger.tracef(Ljava/lang/String;Ljava/lang/Object;)V].
How to troubleshoot the issue like overriding the jboss default org.jboss.logging.Logger class in jboss-logging-spi.jar by the same class in jar jboss-logging-3.1.0.CR2.jar???
The right code I'm posting now to get the context.
Properties env = new Properties(); env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); env.put(Context.PROVIDER_URL, "jnp://10.86.24.7:1099"); InitialContext context = new InitialContext(env); System.out.println("context initialized successfully."); return context; Thanks
Velmurugan R
-
3. Re: Problem in invoking a Remote EJB in JBoss.5.1.0 GA Server from my local desktop ejb in same jboss version
wdfink Nov 13, 2013 10:59 AM (in response to velraman)Sorry,
I get confused also.
For JBoss5 you should use this properties:
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.NamingContextFactory"); env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces"); env.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099"); The CONTEXT_FACTORY you use it indeed of AS7, but there is no 'jnp' protocol and the connect is different.
-
4. Re: Problem in invoking a Remote EJB in JBoss.5.1.0 GA Server from my local desktop ejb in same jboss version
velraman Dec 11, 2013 3:50 AM (in response to wdfink)Hi Jboss expert Wolf-Dieter Fink,
It works fine as you suggested the above code, which I'm pasting here below once again.
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.NamingContextFactory");
env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
env.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
<note>It works good </note>
However I have a question, whats is the difference between these two below context factory
1. org.jboss.naming.NamingContextFactory
2. org.jboss.naming.remote.client.InitialContextFactory.
and both the context factory library present in both the jboss 5 version.