tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aparna1 V <aparna...@tcs.com>
Subject javax.naming.NamingException: Cannot create resource instance
Date Thu, 21 Oct 2010 15:25:10 GMT
Hi,

I am migrating my application from tomcat 4 to tomcat 6.0. But the data 
sources are not being created. 


I have configured the datasources in the server.xml as follows: 
Im trying to connect to sql server 2005. 


server.xml
<Resource name = "jdbc/sql_2005" 
                auth = "Container" 
                type = "com.microsoft.jdbcx.sqlserver.SQLServerDataSource" 
        />

 <Resource name = "jdbc/global05" 
                auth = "Container"
                type = "com.microsoft.pool.PoolDataSource" />
 
<ResourceParams name="jdbc/sql_2005" >
 
            <parameter><name>serverName</name>
            <value>NYCITASD074</value></parameter>
 
            <parameter><name>portNumber</name>
            <value>1433</value></parameter>
 
            <parameter><name>databaseName</name>
            <value>FBRAE_GLOBAL</value></parameter>
 
            <parameter><name>factory</name>
 
<value>com.microsoft.jdbcx.sqlserver.SQLServerDataSourceFactory</value></parameter>
 
            <parameter><name>driverClassName</name>
 
<value>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</value></parameter>
 
            <parameter><name>loginTimeout</name>
            <value>3000</value></parameter>
 
            <parameter><name>selectMethod</name>
            <value>cursor</value></parameter>
 
            <parameter><name>driverName</name>
            <value>SQLServer2005</value></parameter>
 
            <parameter><name>description</name>
            <value>SQL 2005 datasource</value></parameter>
 
            <parameter><name>user</name>
            <value>user-id</value></parameter>
 
            <parameter><name>password</name>
            <value>password</value></parameter>
 
        </ResourceParams>
 
        <ResourceParams name="jdbc/global05" >
 
            <parameter><name>factory</name>
 <value>com.microsoft.pool.PoolDataSourceFactory</value></parameter>
 
            <parameter><name>className</name>
            <value>com.microsoft.pool.PoolDataSource</value></parameter>
 
            <parameter><name>poolName</name>
            <value>2005pool</value></parameter>
 
            <parameter><name>maxConnections</name>
            <value>100</value></parameter>
 
            <parameter><name>minConnections</name>
            <value>1</value></parameter>
 
            <parameter><name>checkEvery</name>
            <value>20000</value></parameter>
 
            <parameter><name>idleTimeout</name>
            <value>50000</value></parameter>
 
            <parameter><name>dsJndiName</name>
            <value>jdbc/sql_2005</value></parameter>
 
            <parameter><name>description</name>
            <value>MSSQL_Pool05</value></parameter> 
        </ResourceParams>

</GlobalNamingResources>

  <!-- Define the Tomcat Stand-Alone Service -->
  <Service name="Tomcat-Standalone">

 

 

    <!-- Define an AJP 1.3 Connector on port 8009 -->
        <Connector port="8009" protocol="AJP/1.3" 
                           redirectPort="8443"
                           address="10.152.35.166"
               minProcessors="5" 
               connectionTimeout="20000"
               maxProcessors="50" 
               acceptCount="10" 
               enableLookups="false"
               tomcatAuthentication="true" debug="0"/>
 <Engine name="Standalone" defaultHost="localhost" debug="0" 
jvmRoute="dw05926usi1s" >
 <Realm className="org.apache.catalina.realm.JAASRealm" appName="websso" 
 
userClassNames="com.db.websso.providers.authentication.tomcat.WebSSOUserImpl" 
 
 
roleClassNames="com.db.websso.providers.authentication.tomcat.WebSSOGroupImpl" 
 
        debug="99" />

<ResourceLink name="jdbc/sql_2005" global="jdbc/sql_2005" 
type="com.microsoft.jdbcx.sqlserver.SQLServerDataSource"/>
            <ResourceLink name="jdbc/global05" global="jdbc/global05" 
type="com.microsoft.pool.PoolDataSource"/>
            <ResourceLink name="jdbc/sql_05" global="jdbc/sql_05" 
type="com.microsoft.jdbcx.sqlserver.SQLServerDataSource"/>
            <ResourceLink name="jdbc/fbrae05" global="jdbc/fbrae05" 
type="com.microsoft.pool.PoolDataSource"/>
        </Context>

      </Host>
 
I am getting the following error: 


PoolName = 2005pool PoolJndiRef = jdbc/global05
Init Param: jdbc/global05
javax.naming.NamingException: Cannot create resource instance
                 at 
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:142)
                 at 
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
                 at 
org.apache.naming.NamingContext.lookup(NamingContext.java:793)
                 at 
org.apache.naming.NamingContext.lookup(NamingContext.java:140)
                 at 
org.apache.naming.NamingContext.lookup(NamingContext.java:781)
                 at 
org.apache.naming.NamingContext.lookup(NamingContext.java:153)
                 at 
org.apache.naming.factory.ResourceLinkFactory.getObjectInstance(ResourceLinkFactory.java:97)
                 at 
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
                 at 
org.apache.naming.NamingContext.lookup(NamingContext.java:140)
                 at 
org.apache.naming.NamingContext.lookup(NamingContext.java:781)
                 at 
org.apache.naming.NamingContext.lookup(NamingContext.java:153)
                 at 
com.microsoft.pool.JNDITool.getPoolDataSource(JNDITool.java:103)
                 at 
com.microsoft.pool.PoolHandler.createPool(PoolHandler.java:48)
                 at 
com.microsoft.pool.PoolHandler.init(PoolHandler.java:75)
                 at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
                 at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
                 at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187)
                 at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4496)
                 at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                 at 
org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
                 at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                 at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
                 at 
org.apache.catalina.core.StandardService.start(StandardService.java:516)
                 at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
                 at 
org.apache.catalina.startup.Catalina.start(Catalina.java:593)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
                 at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:597)
                 at 
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
                 at 
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
java.lang.NullPointerException
                 at 
com.microsoft.pool.JNDITool.getPoolDataSource(JNDITool.java:123)
                 at 
com.microsoft.pool.PoolHandler.createPool(PoolHandler.java:48)
                 at 
com.microsoft.pool.PoolHandler.init(PoolHandler.java:75)
                 at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
                 at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
                 at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187)
                 at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4496)
                 at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                 at 
org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
                 at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                 at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
                 at 
org.apache.catalina.core.StandardService.start(StandardService.java:516)
                 at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
                 at 
org.apache.catalina.startup.Catalina.start(Catalina.java:593)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
                 at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:597)
                 at 
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
                 at 
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)


Please advise as to what could be wrong since im using the server.xml that 
i was using with the tomcat 4. 

Thanks,
Aparna


=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message