Topic
  • 2 replies
  • Latest Post - ‏2011-10-28T13:28:38Z by aryan_raj
aryan_raj
aryan_raj
67 Posts

Pinned topic NameNotFound exception

‏2011-10-26T06:48:06Z |
Hi All,

I am using WPF 6.1.5, and factory designer IDE. I am able to run my model which has some sql builder calls in it as a web application, configured the project to portal WAS.
Have created jndi for data source used by the application in portal WAS, now when I add portlet adapter builder to run it on my portal server. When install it on my portal server, below is the exception that I am getting,
Category: bowstreet.system.server.logging.event.criterion.abnormal
Priority: ERROR
Msg: Component: SERVER
javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1767)
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1083)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:991)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263)
at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:384)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:204)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:144)
at javax.naming.InitialContext.lookup(InitialContext.java:363)
at com.bowstreet.builders.webapp.methods.SqlDataSourceHelper.getNewDataSource(SqlDataSourceHelper.java:550)
at com.bowstreet.builders.webapp.methods.SqlDataSourceHelper.getDataSourceHandler(SqlDataSourceHelper.java:488)
at com.bowstreet.builders.webapp.methods.SqlDataSourceHelper.initialize(SqlDataSourceHelper.java:460)
at genjava._dbTry.mytdbDataSource_createHelper(_dbTry.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.bowstreet.webapp.engine.actions.MethodAction.callAction(MethodAction.java:90)
at com.bowstreet.webapp.engine.WebAppAccessImpl.callMethod(WebAppAccessImpl.java:405)
at com.bowstreet.webapp.engine.WebAppAccessImpl.callMethod(WebAppAccessImpl.java:271)
at com.bowstreet.webapp.engine.WebAppInstanceData.callMethod(WebAppInstanceData.java:367)
at com.bowstreet.webapp.structures.VariableUtil.instantiateObjectValue(VariableUtil.java:195)
at com.bowstreet.webapp.structures.RuntimeVariableImpl.getVariableValue(RuntimeVariableImpl.java:382)
at com.bowstreet.webapp.structures.RuntimeVariableImpl.getValue(RuntimeVariableImpl.java:137)
at com.bowstreet.webapp.structures.VariablesImpl.getVariableValue(VariablesImpl.java:584)
at com.bowstreet.webapp.structures.VariablesImpl.getObject(VariablesImpl.java:388)
at genjava._dbTry.mytdbInvokeBase(_dbTry.java:207)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.bowstreet.webapp.engine.actions.MethodAction.callAction(MethodAction.java:90)
at com.bowstreet.webapp.engine.WebAppAccessImpl.callMethod(WebAppAccessImpl.java:405)
at com.bowstreet.webapp.engine.WebAppAccessImpl.callMethod(WebAppAccessImpl.java:286)
at genjava._dbTry.mytdbInvoke(_dbTry.java:232)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.bowstreet.webapp.engine.actions.MethodAction.callAction(MethodAction.java:90)
at com.bowstreet.webapp.engine.WebAppAccessImpl.callMethod(WebAppAccessImpl.java:405)
at com.bowstreet.webapp.engine.WebAppAccessImpl.callMethod(WebAppAccessImpl.java:271)
Updated on 2011-10-28T13:28:38Z at 2011-10-28T13:28:38Z by aryan_raj
  • kevintap
    kevintap
    111 Posts

    Re: NameNotFound exception

    ‏2011-10-26T14:24:43Z  
    This error looks like you have an indirect resource reference to a data source configured in the SQL Call (or SQL DataSource) builder. This would be of the form java:comp/env/jdbc/mydatasource.

    In order to use an indirect resource reference with WAS, you'll need to add the reference to the web.xml and ibm-web-bnd.xmi. Here's a link to another post describing how to do this: https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14075609&#14075609

    Alternatively, you can change the data source input in the SQL Call builder to use a direct reference by removing the java:comp/env/ prefix.
  • aryan_raj
    aryan_raj
    67 Posts

    Re: NameNotFound exception

    ‏2011-10-28T13:28:38Z  
    • kevintap
    • ‏2011-10-26T14:24:43Z
    This error looks like you have an indirect resource reference to a data source configured in the SQL Call (or SQL DataSource) builder. This would be of the form java:comp/env/jdbc/mydatasource.

    In order to use an indirect resource reference with WAS, you'll need to add the reference to the web.xml and ibm-web-bnd.xmi. Here's a link to another post describing how to do this: https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14075609&#14075609

    Alternatively, you can change the data source input in the SQL Call builder to use a direct reference by removing the java:comp/env/ prefix.
    Thank you Kevin, its working now.