Topic
1 reply Latest Post - ‏2008-11-24T19:56:39Z by SystemAdmin
SystemAdmin
SystemAdmin
1215 Posts
ACCEPTED ANSWER

Pinned topic Name not found in context "java:"

‏2007-01-12T15:24:33Z |
I know that this is a topic that has been disscussed in detail. I had my datasource connection working fine. Then I had to reference a new alias and connection. I have changed everything in my bean to reference the new JNDI

protected void initializer() {
select = new DBSelect();
try {
select.setDataSourceName("java:comp/env/jdbc/MyDB");
select.setCommand("SELECT * FROM MyDb.MD_HOLD");
execute();
} catch (SQLException ex) {
ex.printStackTrace();
}
}

And yet I still get this:

1/12/07 9:42:48:688 EST 00000041 SystemErr R com.ibm.db.beans.DBException: Unexpected error; javax.naming.NameNotFoundException: Name "comp/env/jdbc/MyDb" not found in context "java:".
at com.ibm.db.beans.DBException.getSQLException(DBException.java)
at com.ibm.db.beans.DBSelect.execute(DBSelect.java)
at pagecode.AllHold1.execute(AllHold1.java:45)
at pagecode.AllHold1.initializer(AllHold1.java:33)
at pagecode.AllHold1.<init>(AllHold1.java:22)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java(Compiled Code))
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java(Compiled Code))
at java.lang.reflect.Constructor.newInstance(Constructor.java(Compiled Code))
at java.lang.Class.newInstance3(Class.java(Compiled Code))
at java.lang.Class.newInstance(Class.java(Compiled Code))
at java.beans.Beans.instantiate(Beans.java:219)
at java.beans.Beans.instantiate(Beans.java:63)
at com.sun.faces.config.ManagedBeanFactory.newInstance(ManagedBeanFactory.java:204)
at com.sun.faces.application.ApplicationImpl.createAndMaybeStoreManagedBeans(ApplicationImpl.java:899)
at com.sun.faces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:84)
at com.ibm.faces.databind.SelectItemsVarResolver.resolveVariable(SelectItemsVarResolver.java:40)
at com.sun.faces.el.impl.NamedValue.evaluate(NamedValue.java:125)
at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java(Compiled Code))
at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:243)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:156)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:137)
at javax.faces.component.UIOutput.getValue(UIOutput.java:147)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:84)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:193)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:171)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:748)
at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:604)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:527)
at com.sun.faces.taglib.html_basic.SelectBooleanCheckboxTag.doEndTag(SelectBooleanCheckboxTag.java:610)
at com.ibm._jsp._HoldView._jspx_meth_h_selectBooleanCheckbox_0(_HoldView.java:310)
at com.ibm._jsp._HoldView._jspx_meth_hx_scriptCollector_1(_HoldView.java:552)
at com.ibm._jsp._HoldView._jspx_meth_h_form_0(_HoldView.java:584)
at com.ibm._jsp._HoldView._jspx_meth_hx_scriptCollector_0(_HoldView.java:611)
at com.ibm._jsp._HoldView._jspx_meth_f_view_0(_HoldView.java:641)
at com.ibm._jsp._HoldView._jspService(_HoldView.java:94)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629)
at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:117)
at com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPExtensionServletWrapper.java:171)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:250)
at com.ibm.faces.context.MultipartExternalContextImpl.dispatch(MultipartExternalContextImpl.java:411)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:249)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:201)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:94)
at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1528)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)

Any Help would be greatly appriciated.
Like I said before I had this working and then I had to change the connection and alias. I checked in my Deployment descriptor and web.xml and it is showing in both I can query the Database through the SQL builder with the new connection. But cannot with javabean.

Updated on 2008-11-24T19:56:39Z at 2008-11-24T19:56:39Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1215 Posts
    ACCEPTED ANSWER

    Re: Name not found in context "java:"

    ‏2008-11-24T19:56:39Z  in response to SystemAdmin
    Dealton,
    I am having the same problem. Could you tell me how you solved the issue?

    Thanks!