Websphere datasource connection error

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Websphere datasource connection error

anpati1
 
Name jdbc not found in context "java:comp/env".
Hi,
I get this error while I try to connect using JNDI datasource on Websphere app server 6.0.2.
 
There is support for websphere for the error:
 
Problem(Abstract)
When a servlet or JSP™ in the same Java™ Virtual Machine (JVM) performs a look-up of the EJB™ using the resource reference, the request is successful. The failure occurs only when a background thread in the same JVM performs the look-up. The syntax "java:comp/env/jdbc/PMSDataSource" results in a nullPointerException and a noThreadContext message.
 
Cause
This problem is caused by trying to execute a look-up in a thread that is spawned in custom code. Each component that runs in a server has its own java: URL name space. The java: URL name space is part of the thread context. If the component spins off a thread, the spun-off thread has no thread context. As a result, there is no java: URL name space for the thread.
The primary problem is that the Java: URL name space cannot be found.
 
Resolving the problem
Do not execute the look-up in a separate thread. There is no way to provide a spun-off thread in any context. So, generally speaking, the code must be modified so that it does not do the java: look-up from a thread that you spin off.
 
I do not know how Orbeon has been implemented to resolve this error. Can I get a sample configure/datasource-sql.xml file which I can use to connect to the database?
It appears JNDI wont work for websphere app server
 
Thanks,
Anand


Did you know? You can CHAT without downloading messenger. Click here

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Websphere datasource connection error

Alessandro Vernet
Administrator
Anand,

On Fri, Feb 29, 2008 at 8:49 AM, Anand Patil <[hidden email]> wrote:
>    [...]
>  Resolving the problem
>  Do not execute the look-up in a separate thread. There is no way to provide
> a spun-off thread in any context. So, generally speaking, the code must be
> modified so that it does not do the java: look-up from a thread that you
> spin off.

As far as I know we are not starting new threads. Could you post the
stack trace for the exception you are getting?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Websphere datasource connection error

anpati1
Hi,
 
Please find below the trace. I'm using the datasource.xml input for now.
Thanks,
Anand
 
 
javax.naming.NameNotFoundException
Exception Class javax.naming.NameNotFoundException
Message Name jdbc not found in context "java:comp/env".
Servlet Stack Trace
(290 method calls)
Class Name Method Name File Name Line Number
com.ibm.ws.naming.ipbase.NameSpace getParentCtxInternal NameSpace.java N/A
com.ibm.ws.naming.ipbase.NameSpace lookupInternal NameSpace.java 1083
com.ibm.ws.naming.ipbase.NameSpace lookup NameSpace.java 991
com.ibm.ws.naming.urlbase.UrlContextImpl lookup UrlContextImpl.java 1263
com.ibm.ws.naming.urlbase.UrlContextImpl lookup UrlContextImpl.java 1307
org.orbeon.oxf.processor.DatabaseContext getConnection DatabaseContext.java 55
org.orbeon.oxf.processor.sql.SQLProcessorInterpreterContext getConnection SQLProcessorInterpreterContext.java 305
org.orbeon.oxf.processor.sql.interpreters.QueryInterpreter end QueryInterpreter.java 168
org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler endElement SQLProcessor.java 542
org.orbeon.oxf.processor.sql.SQLProcessor$ForwardingContentHandler endElement SQLProcessor.java 634
<SPAN onclick="hideShowTBody('trace-1-servlet-1')">Toggle More...


Alessandro Vernet <[hidden email]> wrote:
Anand,

On Fri, Feb 29, 2008 at 8:49 AM, Anand Patil wrote:
> [...]
> Resolving the problem
> Do not execute the look-up in a separate thread. There is no way to provide
> a spun-off thread in any context. So, generally speaking, the code must be
> modified so that it does not do the java: look-up from a thread that you
> spin off.

As far as I know we are not starting new threads. Could you post the
stack trace for the exception you are getting?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws


Explore your hobbies and interests. Click here to begin.

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Websphere datasource connection error

mangvlad
I had a very similar error with Weblogic just yesterday. For me it
turns out to be the fact that I did not had the reference to the
connection in web.xml and weblogic.xml.
(Not sure if your problem is the same but just in case...)



On Thu, Mar 6, 2008 at 8:46 AM, Anand Patil <[hidden email]> wrote:

> Hi,
>
> Please find below the trace. I'm using the datasource.xml input for now.
> Thanks,
> Anand
>
>
>
>  javax.naming.NameNotFoundException
>  Exception Class javax.naming.NameNotFoundException
>  Message
>  Name jdbc not found in context "java:comp/env".
>  Servlet Stack Trace
> (290 method calls)
>  Class Name Method Name File Name Line Number
>  com.ibm.ws.naming.ipbase.NameSpace getParentCtxInternal NameSpace.java N/A
>  com.ibm.ws.naming.ipbase.NameSpace lookupInternal NameSpace.java 1083
>  com.ibm.ws.naming.ipbase.NameSpace lookup NameSpace.java 991
>  com.ibm.ws.naming.urlbase.UrlContextImpl lookup UrlContextImpl.java 1263
>  com.ibm.ws.naming.urlbase.UrlContextImpl lookup UrlContextImpl.java 1307
>  org.orbeon.oxf.processor.DatabaseContext getConnection DatabaseContext.java
> 55
>  org.orbeon.oxf.processor.sql.SQLProcessorInterpreterContext getConnection
> SQLProcessorInterpreterContext.java 305
>  org.orbeon.oxf.processor.sql.interpreters.QueryInterpreter end
> QueryInterpreter.java 168
>  org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler
> endElement SQLProcessor.java 542
>  org.orbeon.oxf.processor.sql.SQLProcessor$ForwardingContentHandler
> endElement SQLProcessor.java 634
>  More...
>
>
> Alessandro Vernet <[hidden email]> wrote:
> Anand,
>
>
> On Fri, Feb 29, 2008 at 8:49 AM, Anand Patil wrote:
> > [...]
> > Resolving the problem
> > Do not execute the look-up in a separate thread. There is no way to
> provide
> > a spun-off thread in any context. So, generally speaking, the code must be
> > modified so that it does not do the java: look-up from a thread that you
> > spin off.
>
> As far as I know we are not starting new threads. Could you post the
> stack trace for the exception you are getting?
>
> Alex
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> Orbeon's Blog: http://www.orbeon.com/blog/
> Personal Blog: http://avernet.blogspot.com/
>
> --
> You receive this message as a subscriber of the [hidden email] mailing
> list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>
>
>  ________________________________
>  Explore your hobbies and interests. Click here to begin.
>
>  --
>  You receive this message as a subscriber of the [hidden email] mailing
> list.
>  To unsubscribe: mailto:[hidden email]
>  For general help: mailto:[hidden email]?subject=help
>  OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Websphere datasource connection error

Alessandro Vernet
Administrator
In reply to this post by anpati1
Anand,

Anand Patil wrote:
> Please find below the trace. I'm using the datasource.xml input for now.

I was interested in seeing the whole stack trace. I know it's long, but
if you look at it you will be able able to see if
org.orbeon.oxf.processor.DatabaseContext is ultimately called by some
WebSphere class, or if there are some java.lang.Thread in the middle. If
there is no code related to java.lang.Thread, then you will be sure that
we are not creating a thread, and that the error is somewhere else (e.g.
in the setup of the data source).

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws