0
Hello,
I am developing a java project with jboss. I made the following code:
connectionFactoryLookupAddress = new String("jms/RemoteConnectionFactory");
destinationLookupAddress = new String("jms/topic/mC");
environment = new Properties();
environment.put(Context.SECURITY_PRINCIPAL, "isuser");
environment.put(Context.SECURITY_CREDENTIALS, "is"); environment.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.remote.client.InitialContextFactory");
environment.put(Context.PROVIDER_URL, "remote://localhost:4447");
InitialContext iCtx = new InitialContext(environment);
And I get the following exception
javax.naming.NoInitialContextException: Cannot instantiate class: org.jboss.naming.remote.client.InitialContextFactory [Root exception is java.lang.ClassNotFoundException: org.jboss.naming.remote.client.InitialContextFactory]
(...)
Caused by: java.lang.ClassNotFoundException: org.jboss.naming.remote.client.InitialContextFactory
(...)
I’ve already added jboss-client.jar, and nothing ... do I have to do some sort of configuration on the jboss server to accept this user? I’m using the eclipse. I read a few posts on this topic, but it’s not clear to me what settings Jboss needs to run this code. Some help?
Thank you for your attention
Why are you using org.jboss.naming.remote.client.Initialcontextfactory ? Use javax.naming.spi.Initialcontextfactory
– Josh
Either of the two options the result is the same: Cannot instantiate class: javax.naming.spi.Initialcontextfactory [Root Exception is java.lang.Instantiationexception: javax.naming.spi.Initialcontextfactory]
– user2989745