You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by samg <sa...@wellogic.com> on 2007/02/12 19:45:06 UTC
JNDI issue running under Tomcat
Hi,
I'm running ServiceMix under Tomcat, loading using
ClassPathXmlApplicationContext. I've tried a couple of different
approaches, but can't seem to get to JNDI datasources defined in my
application Context xml file.. I get "Name xxxx is not bound in this
Context" errors.
Before I tried this, I've been running ServiceMix standalone using the
configuration that came with it, including the jndi.xml that registers
things like the TransactionManager.. presumably whatever solution I wind up
with would have to still do that.. I'm guessing I can't use
SpringInitialContextFactory for that, right?
Thanks for any help you can give (and thanks for your help in the past!)
Regards,
Sam
--
View this message in context: http://www.nabble.com/JNDI-issue-running-under-Tomcat-tf3215648s12049.html#a8930143
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: JNDI issue running under Tomcat
Posted by samg <sa...@wellogic.com>.
Sorry, I think my wording wasn't clear- I meant that I have a web application
with an xml file that defines its <Context/>, and in there I have JDNI
resources (datasources). My application can get to those datasources. I
then load ServiceMix by explicitly instantiating
ClassPathXmlApplicationContext (though I have also tried using
XmlWebApplicationContext via my web.xml), and my code running under
ServiceMix can't access those datasources. I thought the
SpringInitialContextFactory might be blocking my access to them by replacing
the global context, and so tried removing it, which didn't help. Still, its
documentation seems to say that it is for standalone use..? So what I need
is
a) to get access to JNDI resources defined outside of the ServiceMix
configuration, and
b) to allow ServiceMix to get to its own JNDI resources as defined in the
jndi.xml included with it (or have it find them some other way?)
Thank you-
Sam
Rick.Jones wrote:
>
>
>
> Hi Samg,
> You can remove the import file and do it this way in the
> applicationContext.xml:
>
> <!-- JNDI BEAN -->
> <bean id="jndi"
> class="org.apache.xbean.spring.jndi.SpringInitialContextFactory"
> factory-method="makeInitialContext" singleton="true">
> <property name="entries">
> <map>
> <entry key="jms/ConnectionFactory"
> value-ref="jmsFactory"/>
> </map>
> </property>
> </bean>
>
> <!-- RETRO JMS Factory Bean -->
> <bean id="jmsFactory"
> class="org.apache.activemq.pool.PooledConnectionFactory">
> <property name="connectionFactory">
> <bean
> class="org.apache.activemq.ActiveMQConnectionFactory">
> <constructor-arg
> value="tcp://localhost:port"/>
> </bean>
> </property>
> </bean>
>
> See if that works for you.
>
> Regards Rick
>
>
>
>
>
>
> samg <sa...@wellogic.com>
> 12/02/2007 18:45
> Please respond to servicemix-users
>
>
> To: servicemix-users@geronimo.apache.org
> cc:
> Subject: JNDI issue running under Tomcat
>
>
>
> Hi,
> I'm running ServiceMix under Tomcat, loading using
> ClassPathXmlApplicationContext. I've tried a couple of different
> approaches, but can't seem to get to JNDI datasources defined in my
> application Context xml file.. I get "Name xxxx is not bound in this
> Context" errors.
> Before I tried this, I've been running ServiceMix standalone using the
> configuration that came with it, including the jndi.xml that registers
> things like the TransactionManager.. presumably whatever solution I wind
> up
> with would have to still do that.. I'm guessing I can't use
> SpringInitialContextFactory for that, right?
> Thanks for any help you can give (and thanks for your help in the past!)
> Regards,
> Sam
> --
> View this message in context:
> http://www.nabble.com/JNDI-issue-running-under-Tomcat-tf3215648s12049.html#a8930143
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>
>
>
>
> Direct Line Group Limited, registered in England
> with number 2811437, registered office 3 Edridge
> Road, Croydon, Surrey CR9 1AG. The following
> companies are members of the Direct Line Group:
> Direct Line Insurance plc, Direct Line Life
> Insurance Company Limited, Direct Line Unit
> Trusts Limited and Direct Line Financial Services
> Limited, all of which are authorised and regulated
> by the Financial Services Authority. All are
> members of The Royal Bank of Scotland Group.
>
> This email is intended for the addressee only and
> may contain confidential, proprietary or legally
> privileged information. If you are not the
> intended recipient of this email you should
> notify us immediately and delete it. You should
> not copy, print, distribute, disclose or use any
> part of it. We reserve the right to monitor and
> record all electronic communications through our
> networks. We cannot accept any liability for
> viruses transmitted via this e-mail once it has
> left our networks.
>
>
--
View this message in context: http://www.nabble.com/JNDI-issue-running-under-Tomcat-tf3215648s12049.html#a8944795
Sent from the ServiceMix - User mailing list archive at Nabble.com.