Title: RE: Orion and JMS: javax.naming.NameNotFoundException]

If you want to get any resource in your Servlet/jsp you got define resource-ref in your web.xml. 
One basic information as long as you are in the same container you don't need any parameters to JDNI context. 
You need jndi.properties only when you try to access from outside the container.  Your servlets/jsp/ejb/applicationclient

are in the same orion container so in all these components you can directly get JNDI context by
Context ctx = new InitialContext();
As long as you are in the same container there is no need for jndi.properties.

Regarding the JMS you got define resource-ref in your web.xml.  Any container resource of ejb resource you want to use in web tier i.e in servlets/jsp you have to define resource-ref and ejb-ref correspondingly. For JMS which is a resource so you have to declare resource-ref in your web.xml like the following.

        <resource-ref>
                <res-ref-name>jms/theQueueConnectionFactory</res-ref-name>
                <res-type>javax.jms.QueueConnectionFactory</res-type>
                <res-auth>Container</res-auth>
        </resource-ref>
        <resource-ref>
                <res-ref-name>jms/myQueue</res-ref-name>
                <res-type>javax.jms.Queue</res-type>
                <res-auth>Container</res-auth>
        </resource-ref>

Inside your servlet/jsp for connection factory lookup for jms/theQueueConnectionFactory and for queue lookup for jms/myQueue.



> ----- Original Message -----
> From: "Daniel Lopez" <[EMAIL PROTECTED]>
> To: "Orion-Interest" <[EMAIL PROTECTED]>
> Sent: Wednesday, August 22, 2001 8:48 AM
> Subject: [Fwd: Re: Orion and JMS: javax.naming.NameNotFoundException]
>
>
> > Hi (third try to the list, first ones didn't make it),
> >
> > I haven't got a single answer, so I'm wondering if nobody
> is using Orion
> >
> > JMS or this mailing list is playing funny with me. Has anybody
> > configured and used Orion JMS? Could somebody please
> elaborate on the
> > steps necessary to get this thing working?
> > Thanks in advance,
> > D.
> >
> > Daniel López wrote:
> > >
> > > Hi,
> > >
> > > I know this topic has been discussed a lot in here, but I
> haven't been
> >
> > > able to find the answer in the archive or in the
> documentation. The
> > > problem is: I decided to have a go with JMS but I can't
> even start to
> > > play with it, as all I get is
> "javax.naming.NameNotFoundException".
> > > These are the steps I have followed:
> > > .- Configure server.xml with the following line:
> > >         ...
> > >         <jms-config path="./jms.xml" />
> > >         ...
> > > .- Configure jms.xml with this content:
> > >         <jms-server port="9127" host="localhost">
> > >                 <queue-connection-factory
> > >                         location="jms/QueueConnectionFactory"/>
> > >                 <queue name="Demo Queue" location="jms/demoQueue">
> > >                         <description>A dummy queue</description>
> > >                 </queue>
> > >                 <log>
> > >                         <file path="../logs/jms.log" />
> > >                 </log>
> > >         </jms-server>
> > > .- Add jndi.properties to my application's
> classes(WEB-INF/classes),
> > > with the following content:
> > >
> > >
> >
> java.naming.factory.initial=com.evermind.server.ApplicationCli
> entInitialCont
> extFactory
> >
> > >         java.naming.provider.url=ormi://localhost/
> > >         java.naming.security.principal=admin
> > > .- Then in my servlet, I just try to see if the objects are there:
> > >         ...
> > >         Context ctx = new InitialContext();
> > >         QueueConnectionFactory queueConnectionFactory =
> > >                 (QueueConnectionFactory)
> > > ctx.lookup("java:comp/env/jms/QueueConnectionFactory");
> > >         // Exception is thrown in the line above
> > >         ...
> > > The facts:
> > >         .- JMS Server seems to have been started, as I can see the
> > jms.log file
> > > and reads (Date 1.4.5 Started)
> > >         .- I have tried with various names, with and without
> > java:comp/env, and
> > > with various methods (list, listBindings...) with no
> look. I cannot
> > get
> > > a single object to be looked up.
> > >         .- Platform is WinNt 4.0, JDK1.3.0-c hotspot,
> Orion 1.4.5 (I
> > also tried
> > > 1.5.2 with the same results)
> > >
> > > So, what have I forgotten to do? It seems like I just forgot to do
> > some
> > > essential step. I tried to find the JMS how to by Kesav
> Kumar but I
> > > couldn't find it. Anybody, please?
> > > Thank you in advance,
> > > D.
> > >
> > > PD: On a side note, I have seen man people trying to use
> external JMS
> > > providers with Orion, is that so because Orion JMS is
> buggy? Would it
> > be
> > > better to use some external tool like OpenJMS or so? I
> had thought it
> > > would be nice to have everything in the same place, this
> way you just
> > > have to take care of one server. Comments?
> >
>
>

Reply via email to