thanks Craig,

thatīs what I thought I read....  I was hoping that maybe there is an easier
way then wrinting my own factory to retreive objects via JNDI.  What I need
is a factory which can return any JDO objects.  I noticed in the particular
example provided by tomcat that you have to initialize the object in the
factory.  So that would mean that every time I create a new JDO object, I
have to add it to the factory.  Or have I missed something here?  Any
suggestions?

Thanks very much,

Michael



----- Original Message -----
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Saturday, July 27, 2002 6:09 PM
Subject: Re: Tomcat + JNDI


> Have you defined the resource itself in server.xml?  You'll need to set up
> the appropriate <Resource> and <ResourceParams> elements there in order to
> define how Tomcat is actually supposed to create the object factory for
> this resource.  See the jndi-resources-howto.html for more information on
> creating object factories for your own beans.
>
> Craig
>
>
> On Sat, 27 Jul 2002, Michael Delamere wrote:
>
> > Date: Sat, 27 Jul 2002 16:10:44 +0200
> > From: Michael Delamere <[EMAIL PROTECTED]>
> > Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: Tomcat + JNDI
> >
> > Hi,
> >
> > Iīm trying to access a bean via JNDI using Tomcat.  Unfortunately,
reading
> > documentation and mailing-lists hasnīt helped me very much.  Could
someone
> > please expalin to me what is involved in accessing a bean in tomcat via
> > JNDI.  Hereīs what Iīve done so far:
> >
> > ========== WEB.XML ====================
> > <resource-env-ref>
> >   <description>
> >     Object factory for MyBean instances.
> >   </description>
> >   <resource-env-ref-name>
> >     jdo/FindMe
> >   </resource-env-ref-name>
> >   <resource-env-ref-type>
> >     com.test.osforum.services.FindMe
> >   </resource-env-ref-type>
> > </resource-env-ref>
> >
> > ======== MY ACTION SERVLET ============
> >   Context context;
> >   Context envCtx;
> >   try {
> >    context = new InitialContext();
> >    envCtx = (Context) context.lookup("java:comp/env");
> >
> >     FindMe findme = (FindMe) envCtx.lookup("jdo/FindMe");
> >    message = findme.getSillyMessage();
> >    request.setAttribute("message", message);
> >   } catch (NamingException e) {
> >    System.out.println("-----| CATCH NAMING EXCEPTION-: " + e.toString()
+ "
> > |----- \n\n");
> >    e.printStackTrace();
> >   }
> > ========================================
> >
> > The above results in a " javax.naming.NamingException: Cannot create
> > resource instance".  Could someone please point me in the right
direction.
> >
> > Regards,
> >
> > Michael
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to