RE: Cannot connect to OpenJMS via webapp

<[email protected]> Thu, 13 Apr 2006 16:46:55 -0400
Newsgroups gmane.comp.java.openjms.user
Message-ID <D90FCECD38CF5947BA902B07DE3025C5018B2579@APATLITTMAIL05.ittl.gtri.org>
Your solution works!  Thanks!

Ms. Akilah (Like Akeelah and the Bee)

-----Original Message-----
From: openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Zarar Siddiqi
Sent: Wednesday, April 12, 2006 12:19 AM
To: [email protected]
Subject: Re: [openjms-user] Cannot connect to OpenJMS via webapp

My guess is this is because when running in NetBeans, the JNDI context
is off the app servers and not the JMS Servers.  It can't find
ConnectionFactory in the app server's JNDI context hence the
NameNotFoundException.

Perhaps you should try the following:

        Properties props = new Properties();
        props.load(getClass().getClassLoader().
                getResourceAsStream("jndi.properties"));
        Context context = new InitialContext(props);

where jdni.properties is at the root of your classpath and contains:

java.naming.factory.initial=org.exolab.jms.jndi.InitialContextFactory
java.naming.provider.url=tcp://YourIPAddressOrHostName:3035/

You could alternately hardcode the properties as shown here:

http://openjms.sourceforge.net/usersguide/using.html

Either one should work.

Zarar



On 4/11/06, [email protected]
<[email protected]> wrote:
>
>
>
> Hello!
>
>
>
> I created a web app version of the example application Browser.java,
> http://openjms.sourceforge.net/usersguide/examples.html, in
> which I changed Browser from a application to a servlet.
>
>
>
> In this web app version, via a simple form, I passed the queue name to the
> Browser servlet.
>
>
>
> The application version of Browser runs fine in the command window, but as a
> servlet, Browser fails.
>
>
>
> I keep coming across this error:
>
>
>
> javax.naming.NameNotFoundException: Name ConnectionFactory
> is not bound in this Context
>
>
>
> I am running this web app inside Netbeans, and in Netbean, I referenced all
> the jar files in C:\openjms\lib.
>
>
>
> I do have the server running outside of netbeans and I deployed openjms
> tunnel web app in Tomcat.
>
>
>
> In addition, in included my opnejms.xml code below.
>
>
>
> Why the Browser servlet is is unable to connect to the OpenJMS server?
>
>
>
>
>
> < -------- openjms.xml -----à
>
> <?xml version="1.0"?>
>
>
>
> <Configuration>
>
>
>
>   <!-- Optional. This represents the default configuration  -->
>
>   <ServerConfiguration host="localhost" embeddedJNDI="true">
>
>
>
>   <Connectors>
>
>     <Connector scheme="tcp">
>
>       <ConnectionFactories>
>
>         <ConnectionFactory name="ConnectionFactory" />
>
>       </ConnectionFactories>
>
>     </Connector>
>
>     <Connector scheme="rmi">
>
>       <ConnectionFactories>
>
>         <QueueConnectionFactory
> name="JmsQueueConnectionFactory" />
>
>         <TopicConnectionFactory
> name="JmsTopicConnectionFactory" />
>
>       </ConnectionFactories>
>
>     </Connector>
>
>   </Connectors>
>
>
>
>   <!-- Required  -->
>
>   <DatabaseConfiguration>
>
>     <RdbmsDatabaseConfiguration
>
>       driver="org.apache.derby.jdbc.EmbeddedDriver"
>
>       url="jdbc:derby:openjmsdb;create=true"
>
>       user="openjms"
>
>       password="openjms"/>
>
>   </DatabaseConfiguration>
>
>
>
>  <HttpConfiguration port="3030" jndiPort="3035" adminPort="9090"
> bindAll="true"
>
>                      webServerHost="localhost" webServerPort="80"
>
>                      servlet="/openjms-tunnel/tunnel"/>
>
>
>
>  <TcpConfiguration port="3035" jndiPort="3035" adminPort="9090"
> bindAll="true" />
>
>
>
>   <!-- Required -->
>
>   <AdminConfiguration script="${openjms.home}\bin\startup.bat" />
>
>
>
>   <!-- Optional. If not specified, no destinations will be created -->
>
>   <AdministeredDestinations>
>
>     <AdministeredTopic name="topic1">
>
>       <Subscriber name="sub1" />
>
>       <Subscriber name="sub2" />
>
>     </AdministeredTopic>
>
>
>
>     <AdministeredQueue name="queue1" />
>
>     <AdministeredQueue name="queue2" />
>
>     <AdministeredQueue name="queue3" />
>
>   </AdministeredDestinations>
>
>
>
>   <!-- Optional. If not specified, no users will be created -->
>
>   <Users>
>
>     <User name="admin" password="openjms" />
>
>   </Users>
>
>
>
> </Configuration>
>
>
>
> -- Akilah


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
_______________________________________________
openjms-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openjms-user


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642