tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Angel Todorov" <attodo...@gmail.com>
Subject Re: using JNDI to share object reference between two apps
Date Thu, 15 Feb 2007 12:27:40 GMT
Hi David,

Does tomcat perform explicit serialization of everything, even if JNDI
is used locally on the same JVM ? I wouldn't want to serialize
anything. Sure the producer (bind) and the consumer (lookup) will use
the same interface, but the producer doesn't have to care about the
classes used "behind" that interface, since they are normally loaded
by the classloader of the producer (that does bind) web app. Is that
the case with tomcat? Thanks.

Best,
Angel

On 2/15/07, David Delbecq <delbd@oma.be> wrote:
> 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: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Mime
View raw message