<resource-ref>
<res-ref-name>jdbc/ifacsDS</res-ref-name>
<res-type>javax.sql.ConnectionPoolDataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
in my code i have given
try
{
Context ctx = new InitialContext( );
String s = " java:comp/env/jdbc/ifacsDS";
DataSource data_source =
( DataSource )ctx.lookup( s );
out.println("success ");
}
catch (Exception e)
{
e.printStackTrace(out);
}
i am getting following error when i run the code
Ijavax.naming.NameNotFoundException: Context: SYSTEM31Node01Cell/nodes/SYSTEM31Node01/servers/server1, name: java:comp/env/jdbc/ifacsDS: First component in name java:comp/env/jdbc/ifacsDS not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.handleNameNotFound(WsnOptimizedNamingImpl.java:2000)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.getNextWsnOptimizedNamingContext(WsnOptimizedNamingImpl.java:1321)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.getTargetContext(WsnOptimizedNamingImplBase.java:3024)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase$LeafOperationData.<init>(WsnOptimizedNamingImplBase.java:3489)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:1427)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown Source)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:4045)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1776)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1737)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1444)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1324)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at check.doProcess(check.java:51)
at check.doGet(check.java:33)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
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.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.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)
m_i...@yahoo.co.in wrote:
> i am using websphere 6.0 trial version.i tried to create connection pooing.i created jdbc provider and datasource with following parameters scope : cells:SYSTEM31Node01Cell:nodes:SYSTEM31Node01 (where system31 is my system name)
>Class path :ojdbc14.jar
>implementation classname :oracle.jdbc.pool.OracleConnectionPoolDataSource
>jndi-name :jdbc/ifacsDS
>helper-class: com.ibm.websphere.rsadapter.OracleDataStoreHelper
>URL : jdbc:oracle:thin:@morpheus:1521:IFACS
>in my web.xml file i have given
>
> <resource-ref>
> <res-ref-name>jdbc/ifacsDS</res-ref-name>
><res-type>javax.sql.ConnectionPoolDataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
>
>
>in my code i have given
>
> try
> {
>
> Context ctx = new InitialContext( );
> String s = " java:comp/env/jdbc/ifacsDS";
> DataSource data_source =
> ( DataSource )ctx.lookup( s );
> out.println("success ");
>
> }
> catch (Exception e)
> {
> e.printStackTrace(out);
> }
>
>
>i am getting following error when i run the code
>
>Ijavax.naming.NameNotFoundException: Context: SYSTEM31Node01Cell/nodes/SYSTEM31Node01/servers/server1, name: java:comp/env/jdbc/ifacsDS: First component in name java:comp/env/jdbc/ifacsDS not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound:
>
[snip]
You might also want to try ctx.lookup("ifacsDS") in there.
com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. Root exception is javax.naming.NameNotFoundException: Context: SYSTEM31Node01Cell/nodes/SYSTEM31Node01/servers/server1, name: jdbc/ifacsDS: First component in name jdbc/ifacsDS not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.handleNameNotFound(WsnOptimizedNamingImpl.java:2000)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.getNextWsnOptimizedNamingContext(WsnOptimizedNamingImpl.java:1321)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.getTargetContext(WsnOptimizedNamingImplBase.java:3024)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase$LeafOperationData.<init>(WsnOptimizedNamingImplBase.java:3489)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:1427)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown Source)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:4045)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1776)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1737)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1444)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:372)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstanceExt(IndirectJndiLookupObjectFactory.java:221)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstance(IndirectJndiLookupObjectFactory.java:149)
at com.ibm.ws.util.ResRefJndiLookupObjectFactory.getObjectInstance(ResRefJndiLookupObjectFactory.java:136)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:314)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:874)
at com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:191)
at com.ibm.ws.naming.java.javaURLContextRoot.processBoundObjectForLookup(javaURLContextRoot.java:400)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1280)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:198)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:139)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at check.doProcess(check.java:49)
at check.doGet(check.java:34)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
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.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2841)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681)
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.HttpInboundLink.ready(HttpInboundLink.java:276)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103)
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(ThreadP
Note:
During the configuration of "Map resource references to resources" i am getting some Warnings!!
1)
ADMA8019E: The resources that are assigned to the application are beyond the deployment target scope. Resources are within the deployment target scope if they are defined at the cell, node, server, or application level when the deployment target is a server, or at the cell, cluster, or application level when the deployment target is a cluster. Assign resources that are within the deployment target scope of the application or confirm that these resources assignments are correct as specified.
Resource Assignment:
Name: ifacsDS_CF
Scope: WebSphere:cell=SYSTEM31Node01Cell,node=SYSTEM31Node01,server=server1
*Type: J2CResourceAdapter
*JNDI: jdbc/ifacsDS
2)
ADMA0115W: Resource Assignment of name jdbc/ifacsDS and type javax.sql.ConnectionPoolDataSource, with JNDI name jdbc/ifacsDS is not found within scope of module ifacs.war with URI ifacs.war,WEB-INF/web.xml deployed to target WebSphere:cell=SYSTEM31Node01Cell,node=SYSTEM31Node01,server=server1.
>hi ken,
> i removed the space before java and reconfigure every thing againg. i am getting some error
>
>com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. Root exception is javax.naming.NameNotFoundException: Context: SYSTEM31Node01Cell/nodes/SYSTEM31Node01/servers/server1, name: jdbc/ifacsDS: First component in name jdbc/ifacsDS not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound:
>
>
[snip]
>Note:
>During the configuration of "Map resource references to resources" i am getting some Warnings!!
>
>1)
>ADMA8019E: The resources that are assigned to the application are beyond the deployment target scope. Resources are within the deployment target scope if they are defined at the cell, node, server, or application level when the deployment target is a server, or at the cell, cluster, or application level when the deployment target is a cluster. Assign resources that are within the deployment target scope of the application or confirm that these resources assignments are correct as specified.
>
>Resource Assignment:
>Name: ifacsDS_CF
>Scope: WebSphere:cell=SYSTEM31Node01Cell,node=SYSTEM31Node01,server=server1
>*Type: J2CResourceAdapter
>*JNDI: jdbc/ifacsDS
>
>
>2)
>ADMA0115W: Resource Assignment of name jdbc/ifacsDS and type javax.sql.ConnectionPoolDataSource, with JNDI name jdbc/ifacsDS is not found within scope of module ifacs.war with URI ifacs.war,WEB-INF/web.xml deployed to target WebSphere:cell=SYSTEM31Node01Cell,node=SYSTEM31Node01,server=server1.
>
>
You need to fix this first, as this is causing your NameNotFoundException.
Ken