Reg: OpenJMS with TOMCAT: Could not initialize class org.exolab.jms.jndi.rmi.RmiJndiInitialContextFactory

Sudharamya Kostu <sudharamya.kostu-/[email protected]> Tue, 8 Mar 2011 16:38:58 +0530
Newsgroups gmane.comp.java.openjms.user
Message-ID <OF065C23B9.94C29E01-ON6525784D.003D3F18-6525784D.003D3F23@tcs.com>
--===============7484809900226574395==
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="iso-8859-1"

<FONT face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=
=3D2><DIV>Dear tim,</DIV><DIV>&nbsp;</DIV><DIV>Am trying one simple example=
 in tomcat with OPENJMS.</DIV><DIV><B><FONT color=3D#7f0055 size=3D2><FONT =
color=3D#7f0055 size=3D2><P align=3Dleft>try</B></FONT></FONT><FONT size=3D=
2> {</P><P align=3Dleft>String factory_name =3D </FONT><FONT color=3D#2a00f=
f size=3D2><FONT color=3D#2a00ff size=3D2>"JmsTopicConnectionFactory"</FONT=
></FONT><FONT size=3D2>;</P><P align=3Dleft>Properties props =3D </FONT><B>=
<FONT color=3D#7f0055 size=3D2><FONT color=3D#7f0055 size=3D2>new</B></FONT=
></FONT><FONT size=3D2> Properties();</P></FONT><FONT size=3D2><P align=3Dl=
eft></FONT><B><FONT color=3D#7f0055 size=3D2><FONT color=3D#7f0055 size=3D2=
>if</B></FONT></FONT><FONT size=3D2> (url.startsWith(</FONT><FONT color=3D#=
2a00ff size=3D2><FONT color=3D#2a00ff size=3D2>"rmi"</FONT></FONT><FONT siz=
e=3D2>)) {</P><P align=3Dleft>props.put(Context.</FONT><I><FONT color=3D#00=
00c0 size=3D2><FONT color=3D#0000c0 size=3D2>INITIAL_CONTEXT_FACTORY</I></F=
ONT></FONT><FONT size=3D2>,</P><P align=3Dleft></FONT><FONT color=3D#2a00ff=
 size=3D2><FONT color=3D#2a00ff size=3D2>"org.exolab.jms.jndi.rmi.RmiJndiIn=
itialContextFactory"</FONT></FONT><FONT size=3D2>);</P><P align=3Dleft></P>=
<P align=3Dleft>} </FONT><B><FONT color=3D#7f0055 size=3D2><FONT color=3D#7=
f0055 size=3D2>else</B></FONT></FONT><FONT size=3D2> {</P><P align=3Dleft>p=
rops.put(Context.</FONT><I><FONT color=3D#0000c0 size=3D2><FONT color=3D#00=
00c0 size=3D2>INITIAL_CONTEXT_FACTORY</I></FONT></FONT><FONT size=3D2>,</P>=
<P align=3Dleft></FONT><FONT color=3D#2a00ff size=3D2><FONT color=3D#2a00ff=
 size=3D2>"org.exolab.jms.jndi.mipc.IpcJndiInitialContextFactory"</FONT></F=
ONT><FONT size=3D2>);</P><P align=3Dleft>}</P><P align=3Dleft>props.put(Con=
text.</FONT><I><FONT color=3D#0000c0 size=3D2><FONT color=3D#0000c0 size=3D=
2>PROVIDER_URL</I></FONT></FONT><FONT size=3D2>, url);</P></FONT><FONT size=
=3D2><P align=3Dleft></FONT><FONT color=3D#3f7f5f size=3D2><FONT color=3D#3=
f7f5f size=3D2>// lookup the connection factory from the context</P></FONT>=
</FONT><FONT size=3D2><P align=3Dleft>Context context =3D </FONT><B><FONT c=
olor=3D#7f0055 size=3D2><FONT color=3D#7f0055 size=3D2>new</B></FONT></FONT=
><FONT size=3D2> InitialContext(props);</P></FONT><FONT size=3D2><P align=
=3Dleft>TopicConnectionFactory factory =3D (TopicConnectionFactory)</P><P a=
lign=3Dleft>context.lookup(factory_name);</P></FONT><FONT size=3D2><P align=
=3Dleft></FONT><FONT color=3D#3f7f5f size=3D2><FONT color=3D#3f7f5f size=3D=
2>// if we can't find the factory then throw an exception</P></FONT></FONT>=
<FONT size=3D2><P align=3Dleft></FONT><B><FONT color=3D#7f0055 size=3D2><FO=
NT color=3D#7f0055 size=3D2>if</B></FONT></FONT><FONT size=3D2> (factory !=
=3D </FONT><B><FONT color=3D#7f0055 size=3D2><FONT color=3D#7f0055 size=3D2=
>null</B></FONT></FONT><FONT size=3D2>) {</P><P align=3Dleft>TopicConnectio=
n connection =3D factory.createTopicConnection();</P><P align=3Dleft>TopicS=
ession session =3D connection.createTopicSession(</P><P align=3Dleft></FONT=
><B><FONT color=3D#7f0055 size=3D2><FONT color=3D#7f0055 size=3D2>false</B>=
</FONT></FONT><FONT size=3D2>, Session.</FONT><I><FONT color=3D#0000c0 size=
=3D2><FONT color=3D#0000c0 size=3D2>AUTO_ACKNOWLEDGE</I></FONT></FONT><FONT=
 size=3D2>);</P><P align=3Dleft>Topic topic =3D session.createTopic(topic_n=
ame);</P><P align=3Dleft></P><P align=3Dleft></FONT><B><FONT color=3D#7f005=
5 size=3D2><FONT color=3D#7f0055 size=3D2>if</B></FONT></FONT><FONT size=3D=
2> (topic !=3D </FONT><B><FONT color=3D#7f0055 size=3D2><FONT color=3D#7f00=
55 size=3D2>null</B></FONT></FONT><FONT size=3D2>) {</P><P align=3Dleft>Top=
icPublisher publisher =3D session.createPublisher(topic);</P><P align=3Dlef=
t></FONT><B><FONT color=3D#7f0055 size=3D2><FONT color=3D#7f0055 size=3D2>i=
f</B></FONT></FONT><FONT size=3D2> (publisher !=3D </FONT><B><FONT color=3D=
#7f0055 size=3D2><FONT color=3D#7f0055 size=3D2>null</B></FONT></FONT><FONT=
 size=3D2>) {</P><P align=3Dleft></FONT><B><FONT color=3D#7f0055 size=3D2><=
FONT color=3D#7f0055 size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; for</B></FONT></FONT><FONT size=3D2> (</FONT><B><FONT color=3D#7f=
0055 size=3D2><FONT color=3D#7f0055 size=3D2>int</B></FONT></FONT><FONT siz=
e=3D2> index =3D 0; index &lt; count; index++) {</P><P align=3Dleft>&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp; publisher.publish(session.createTextMessage(</P>=
<P align=3Dleft></FONT><FONT color=3D#2a00ff size=3D2><FONT color=3D#2a00ff=
 size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "publish message "</FONT></FONT><FONT size=
=3D2> + count));</P><P align=3Dleft>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<=
/P><P align=3Dleft>}</P><P align=3Dleft>}</P><P align=3Dleft>}</P><P align=
=3Dleft></FONT>While running&nbsp;am getting the following error:</P></DIV>=
<DIV>java.lang.NoClassDefFoundError: Could not initialize class org.exolab.=
jms.jndi.rmi.RmiJndiInitialContextFactory</DIV><DIV>&nbsp;</DIV><DIV>jARS i=
NCLUDED ARE:</DIV><DIV>jms-1.1</DIV><DIV>jndi-1.2.1</DIV><DIV>openjms-clien=
t-0.7.6-rc1</DIV><DIV>openjms-0.7.7-beta-1</DIV><DIV>exolabcore-0.3.5</DIV>=
<DIV>openjms-0.7.4<BR></DIV><DIV>Though this class is available in jar, it =
is not recognizing properly.</DIV><DIV>&nbsp;</DIV><DIV>Please suggest me r=
equired JARS, in order to run this example in tomcat.<BR></DIV><DIV>Thanks =
in Advance,</DIV><DIV>&nbsp;</DIV><DIV>Regards,<BR>Sudha<BR>Tata Consultanc=
y Services<BR>Mailto: <A href=3D"mailto:sudharamya.kostu-/[email protected]" target=3D=
blank>sudharamya.kostu-/[email protected]</A><BR></DIV></FONT><pre style=3D"white-spac=
e:normal">=3D=3D=3D=3D=3D-----=3D=3D=3D=3D=3D-----=3D=3D=3D=3D=3D<br>Notice=
: The information contained in this e-mail<br>message and/or attachments to=
 it may contain <br>confidential or privileged information. If you are <br>=
not the intended recipient, any dissemination, use, <br>review, distributio=
n, printing or copying of the <br>information contained in this e-mail mess=
age <br>and/or attachments to it are strictly prohibited. If <br>you have r=
eceived this communication in error, <br>please notify us by reply e-mail o=
r telephone and <br>immediately and permanently delete the message <br>and =
any attachments. Thank you<br><br><br></pre>


--===============7484809900226574395==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
--===============7484809900226574395==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
openjms-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openjms-user

--===============7484809900226574395==--