By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,771 Members | 1,709 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,771 IT Pros & Developers. It's quick & easy.

javax.naming.NoInitialContextException:

oll3i
100+
P: 679
it worked but suddenly when i run it and click a button it throws exception ?

D:\SR>java Producent queue1 queue2 queue3 queue4
queue1,queue2,queue3,queue4
javax.naming.NoInitialContextException: Cannot instantiate class: org.exolab.jms
.jndi.InitialContextFactory [Root exception is java.lang.ClassNotFoundException:
org.exolab.jms.jndi.InitialContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(N amingManager.java:6
57)
at javax.naming.InitialContext.getDefaultInitCtx(Init ialContext.java:288
)
at javax.naming.InitialContext.init(InitialContext.ja va:223)
at javax.naming.InitialContext.<init>(InitialContext. java:175)
at Producent$4.actionPerformed(producent.java:480)
at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:19
95)
at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.jav
a:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel
.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:242
)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonL
istener.java:236)
at java.awt.Component.processMouseEvent(Component.jav a:6038)
at javax.swing.JComponent.processMouseEvent(JComponen t.java:3260)
at java.awt.Component.processEvent(Component.java:580 3)
at java.awt.Container.processEvent(Container.java:205 8)
at java.awt.Component.dispatchEventImpl(Component.jav a:4410)
at java.awt.Container.dispatchEventImpl(Container.jav a:2116)
at java.awt.Component.dispatchEvent(Component.java:42 40)
at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4322
)
at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:3986)

at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:3916)
at java.awt.Container.dispatchEventImpl(Container.jav a:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429 )
at java.awt.Component.dispatchEvent(Component.java:42 40)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 599)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThre
ad.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.
java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThre
ad.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:168)

at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:160)

at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:121)
Caused by: java.lang.ClassNotFoundException: org.exolab.jms.jndi.InitialContextF
actory
at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.sun.naming.internal.VersionHelper12.loadClass( VersionHelper12.jav
a:46)
at javax.naming.spi.NamingManager.getInitialContext(N amingManager.java:6
54)
... 29 more
javax.naming.NoInitialContextException: Cannot instantiate class: org.exolab.jms
.jndi.InitialContextFactory [Root exception is java.lang.ClassNotFoundException:
org.exolab.jms.jndi.InitialContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(N amingManager.java:6
57)
at javax.naming.InitialContext.getDefaultInitCtx(Init ialContext.java:288
)
at javax.naming.InitialContext.init(InitialContext.ja va:223)
at javax.naming.InitialContext.<init>(InitialContext. java:175)
at Producent$2.actionPerformed(producent.java:297)
at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:19
95)
at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.jav
a:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel
.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:242
)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonL
istener.java:236)
at java.awt.Component.processMouseEvent(Component.jav a:6038)
at javax.swing.JComponent.processMouseEvent(JComponen t.java:3260)
at java.awt.Component.processEvent(Component.java:580 3)
at java.awt.Container.processEvent(Container.java:205 8)
at java.awt.Component.dispatchEventImpl(Component.jav a:4410)
at java.awt.Container.dispatchEventImpl(Container.jav a:2116)
at java.awt.Component.dispatchEvent(Component.java:42 40)
at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4322
)
at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:3986)

at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:3916)
at java.awt.Container.dispatchEventImpl(Container.jav a:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429 )
at java.awt.Component.dispatchEvent(Component.java:42 40)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 599)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThre
ad.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.
java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThre
ad.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:168)

at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:160)

at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:121)
Caused by: java.lang.ClassNotFoundException: org.exolab.jms.jndi.InitialContextF
actory
at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.sun.naming.internal.VersionHelper12.loadClass( VersionHelper12.jav
a:46)
at javax.naming.spi.NamingManager.getInitialContext(N amingManager.java:6
54)
... 29 more
javax.naming.NoInitialContextException: Cannot instantiate class: org.exolab.jms
.jndi.InitialContextFactory [Root exception is java.lang.ClassNotFoundException:
org.exolab.jms.jndi.InitialContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(N amingManager.java:6
57)
at javax.naming.InitialContext.getDefaultInitCtx(Init ialContext.java:288
)
at javax.naming.InitialContext.init(InitialContext.ja va:223)
at javax.naming.InitialContext.<init>(InitialContext. java:175)
at Producent$2.actionPerformed(producent.java:297)
at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:19
95)
at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.jav
a:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel
.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:242
)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonL
istener.java:236)
at java.awt.Component.processMouseEvent(Component.jav a:6038)
at javax.swing.JComponent.processMouseEvent(JComponen t.java:3260)
at java.awt.Component.processEvent(Component.java:580 3)
at java.awt.Container.processEvent(Container.java:205 8)
at java.awt.Component.dispatchEventImpl(Component.jav a:4410)
at java.awt.Container.dispatchEventImpl(Container.jav a:2116)
at java.awt.Component.dispatchEvent(Component.java:42 40)
at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4322
)
at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:3986)

at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:3916)
at java.awt.Container.dispatchEventImpl(Container.jav a:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429 )
at java.awt.Component.dispatchEvent(Component.java:42 40)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 599)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThre
ad.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.
java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThre
ad.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:168)

at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:160)

at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:121)
Caused by: java.lang.ClassNotFoundException: org.exolab.jms.jndi.InitialContextF
actory
at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.sun.naming.internal.VersionHelper12.loadClass( VersionHelper12.jav
a:46)
at javax.naming.spi.NamingManager.getInitialContext(N amingManager.java:6
54)
... 29 more

D:\SR>javac producent.java

D:\SR>java Producent queue1 queue2 queue3 queue4
queue1,queue2,queue3,queue4
javax.naming.NoInitialContextException: Cannot instantiate class: org.exolab.jms
.jndi.InitialContextFactory [Root exception is java.lang.ClassNotFoundException:
org.exolab.jms.jndi.InitialContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(N amingManager.java:6
57)
at javax.naming.InitialContext.getDefaultInitCtx(Init ialContext.java:288
)
at javax.naming.InitialContext.init(InitialContext.ja va:223)
at javax.naming.InitialContext.<init>(InitialContext. java:175)
at Producent$2.actionPerformed(producent.java:297)
at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:19
95)
at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.jav
a:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel
.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:242
)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonL
istener.java:236)
at java.awt.Component.processMouseEvent(Component.jav a:6038)
at javax.swing.JComponent.processMouseEvent(JComponen t.java:3260)
at java.awt.Component.processEvent(Component.java:580 3)
at java.awt.Container.processEvent(Container.java:205 8)
at java.awt.Component.dispatchEventImpl(Component.jav a:4410)
at java.awt.Container.dispatchEventImpl(Container.jav a:2116)
at java.awt.Component.dispatchEvent(Component.java:42 40)
at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4322
)
at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:3986)

at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:3916)
at java.awt.Container.dispatchEventImpl(Container.jav a:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429 )
at java.awt.Component.dispatchEvent(Component.java:42 40)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 599)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThre
ad.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.
java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThre
ad.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:168)

at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:160)

at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:121)
Caused by: java.lang.ClassNotFoundException: org.exolab.jms.jndi.InitialContextF
actory
at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.sun.naming.internal.VersionHelper12.loadClass( VersionHelper12.jav
a:46)
at javax.naming.spi.NamingManager.getInitialContext(N amingManager.java:6
54)
... 29 more

D:\SR>
Jun 17 '07 #1
Share this Question
Share on Google+
8 Replies


Expert 10K+
P: 11,448
it worked but suddenly when i run it and click a button it throws exception ?

D:\SR>java Producent queue1 queue2 queue3 queue4
queue1,queue2,queue3,queue4
javax.naming.NoInitialContextException: Cannot instantiate class: org.exolab.jms
.jndi.InitialContextFactory [Root exception is java.lang.ClassNotFoundException:
org.exolab.jms.jndi.InitialContextFactory]
at javax.naming.spi.NamingManager.getInitialContext
According to the exception that was thrown and the fact that you claim that
everything ran fine before you must have changed your classpath list, i.e. it
can't find that org.exolab.jms.jndi.InitialContextFactory anymore.

kind regards,

Jos

ps. those exception stack traces tell you everything; it's luxury.
Jun 17 '07 #2

oll3i
100+
P: 679
i have jndi.properties and i didnt change it

java.naming.provider.url=tcp://localhost:3035
java.naming.factory.initial=org.exolab.jms.jndi.In itialContextFactory
java.naming.security.principal=admin
java.naming.security.credentials=openjms

i am writing 3 applications communicating with each other
and when i run Client from bat i dont get that exception and i use there jms too
i still cannt run the producer from bat with 4 parameters
even if i type in command line
run Producer queue1 queue2 queue3 queue4
it dsplays usage <destination> <destination> <destination> <destination>
but i pass 4 paramaters
i think i have to run it from bat then i wouldnt get that exception like i run client form bat and dont get that exception

i also have run.bat file
@setlocal
@set OJMS_HOME=C:\openjms\openjms
@java -cp D:\sr\lib\db4o-6.1-java5.jar;D:\sr\lib\db4o-6.1-java1.2.jar;D:\sr\lib\db4o-6.1-java1.1.jar;%OJMS_HOME%\lib\openjms-0.7.7-beta-1.jar;.; %1 %2 %3 %4

the lecturer didnt explain (also) what %1 %2 %3 %4 is for ? could you explain that to me?

thank YOU
Jun 17 '07 #3

oll3i
100+
P: 679
it was running fine when i had only 2 parameters but when i changed it to 4 for 4 queues it doesnt work
cos producer must communicate with client and supplier
client sends messages to queue1
producer sends confirmations to queue2
producer sends orders to supplier to queue3
supplier sends confimations to queue4
Jun 17 '07 #4

oll3i
100+
P: 679
when i run it like that
java Producer queue1 queue2 queue3 queue4
the app opens but when i click the button to get orders it throws the exception javax.naming.NoInitialContextException:
Jun 17 '07 #5

oll3i
100+
P: 679
when i paste to command line
java -cp D:\sr\lib\db4o-6.1-java5.jar;%OJMS_HOME%\lib\openjms-0.7.7-beta-1.jar;.; %1 %2 %3 %4 Producent queue1 queue2 queue3 queue4

it truncates queue4 to qu
Jun 17 '07 #6

oll3i
100+
P: 679
the command line takes only 2 parameters thats why i got the
usage: <destination> <destination> <destination> <destination>
i changed the buffer size but still it doesnt help :(
Jun 17 '07 #7

oll3i
100+
P: 679
why java -cp D:\sr\lib\db4o-6.1-java5.jar;D:\sr\lib\openjms-0.7.7-beta-1.jar;.; %1 %2 %3 %4 Producent queue1 queue2 queue3 queue4
doesnt run it ?
Jun 17 '07 #8

oll3i
100+
P: 679
my command line accepts only 126 characters?
Jun 17 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.