[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] JNDI and OSGI

Dear all,

Thanks for your answers.  Following some of your suggestions ("buddy
classloading") I got it working. I agree that using this kind of tricks
is not clean but what other options do I have? Unfortunately, we are
forced  to use "real" application servers, so we cannot go pure  OSGi
and we have to use the BridgeServlet approach.

Best regards,

Ernesto


Pascal Rapicault wrote:
>
> I'm pretty ignorant of JNDI and stuffs, but simply hearing the word
> "context class loader" immediatly makes me think about "buddy
> classloading".
> Have you explored that path?
> I know it is not "osgi" ratified (at least yet).
>
> PaScaL
>
>
>
> *"Simon Kaegi" <simon.kaegi@xxxxxxxxx>*
> Sent by: equinox-dev-bounces@xxxxxxxxxxx
>
> 01/29/2007 12:51 PM
> Please respond to
> Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
>
>
> 	
> To
> 	"Equinox development mailing list" <equinox-dev@xxxxxxxxxxx>
> cc
> 	
> Subject
> 	Re: [equinox-dev] JNDI and OSGI
>
>
>
> 	
>
>
>
>
>
> To add to Neil's comment....
>
> The newsgroup would probably be better for this.
>
> JNDI interaction is tough as (at least in the implementations I've looked
> at) it tends to depend on specific instances of the thread context class
> loader.
> I'm guessing JBoss is going to be pretty standard in this regard in which
> case it's NamingManager might be looking for your webapps class loader.
>
> This is not pretty and I'd be interested in seeing if we can come up
> with a
> general solution to the problem however I can suggest an approach if
> you're
> desperate. Before creating your InitialContext and whenever making lookup
> calls set (and then reset) your thread context class loader to the
> webapps.
> You can get the webapp classloader in a variety of ways however the
> easiest
> might be to import org.eclipse.equinox.servletbridge and then do
> something
> like BridgeServlet.class.getClassLoader().
>
> HTH
> -Simon
>
>
> ----- Original Message -----
> From: "Neil Bartlett" <njbartlett@xxxxxxxxx>
> To: "Equinox development mailing list" <equinox-dev@xxxxxxxxxxx>
> Sent: Monday, January 29, 2007 12:33 PM
> Subject: Re: [equinox-dev] JNDI and OSGI
>
>
> > Hi Ernesto,
> >
> > I'm not 100% this is suitable for this list, but then I don't know where
> > else it should be asked so I'll have a go at answering anyway.
> >
> > It sounds like your JNDI InitialContext is trying to make a remote
> > connection to an external JNDI server via the network. Presumably since
> > your code is running inside JBoss, you actually want to use the JBoss
> > internal JNDI context. Ensure that there are no jndi.properties files
> > anywhere on the classpath. Some vendors "helpfully" include a
> > jndi.properties file in the JARs that they ship, just to make life
> > difficult.
> >
> > Also ensure that you setup the JNDI data source as an environment
> > reference in the web.xml, and in the jboss_web.xml, and then use the
> > "java:comp/env" prefix for your JNDI lookup...
> >
> > Alternatively, you could stop jumping through all these ridiculous hoops
> > just to use a legacy technology like JNDI, and try going with an
> all-OSGi
> > architecture :-)
> >
> > Regards,
> > Neil
> >
> >
> >> Hi,
> >>
> >> I have a question regarding using JNDI (e.g. to look-up  DataSources)
> >> and running equinox via a the servletbridge. I hope this is the right
> >> place to post it (if not my apologies, and please tell me where
> should I
> >> ask).
> >>
> >> My question is simple. Is it possible to directly access JNDI resource
> >> from a bundle. I'm trying to access a DataSource defined in JBoss and I
> >> get  a javax.naming.CommunicationException (with a nested timeout
> >> exception) .
> >>
> >> Best regards,
> >>
> >> Ernesto
> >> _______________________________________________
> >> equinox-dev mailing list
> >> equinox-dev@xxxxxxxxxxx
> >> https://dev.eclipse.org/mailman/listinfo/equinox-dev
> >>
> >
> >
> > _______________________________________________
> > equinox-dev mailing list
> > equinox-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/equinox-dev
>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>