En l'instant précis du 02/15/07 13:14, Angel Todorov s'exprimait en ces
termes:
> Hi all,
>
> I am new to tomcat's JNDI in general, and would like to achieve this
> very simple task: I have two webapps webapp1.war and webapp2.war. I
> would like to use a global JNDI context and bind an object reference
> from some servlet in webapp1 , and then look this up from some servlet
> in webapp2.
in webapp1, programmaticaly do
Context initCtx = new InitialContext();
initCtx.bind(name,object);


However, be carefull about the 'object'. If it's class is not reachable
by both webapp, with the *same* classloader (so forget about using
WEB-INF/lib for that object's class), you will get ClassCast exceptions
with sometimes strange messages...

thing that should work easy, sharing String,Long,Array of String,
ArrayList of Long, ....

thing that will pose problems, sharing com.company.Xyz, sharing Array of
com.company.Xyz, sharing ArrayList of com.company.Xyz, ....


>
> I have read the tomcat documentation regarding <GlobalNamingResources>
> and <ResourceLink> declarations in server.xml, but somehow i cannot
> get this simple thing to work.
>
> Do I have to make any explicit configuration in the applications'
> web.xml? Or I just do this by looking up a custom context ?
>
> Thanks very much for your feedback.
>
> Best,
> Angel
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to