Search code examples
javainitial-contextopenjms

OpenJMS : impossible to set the INITIAL_CONTEXT_FACTORY


I wrote the below code to set my Context :

Properties properties = new Properties();
properties.put(Context.PROVIDER_URL, "tcp://localhost:3035");
properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.exolab.jms.jndi.InitialContextFactory");
Context context = new InitialContext(properties);

However, when I execute the jar, I get this exception (NB : not when I make the compilation + sorry I couldn't write it here) : http://pastebin.com/5i9SbvEh

I don't know why, since I actually have the jndi, jms and openjms jars (I did it with One-JAR).


Solution

  • I just forgot those dependecies... :

    openjms-common 0.7.7-beta-1 openjms-common-0.7.7-beta-1.jar openjms-net 0.7.7-beta-1 openjms-net-0.7.7-beta-1.jar commons-codec 1.3 commons-codec-1.3.jar commons-logging1.0.4 commons-logging-1.0.4.jar
    concurrent 1.3.4 concurrent-1.3.4.jar jms 1.1 jms-1.1.jar jndi 1.2.1 jndi-1.2.1.jar spice-jndikit 1.2 spice-jndikit-1.2.jar

    (http://openjms.sourceforge.net/usersguide/jars.html , PART "Runtime JARS")