Cannot create DataSource, Exception in Tomcat 4.1

I am running into a major problem with Tomcat4.1 trying to access a Datasource.
I referenced about 7 articles one of which has the subject "Cannot create JDBC driver of class '' for connect URL 'null', cause..."
but he is using Tomcat 5. I even tried to simulate his solution to mine but still no use.
I tried to connect to the database the old fashion way and it worked... I get connected (JDBC connection w/o Datasource).
I changed the XML many times but with no luck. I must be doing something stupid that I can't see.
Any help is greatly appreciated.... I ran out of solutions...
I initially loaded my app through Tomcat manager and created the DataSource through Tomcat admin screen.
my CLASSPATH =
C:\J4Log\logging-log4j-1.2.9\dist\lib\log4j-1.2.9.jar;
C:\JBoss4-0\jboss-4.0.1sp1;C:\CONNX32\CONNXJDBC\JAVA\JAR\connxjdbc.jar;
C:\JBuilderX\lib\mysql-connector-java-3.0.15-ga-bin.jar;
C:\Program Files\Apache Group\Tomcat 4.1\common\lib\commons-dbcp-1.2.1.jar;
C:\Program Files\Apache Group\Tomcat 4.1\common\lib\commons-pool-1.1.jar;
C:\Program Files\Apache Group\Tomcat 4.1\common\lib\commons-collections-3.1.jar;
C:\Program Files\Apache Group\Tomcat 4.1\common\lib\mysql-connector-java-3.1.8-bin.jar
my web.xml =
<resource-ref>
    <description>DB connection</description>
    <res-ref-name>jdbc/MyDBASE</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>-------------------
The sample snipet to connect to the database (which works)
ConnectionHelper contains the following (simplified)...
     Class.forName("com.mysql.jdbc.Driver").newInstance();
     return DriverManager.getConnection("jdbc:mysql://10.0.3.52/MyDBASE?user=Myadmin&password=AdminPWD");
  ConnectionHelper connectionHelper = new ConnectionHelper();
  Statement st = null;
  try {
    Connection conn = connectionHelper.getConnection();
    st = conn.createStatement();
    System.out.println("\n=========== ssuucceessffullllllll=======\n");
  catch (SQLException ex1) {
     System.out.println("error connecting=================");
     ex1.printStackTrace();
whenever i execute my JSP (which calls my java class .. code follows....
  Context envCtx = (Context) init.lookup("java:comp/env");
       DataSource ds = (DataSource)envCtx.lookup("jdbc/MyDBASE");it breaks on the DataSource giving..
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '
' for connect URL 'null', cause:
java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getDriver(DriverManager.java:243)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:743)
        at org.apache.commons.dbcp.BasicD.........--
Another error (which is from within the IDE) is
java.lang.NoClassDefFoundError: tyrex/jdbc/xa/EnabledDataSource     at rg.apache.naming.factory.TyrexDataSourceFactory.getObjectInstance(TyrexDataSourceFactory.java:166)
     at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:164)
     at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
     at org.apache.naming.NamingContext.lookup(NamingContext.java:834)
     at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
     at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
     at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
     at simpleservlet.TestJSPBean.init(TestJSPBean.java:41)
     at org.apache.jsp.testJSP$jsp._jspService(testJSP$jsp.java:115)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)--------------------------
and finally, Server.XML...
<?xml version='1.0' encoding='utf-8'?>
<Server className="org.apache.catalina.core.StandardServer" debug="0" port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"/>
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" debug="0" jsr77Names="false"/>
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" debug="0"/>
  <GlobalNamingResources>
    <Environment name="simpleValue" override="true" type="java.lang.Integer" value="30"/>
    <Resource name="jdbc/MyDBASE" scope="Shareable" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/MyDBASE">
      <parameter>
        <name>validationQuery</name>
        <value>select now()</value>
      </parameter>
      <parameter>
        <name>url</name>
        <value>jdbc:mysql://10.0.3.52/MyDBASE?autoReconnect=true</value>
      </parameter>
      <parameter>
        <name>password</name>
        <value>AdminPWD</value>
      </parameter>
      <parameter>
        <name>maxActive</name>
        <value>4</value>
      </parameter>
      <parameter>
        <name>maxWait</name>
        <value>5000</value>
      </parameter>
      <parameter>
        <name>driverClassName</name>
         <value>org.gjt.mm.mysql.Driver</value>
      </parameter>
      <parameter>
        <name>username</name>
        <value>Myadmin</value>
      </parameter>
      <parameter>
        <name>maxIdle</name>
        <value>2</value>
      </parameter>
    </ResourceParams>
  </GlobalNamingResources>
  <Service className="org.apache.catalina.core.StandardService" debug="0" name="Tomcat-Standalone">
    <Engine className="org.apache.catalina.core.StandardEngine"
               debug="0" defaultHost="localhost"
               mapperClass="org.apache.catalina.core.StandardEngineMapper"
               name="Standalone">
      <Host className="org........
        <Context className="org.apache.catalina.core.StandardContext" cachingAllowed="true"
                  charsetMapperClass="org.apache.catalina.util.CharsetMapper"
                  cookies="true" crossContext="false" debug="0"
                  displayName="simpleservlet"
                  docBase="/WebModule1" mapperClass="org.apache.catalina.core.StandardContextMapper"
                  path="/WebModule1" privileged="false" reloadable="false" swallowOutput="false"
                  useNaming="true"
                  workDir="work\Standalone\localhost\WebModule1"
                  wrapperClass="org.apache.catalina.core.StandardWrapper">
             <Resource auth="Container"
                        description="DB connection"
                        name="jdbc/MyDBASE" scope="Shareable"
                        type="javax.sql.DataSource"/>
       </Context>
    </Engine>
  </Service>
</Server>Thanks in advance for ANY help.

I am running into a major problem with Tomcat4.1 trying to access a Datasource.
I referenced about 7 articles one of which has the subject "Cannot create JDBC driver of class '' for connect URL 'null', cause..."
but he is using Tomcat 5. I even tried to simulate his solution to mine but still no use.
I tried to connect to the database the old fashion way and it worked... I get connected (JDBC connection w/o Datasource).
I changed the XML many times but with no luck. I must be doing something stupid that I can't see.
Any help is greatly appreciated.... I ran out of solutions...
I initially loaded my app through Tomcat manager and created the DataSource through Tomcat admin screen.
my CLASSPATH =
C:\J4Log\logging-log4j-1.2.9\dist\lib\log4j-1.2.9.jar;
C:\JBoss4-0\jboss-4.0.1sp1;C:\CONNX32\CONNXJDBC\JAVA\JAR\connxjdbc.jar;
C:\JBuilderX\lib\mysql-connector-java-3.0.15-ga-bin.jar;
C:\Program Files\Apache Group\Tomcat 4.1\common\lib\commons-dbcp-1.2.1.jar;
C:\Program Files\Apache Group\Tomcat 4.1\common\lib\commons-pool-1.1.jar;
C:\Program Files\Apache Group\Tomcat 4.1\common\lib\commons-collections-3.1.jar;
C:\Program Files\Apache Group\Tomcat 4.1\common\lib\mysql-connector-java-3.1.8-bin.jar
my web.xml =
<resource-ref>
    <description>DB connection</description>
    <res-ref-name>jdbc/MyDBASE</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>-------------------
The sample snipet to connect to the database (which works)
ConnectionHelper contains the following (simplified)...
     Class.forName("com.mysql.jdbc.Driver").newInstance();
     return DriverManager.getConnection("jdbc:mysql://10.0.3.52/MyDBASE?user=Myadmin&password=AdminPWD");
  ConnectionHelper connectionHelper = new ConnectionHelper();
  Statement st = null;
  try {
    Connection conn = connectionHelper.getConnection();
    st = conn.createStatement();
    System.out.println("\n=========== ssuucceessffullllllll=======\n");
  catch (SQLException ex1) {
     System.out.println("error connecting=================");
     ex1.printStackTrace();
whenever i execute my JSP (which calls my java class .. code follows....
  Context envCtx = (Context) init.lookup("java:comp/env");
       DataSource ds = (DataSource)envCtx.lookup("jdbc/MyDBASE");it breaks on the DataSource giving..
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '
' for connect URL 'null', cause:
java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getDriver(DriverManager.java:243)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:743)
        at org.apache.commons.dbcp.BasicD.........--
Another error (which is from within the IDE) is
java.lang.NoClassDefFoundError: tyrex/jdbc/xa/EnabledDataSource     at rg.apache.naming.factory.TyrexDataSourceFactory.getObjectInstance(TyrexDataSourceFactory.java:166)
     at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:164)
     at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
     at org.apache.naming.NamingContext.lookup(NamingContext.java:834)
     at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
     at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
     at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
     at simpleservlet.TestJSPBean.init(TestJSPBean.java:41)
     at org.apache.jsp.testJSP$jsp._jspService(testJSP$jsp.java:115)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)--------------------------
and finally, Server.XML...
<?xml version='1.0' encoding='utf-8'?>
<Server className="org.apache.catalina.core.StandardServer" debug="0" port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"/>
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" debug="0" jsr77Names="false"/>
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" debug="0"/>
  <GlobalNamingResources>
    <Environment name="simpleValue" override="true" type="java.lang.Integer" value="30"/>
    <Resource name="jdbc/MyDBASE" scope="Shareable" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/MyDBASE">
      <parameter>
        <name>validationQuery</name>
        <value>select now()</value>
      </parameter>
      <parameter>
        <name>url</name>
        <value>jdbc:mysql://10.0.3.52/MyDBASE?autoReconnect=true</value>
      </parameter>
      <parameter>
        <name>password</name>
        <value>AdminPWD</value>
      </parameter>
      <parameter>
        <name>maxActive</name>
        <value>4</value>
      </parameter>
      <parameter>
        <name>maxWait</name>
        <value>5000</value>
      </parameter>
      <parameter>
        <name>driverClassName</name>
         <value>org.gjt.mm.mysql.Driver</value>
      </parameter>
      <parameter>
        <name>username</name>
        <value>Myadmin</value>
      </parameter>
      <parameter>
        <name>maxIdle</name>
        <value>2</value>
      </parameter>
    </ResourceParams>
  </GlobalNamingResources>
  <Service className="org.apache.catalina.core.StandardService" debug="0" name="Tomcat-Standalone">
    <Engine className="org.apache.catalina.core.StandardEngine"
               debug="0" defaultHost="localhost"
               mapperClass="org.apache.catalina.core.StandardEngineMapper"
               name="Standalone">
      <Host className="org........
        <Context className="org.apache.catalina.core.StandardContext" cachingAllowed="true"
                  charsetMapperClass="org.apache.catalina.util.CharsetMapper"
                  cookies="true" crossContext="false" debug="0"
                  displayName="simpleservlet"
                  docBase="/WebModule1" mapperClass="org.apache.catalina.core.StandardContextMapper"
                  path="/WebModule1" privileged="false" reloadable="false" swallowOutput="false"
                  useNaming="true"
                  workDir="work\Standalone\localhost\WebModule1"
                  wrapperClass="org.apache.catalina.core.StandardWrapper">
             <Resource auth="Container"
                        description="DB connection"
                        name="jdbc/MyDBASE" scope="Shareable"
                        type="javax.sql.DataSource"/>
       </Context>
    </Engine>
  </Service>
</Server>Thanks in advance for ANY help.

Similar Messages

  • Cannot Create Datasource through Java Application

    Hi All,
    I tried to create a datasource through my Java application
    JDBCDescriptor jdbcDescriptor = new JDBCDescriptor();
              jdbcDescriptor.setDataSourceName("ds_venky");
              jdbcDescriptor.setDriverClassName("org.gjt.mm.mysql.Driver");
              jdbcDescriptor.setDriverName("mysql");
              jdbcDescriptor.setInitConnections(2);
              jdbcDescriptor.setMaxConnections(10);
              jdbcDescriptor.setPassword("xxxx");
              jdbcDescriptor.setURL("jdbc:mysql://172.22.76.8:3306/wise");
              jdbcDescriptor.setUsername("xxxx");
    Properties ctxProp = new Properties();
                   ctxProp.put(
                        Context.INITIAL_CONTEXT_FACTORY,
                        "com.sap.engine.services.jndi.InitialContextFactoryImpl");
                   ctxProp.put(Context.PROVIDER_URL, "myServerName:50004");
                   ctxProp.put(Context.SECURITY_PRINCIPAL, "xxxx");
                   ctxProp.put(Context.SECURITY_CREDENTIALS, "xxxx");
                   InitialContext context = new InitialContext(ctxProp);
                   DataSourceManager dsm =
                        (DataSourceManager) context.lookup("dbpool");
                   dsm.createDataSource("ds_venky", jdbcDescriptor);
    But i get the following exception
    1.5#000F20FEA14B0053000000000000107800041D9052026725#1158405595218#System.err#sap.com/DataSourceSAPEAR#System.err#Guest#2#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###0#
    #1.5#000F20FEA14B0053000000010000107800041D905202B73E#1158405595234#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###1#
    #1.5#000F20FEA14B0053000000020000107800041D905202D985#1158405595249#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###2#
    #1.5#000F20FEA14B0053000000040000107800041D905205BA71#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###java.io.FileNotFoundException: .
    temp
    deploy
    1158405595421 (The system cannot find the file specified)#
    #1.5#000F20FEA14B0053000000050000107800041D905205BD49#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at java.io.FileInputStream.open(Native Method)#
    #1.5#000F20FEA14B0053000000060000107800041D905205BDD6#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at java.io.FileInputStream.<init>(FileInputStream.java:106)#
    #1.5#000F20FEA14B0053000000070000107800041D905205BE3C#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.deploy.server.application.DeployUtilTransaction.uploadSAPPropertiesFile(DeployUtilTransaction.java:493)#
    #1.5#000F20FEA14B0053000000080000107800041D905205BEA4#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.deploy.server.application.DeployUtilTransaction.uploadSpecialEARFiles(DeployUtilTransaction.java:480)#
    #1.5#000F20FEA14B0053000000090000107800041D905205BF0B#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.deploy.server.application.DeployUtilTransaction.commonBegin(DeployUtilTransaction.java:320)#
    #1.5#000F20FEA14B00530000000A0000107800041D905205BF74#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.deploy.server.application.DeploymentTransaction.begin(DeploymentTransaction.java:296)#
    #1.5#000F20FEA14B00530000000B0000107800041D905205BFD8#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:304)#
    #1.5#000F20FEA14B00530000000C0000107800041D905205C03E#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:335)#
    #1.5#000F20FEA14B00530000000D0000107800041D905205C0A5#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.deploy.server.DeployServiceImpl.makeGlobalTransaction(DeployServiceImpl.java:3008)#
    #1.5#000F20FEA14B00530000000E0000107800041D905205C109#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.deploy.server.DeployServiceImpl.deploy(DeployServiceImpl.java:520)#
    #1.5#000F20FEA14B00530000000F0000107800041D905205C16C#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.deploy(DataSourceManagerImpl.java:253)#
    #1.5#000F20FEA14B0053000000100000107800041D905205C1E2#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.createDataSource(DataSourceManagerImpl.java:317)#
    #1.5#000F20FEA14B0053000000110000107800041D905205C248#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.dbpool.deploy.DataSourceManager_Stub.createDataSource(DataSourceManager_Stub.java:504)#
    #1.5#000F20FEA14B0053000000120000107800041D905205C2AC#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.CreateDataSource.<init>(CreateDataSource.java:50)#
    #1.5#000F20FEA14B0053000000130000107800041D905205C30D#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at jsp_Create1158405589640._jspService(jsp_Create1158405589640.java:11)#
    #1.5#000F20FEA14B0053000000140000107800041D905205C36F#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:467)#
    #1.5#000F20FEA14B0053000000150000107800041D905205C3D3#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:181)#
    #1.5#000F20FEA14B0053000000160000107800041D905205C436#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)#
    #1.5#000F20FEA14B0053000000170000107800041D905205C498#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)#
    #1.5#000F20FEA14B0053000000180000107800041D905205C4F9#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)#
    #1.5#000F20FEA14B0053000000190000107800041D905205C55A#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:337)#
    #1.5#000F20FEA14B00530000001A0000107800041D905205C5BB#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:315)#
    #1.5#000F20FEA14B00530000001B0000107800041D905205C61E#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:815)#
    #1.5#000F20FEA14B00530000001C0000107800041D905205C67F#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:238)#
    #1.5#000F20FEA14B00530000001D0000107800041D905205C6E1#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)#
    #1.5#000F20FEA14B00530000001E0000107800041D905205C751#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)#
    #1.5#000F20FEA14B00530000001F0000107800041D905205C7B8#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)#
    #1.5#000F20FEA14B0053000000200000107800041D905205C81C#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)#
    #1.5#000F20FEA14B0053000000210000107800041D905205C87F#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)#
    #1.5#000F20FEA14B0053000000220000107800041D905205C8DE#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at java.security.AccessController.doPrivileged(Native Method)#
    #1.5#000F20FEA14B0053000000230000107800041D905205C940#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)#
    #1.5#000F20FEA14B0053000000240000107800041D905205C9A1#1158405595437#System.err#sap.com/DataSourceSAPEAR#System.err#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###     at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:151)#
    #1.5#000F20FEA14B0053000000280000107800041D90520A54F1#1158405595734#com.sap.engine.services.dbpool.deploy.ContainerImpl#sap.com/DataSourceSAPEAR#com.sap.engine.services.dbpool.deploy.ContainerImpl#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error##Plain###ContainerImpl.startDataSources(): Cannot create DataSource: ds_venky. Reason: java.lang.ArrayIndexOutOfBoundsException: -1#
    #1.5#000F20FEA14B00530000002A0000107800041D90520A9B54#1158405595749#com.sap.engine.services.deploy#sap.com/DataSourceSAPEAR#com.sap.engine.services.deploy#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error#1#/System/Server#Java#deploy_5029##Exception in operation startApp with application sap.com/ds_venky.#2#startApp#sap.com/ds_venky#
    #1.5#000F20FEA14B00530000002B0000107800041D90520A9FA9#1158405595749#com.sap.engine.services.deploy#sap.com/DataSourceSAPEAR#com.sap.engine.services.deploy#Administrator#191#####SAPEngine_Application_Thread[impl:3]_8##0#0#Error#1#/System/Audit#Java###Exception #1#com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Exception in operation startApp with application sap.com/ds_venky.
    Any kind of help will be appreciated

    Hi,
    I have found the solution for this thread and have posted a blog on how to create data sources. Please find the link below
    /people/venkatesh.ramachandran/blog/2006/10/19/how-to-create-and-remove-data-source-on-sap-was-j2ee-engine-dynamically-through-java
    Regards,
    Venkatesh

  • [Help] Cannot create datasource in Mapviewer

    Hello. When I deploy MapViewer in OC4J standalone and log as oc4jadmin, i cannot create datasource for it. I edited mapViewerConfig.xml like this:
    <map_data_source name="kuba"
    jdbc_host="localhost"
    jdbc_sid="orcl"
    jdbc_port="1521"
    jdbc_user="kuba"
    jdbc_password="!BazaOracle1"
    jdbc_mode="thin"
    number_of_mappers="3"
    allow_jdbc_theme_based_foi="true"
    />
    After saving and restarting MapViewer, in datasource table there's no items. Any idea, what's wrong? Here's the log:
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig destroy
    FINER: destroying MapperConfig: connection manager, mapper pool and janitor t
    ad.
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperPool destroyAll
    WARNING: destroying ALL mapmaker instances.
    2010-12-02 12:05:19 oracle.lbs.mapserver.oms destroyMV
    WARNING: Oracle MapViewer shut down.
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig readVersion
    INFO: MapViewer server version: Ver11_B091229
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig loadConfigFile
    INFO: using default config file: D:\app\Kubix\product\11.2.0\dbhome_1\j2ee\ho
    applications\Map Viewer\web\WEB-INF\conf\mapViewerConfig.xml
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig checkSecuritySetti
    WARNING: dcsf:true
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.Dimmer startElement
    FINEST: found a datasource: kuba
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig scrambleConfigFile
    INFO: Passwords in the config file has been encrypted.
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig loadConfigFile
    FINER: Loading configuration file: D:\app\Kubix\product\11.2.0\dbhome_1\j2ee\
    e\applications\Map Viewer\web\WEB-INF\conf\mapViewerConfig.xml
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperPool destroyAll
    WARNING: destroying ALL mapmaker instances.
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig checkSecuritySetti
    WARNING: dcsf:true
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig setLoggingOptions
    INFO: Setting logging options for MapViewer
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig setLoggingOptions
    INFO: setting logging level to finest
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig loadMapViewerConfi
    FINEST:
    Allowed IPs:
    Excluded IPs:
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig registerNSDataProv
    rs
    FINEST: Non-Spatial Data Provider registered: defaultNSDP
    2010-12-02 12:05:19 oracle.sdovis.SDataProviderMgr registerProvider
    WARNING: Spatial Provider shapefileSDP is already registered.
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig registerSDataProvi
    s
    FINEST: Spatial Data Provider registered: shapefileSDP
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig loadMapViewerConfi
    FINEST: Data source kuba will get web user name from: J2EE_USER
    2010-12-02 12:05:19 oracle.sdovis.ds.NativeOracleDataSource <init>
    SEVERE: Connection Cache with this Cache Name already exists
    java.sql.SQLException: Connection Cache with this Cache Name already exists
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.j
    :138)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.j
    :175)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.j
    :240)
    at oracle.jdbc.pool.OracleConnectionCacheManager.createCache(OracleCo
    ctionCacheManager.java:188)
    at oracle.jdbc.pool.OracleDataSource.cacheInitialize(OracleDataSource
    va:301)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.j
    :284)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.j
    :179)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.j
    :159)
    at oracle.sdovis.ds.NativeOracleDataSource.<init>(NativeOracleDataSou
    .java:233)
    at oracle.sdovis.ds.DSManager.registerOracleJdbcDS(DSManager.java:122
    at oracle.lbs.mapserver.core.MapperConfig.createMappers(MapperConfig.
    a:797)
    at oracle.lbs.mapserver.core.MapperConfig.loadMapViewerConfig(MapperC
    ig.java:1572)
    at oracle.lbs.mapserver.core.MapperConfig.loadConfigFile(MapperConfig
    va:609)
    at oracle.lbs.mapserver.core.MapperConfig.<init>(MapperConfig.java:36
    at oracle.lbs.mapserver.MapServerImpl.<init>(MapServerImpl.java:131)
    at oracle.lbs.mapserver.MapServerImpl.<init>(MapServerImpl.java:115)
    at oracle.lbs.mapserver.oms$ColdStart.run(oms.java:300)
    at java.lang.Thread.run(Thread.java:662)
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig createMappers
    SEVERE: Error creating NativeOracleDataSource.
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig loadMapViewerConfi
    WARNING: MAPVIEWER-00011: Error creating a map data source.(kuba)
    2010-12-02 12:05:19 oracle.lbs.mapserver.core.MapperConfig loadConfigFile
    INFO: Map Recycling thread started.
    2010-12-02 12:05:19 oracle.lbs.mapserver.oms$ColdStart run
    INFO: *** Oracle MapViewer started. ***
    2010-12-02 12:05:20 oracle.lbs.mapcache.MapCacheServer restart
    INFO: Map cache server is restarted!
    2010-12-02 12:05:20 oracle.lbs.foi.FOIImageRecycleThread run
    FINE: FOI image recycle thread interrupted.
    2010-12-02 12:05:20 oracle.lbs.foi.FOIImageRecycleThread run
    FINE: FOI image recyle thread terminated.
    2010-12-02 12:05:20 oracle.lbs.foi.FOIServer init
    INFO: *** Oracle Feature of Interest (FOI) Server started. ***
    2010-12-02 12:05:20 oracle.lbs.foi.FOIImageRecycleThread run
    FINE: FOI image recycle thread interrupted.
    2010-12-02 12:05:20 oracle.lbs.foi.FOIImageRecycleThread run
    FINE: FOI image recyle thread terminated.
    10/12/02 12:05:20 Message:MAPVIEWER-00019: Specified data source does not exist.
    Thu Dec 02 12:05:20 CET 2010
    Severity: 0
    Description:
    10/12/02 12:05:20 Message:MAPVIEWER-00019: Specified data source does not exist.
    Thu Dec 02 12:05:20 CET 2010
    Severity: 0
    Description:
    10/12/02 12:05:21 Message:MAPVIEWER-00019: Specified data source does not exist.
    Thu Dec 02 12:05:21 CET 2010
    Severity: 0
    Description:

    Does restarting oc4j make any difference?

  • Cannot create datasource

    Hi all,
    i am new in data services.simply i am triyng to create a datasource.
    i clicked new and nothing.
    problem with installion or somethinh missed?

    i am using administrator user for bo..i have no problem about this user.(named user)
    i am also using sa user for repository and its ok.
    everytihng is ok but i cant create datasource.
    this botton doesnt work..

  • I cannot create a EntityManagerFactory with tomcat

    Hello everyone.
    I hope you could help me with some problem I'm having using persistence (with hibernate annotations) in my web applicacion.
    I have a method that receives some pojos to persist. The problem is that I cannot find a way to generate de entitymanagerFactory. whenever I try to do it, the method just finishes without giving any exception. This confuses me.
    My persistence.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
        http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
         <persistence-unit name="FlatFilePU" transaction-type="RESOURCE_LOCAL">
              <provider>org.hibernate.ejb.HibernatePersistence</provider>
              <non-jta-data-source>java:comp/env/l2bdomi</non-jta-data-source>
                <properties>
                   <property name = "hibernate.connection.driver_class" value = "oracle.jdbc.driver.OracleDriver"/>
                   <property name = "hibernate.connection.url" value = "jdbc:oracle:thin:@xx.xx.xx.xx:1521:xxxx"/>
                   <property name = "hibernate.connection.username" value = "xxxx"/>
                   <property name = "hibernate.connection.password" value = "xxxx"/>
                   <property name="hibernate.hbm2ddl.auto" value="update"/>
                   <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect"/>
                </properties> 
         </persistence-unit>
    </persistence>and the method that is failing:
    public void guardaLote(LoteDomiciliacion lote){
              try{
              System.out.println("1");
                                  //The following line is the last one that gets executed.
              EntityManagerFactory emf = Persistence.createEntityManagerFactory("FlatFilePU"); 
              EntityManager ent= emf.createEntityManager();
              System.out.println("2");
              ent.getTransaction().begin();
              System.out.println("3");
              loteDao.save(lote);
              System.out.println("4");
              ArrayList<LineaDomiciliacion> lineas=(ArrayList<LineaDomiciliacion>) lote.getLineas();
              Iterator<LineaDomiciliacion> i = lineas.iterator();
              while(i.hasNext()){
                   registroDao.save(i.next());
              System.out.println("5");
              ent.getTransaction().commit();
              ent.close();
              }catch(Exception e){
                   System.out.println("erro2");
                   e.printStackTrace();
         }extract from tomcat's server.xml:
    <GlobalNamingResources>
        <!-- Test entry for demonstration purposes -->
        <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
        <!-- Editable user database that can also be used by
             UserDatabaseRealm to authenticate users -->
        <Resource name="UserDatabase" auth="Container"
                  type="org.apache.catalina.UserDatabase"
           description="User database that can be updated and saved"
               factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
              <Resource name="masterPool" auth="Container" type="java.util.ArrayList" factory="uk.org.primrose.pool.datasource.MasterPoolDataSourceFactory" configFile="C:/Tomcat 5.5/conf/poolConfig.properties" description="Holds all the pools" />       
             <Resource name="l2bdomi"  auth="Container" type="uk.org.primrose.pool.datasource.PoolDataSource" description="The l2bdomi database pool" factory="uk.org.primrose.pool.datasource.PoolDataSourceFactory" poolName="l2bdomi" />
      </GlobalNamingResources>after EntityManagerFactory emf = Persistence.createEntityManagerFactory("FlatFilePU"); this method an the method that called it (in a servlet) finishes. The only thing that gets executed after that is a finally. I tried to catch Exception but I didnt get any.
    My guess is that the problem comes from the datasource configuration but Im not sure since I am new working with datasources.
    thank you for any help you can provide me.
    Edited by: santiagozky on Apr 13, 2009 2:48 PM

    Ok, I got some errors using a Junit test. I don´t know if these are valid since Im not under tomcat when using Junit.
    Anyway, here they are:
    java.lang.ExceptionInInitializerError
         at com.mit.persistencia.GuardaLote.guardaLote(GuardaLote.java:40)
         at com.mit.persistencia.GuardaLoteTest.testSave(GuardaLoteTest.java:87)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
         at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
         at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
         at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
         at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
         at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
         at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
         at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
         at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
         at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
         at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
         at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Caused by: javax.persistence.PersistenceException: org.hibernate.HibernateException: Could not find datasource
         at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:737)
         at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
         at com.mit.persistencia.EntityManagerHelper.<clinit>(EntityManagerHelper.java:20)
         ... 22 more
    Caused by: org.hibernate.HibernateException: Could not find datasource
         at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56)
         at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
         at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29)
         at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
         at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
         at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
         at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
         at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:730)
         ... 26 more
    Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.lookup(Unknown Source)
         at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
         ... 33 more

  • Cannot create datasource for MS SQL Server

    Hi,
    I'm trying to create a datasource for MS SQL server and I get this error
    Connection test failed.
    Login failed for user 'gdahan'. The user is not associated with a trusted SQL Server connection.
    com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Lcom.microsoft.sqlserver.jdbc.SQLServerConnection;Ljava.lang.Object;Ljava.lang.String;Lcom.microsoft.sqlserver.jdbc.StreamError;Z)V(Unknown Source)
    com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(Lcom.microsoft.sqlserver.jdbc.TDSReader;)V(Unknown Source)
    com.microsoft.sqlserver.jdbc.TDSParser.parse(Lcom.microsoft.sqlserver.jdbc.TDSReader;Lcom.microsoft.sqlserver.jdbc.TDSTokenHandler;)V(Unknown Source)
    com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon
    The database is in "Windows authentication" mode (not "SQL authentication") and I can connect to it through "Toad for MS SQL Server". In this case I don't need to specify any username or password because I'm already logged in as gdahan on my computer. But when I try to create the datasource I need a username and password. Is there any way to specify to the datasource that I want to connect via Authentication windows ?
    I tried with BEA MS SQL server driver and Microsoft SQL Server 2005 JDBC Driver 1.2[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Guillaume Dahan wrote:
    Hi,
    I'm trying to create a datasource for MS SQL server and I get this error
    Connection test failed.
    Login failed for user 'gdahan'. The user is not associated with a trusted SQL Server connection.
    com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Lcom.microsoft.sqlserver.jdbc.SQLServerConnection;Ljava.lang.Object;Ljava.lang.String;Lcom.microsoft.sqlserver.jdbc.StreamError;Z)V(Unknown Source)
    com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(Lcom.microsoft.sqlserver.jdbc.TDSReader;)V(Unknown Source)
    com.microsoft.sqlserver.jdbc.TDSParser.parse(Lcom.microsoft.sqlserver.jdbc.TDSReader;Lcom.microsoft.sqlserver.jdbc.TDSTokenHandler;)V(Unknown Source)
    com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon
    The database is in "Windows authentication" mode (not "SQL authentication") and I can connect to it through "Toad for MS SQL Server". In this case I don't need to specify any username or password because I'm already logged in as gdahan on my computer. But when I try to create the datasource I need a username and password. Is there any way to specify to the datasource that I want to connect via Authentication windows ?
    I tried with BEA MS SQL server driver and Microsoft SQL Server 2005 JDBC Driver 1.2[See the complete documentation for MS's JDBC driver
    for how/whether it can do Windows Authentication.
    This is completely at the driver level, not WebLogic,
    except that (of course) WebLogic would have to be
    running on Windows.
    Joe

  • Crystal Reports XI R2 - Cannot Create Datasource to SalesForce - Logon Fail

    I am the salesforce.com administrator for our company and wanted to utilize Crystal Reports.  However, whenever I try to create a data source connection to Salesforce.com within Crystal Reports XI R2 (with the latest Crystal Reports Report Pack for SalesForce.com installed), I receive the following error:
    Logon failed.
    Details: Please check your username and password.
    I'm using the following credentials: Server = www.salesforce.com, Salesforce UserID = my full salesforce userID, Salesforce password = my salesforce password.  Whenever I use the very same credentials to log directly into salesforce, I'm granted access.
    I've granted access to all Crystal Reports server IP address ranges as noted in another, but still have had no success.  Could this be a firewall related issue.  If so, does anyone know what ports and protocols need to be opened  (we have a hardware firewall solution in place)?
    Edited by: Chris Zumwalt on Nov 12, 2008 11:40 PM

    Hi Chris,
    You will be able to get more details of the logon error by logging onto salesforce.com and navigating to your user's properties page (Setup > My Personal Infomation > Personal Information).  At the bottom of this page, there's a history of your logon attempts.  It'll probably look like this:
    Login Time     Source IP     Login Type     Status
    12/11/2008 4:17:04 EST PM     127.0.0.1     Application     Success
    12/11/2008 4:16:49 EST PM     127.0.0.1     Partner Product     Failed: API security token required
    Crystal Reports is a Partner Product, and the status column will tell you the actual reason the logon failed.  Most likely it's the same reason as above: "API security token required".  Partner applications require that you login using the security token, or alternatively they are running on a machine with an IP that is in your Network Access whitelist.  Just because you can login to salesforce.com through the browser doesn't necessarily mean that it will work in Crystal Reports designer.
    Instructions on using the security token are [here|https://trust.salesforce.com/trust/security/identity_feature.html].
    To access Salesforce via a desktop application or other API-based application, you must replace your current password with a combination of your password and a security token:
    1 Log in to Salesforce via the browser to request your security token.
    2 Go to Setup -> My Personal Information -> Reset Security Token.
    3 Click the Reset Security Token button to trigger an email which will contain your security token.
    4 Select and copy the token from the email.
    5 In the application, replace your password with combination of the password and the security token. For example, if your password is "MyPassword" and your security token is "XXXXXX", you would enter "MyPasswordXXXXXX" into the password field.
    Hope this helps.
    Edited by: Charles Wilson on Nov 13, 2008 2:37 AM

  • Cannot create XA data source with MS SQL

    Hello,
    I am currently trying to create a datasource with he XA transactions support. The exception is the same when I'm using the SYSTEM_DRIVER (NetWeaver is using the MS SQL 2005) and when I'm using the user-defined MS SQL JDBC driver. The 'regular' (using tag <jdbc-1.x>) datasources are successfully created, the problem appears only for the XA one.
    This is the part of my data-sources.xml responsible for this data source:
    <data-source>
            <data-source-name>DataSource/SCP</data-source-name>
            <driver-name>SYSTEM_DRIVER</driver-name>
            <init-connections>5</init-connections>
            <max-connections>25</max-connections>
            <sql-engine>Vendor_SQL</sql-engine>
            <jdbc-2.0>
                <xads-class-name>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xads-class-name>
                <object-factory>com.microsoft.sqlserver.jdbc.SQLServerDataSourceObjectFactory</object-factory>
               <properties>
                    <property>
                        <property-name>serverName</property-name>
                        <property-value>localhost</property-value>
                    </property>
                    <property>
                        <property-name>databaseName</property-name>
                        <property-value>SCP</property-value>
                    </property>
                    <property>
                        <property-name>port</property-name>
                        <property-value>1433</property-value>
                    </property>
                    <property>
                        <property-name>user</property-name>
                        <property-value>myUser</property-value>
                    </property>
                    <property>
                        <property-name>password</property-name>
                        <property-value>myPassword<property-value>
                    </property>
                </properties>
            </jdbc-2.0>
        </data-source>
    Below you can see the stacktrace that appears in the defaultTrace_00.trc:
    Text: [ERROR CODE DPL.DS.5029] Exception in operation startApp with application se.sync/BPE.
    Reason : [ERROR CODE DPL.DS.5029] Exception in operation startApp with application se.sync/BPE.
    [EXCEPTION]
    com.sap.engine.services.deploy.exceptions.ServerDeploymentException: [ERROR CODE DPL.DS.5029] Exception in operation startApp with application se.sync/BPE.
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.rollbackPart(ApplicationTransaction.java:521)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:422)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:445)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.super_MakeAllPhases(ParallelAdapter.java:337)
         at com.sap.engine.services.deploy.server.application.StartTransaction.makeAllPhasesImpl(StartTransaction.java:550)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:251)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:392)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:3389)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:3375)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:3278)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:3251)
         at com.sap.engine.services.dc.lcm.impl.J2EELCMProcessor.doStart(J2EELCMProcessor.java:99)
         at com.sap.engine.services.dc.lcm.impl.LifeCycleManagerImpl.start(LifeCycleManagerImpl.java:62)
         at com.sap.engine.services.dc.cm.deploy.impl.LifeCycleManagerStartVisitor.visit(LifeCycleManagerStartVisitor.java:34)
         at com.sap.engine.services.dc.cm.deploy.impl.DeploymentItemImpl.accept(DeploymentItemImpl.java:83)
         at com.sap.engine.services.dc.cm.deploy.impl.DefaultDeployPostProcessor.postProcessLCMDeplItem(DefaultDeployPostProcessor.java:80)
         at com.sap.engine.services.dc.cm.deploy.impl.DefaultDeployPostProcessor.postProcess(DefaultDeployPostProcessor.java:56)
         at com.sap.engine.services.dc.cm.deploy.impl.DeployerImpl.doPostProcessing(DeployerImpl.java:741)
         at com.sap.engine.services.dc.cm.deploy.impl.DeployerImpl.performDeploy(DeployerImpl.java:732)
         at com.sap.engine.services.dc.cm.deploy.impl.DeployerImpl.doDeploy(DeployerImpl.java:576)
         at com.sap.engine.services.dc.cm.deploy.impl.DeployerImpl.deploy(DeployerImpl.java:270)
         at com.sap.engine.services.dc.cm.deploy.impl.DeployerImpl.deploy(DeployerImpl.java:192)
         at com.sap.engine.services.dc.cm.deploy.impl.DeployerImplp4_Skel.dispatch(DeployerImplp4_Skel.java:875)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)
         at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)
         at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)
         at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)
         at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:877)
         at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)
         at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)
         at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
         at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)
    Caused by: com.sap.engine.services.dbpool.exceptions.BaseDeploymentException: Cannot create DataSource "DataSource/SCP".
         at com.sap.engine.services.dbpool.deploy.ContainerImpl.startDataSources(ContainerImpl.java:1467)
         at com.sap.engine.services.dbpool.deploy.ContainerImpl.prepareStart(ContainerImpl.java:468)
         at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:219)
         at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:179)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:420)
         ... 30 more
    Caused by: java.lang.NullPointerException
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:164)
         at com.sap.engine.services.dbpool.deploy.ContainerImpl.startDataSources(ContainerImpl.java:1394)
         ... 34 more
    When I'm looking at the \usr\sap\EE5\J00\exe\mssjdbc\sqljdbc.jar file, I can see both these classes (SQLServerXADataSource and SQLServerDataSourceObjectFactory), so the problem is probably somewhere else. As the exception comes from the native method - does it mean, that the XA extension is not installed correctly on the server (as described [here|http://technet.microsoft.com/en-us/library/aa342335(SQL.90).aspx])?
    Thanks for any help!
    Best Regards,
    -Milosz

    Ok, just to share - the solution was as follows:
    remove the object-factory element
    change property name "port" to "portNumber"
    So, the correct data-sources.xml is as follows:
    <data-source>
         <data-source-name>DataSource/SCP</data-source-name>
         <driver-name>SYSTEM_DRIVER</driver-name>
         <init-connections>5</init-connections>
         <max-connections>25</max-connections>
         <sql-engine>Vendor_SQL</sql-engine>
         <jdbc-2.0>
             <xads-class-name>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xads-class-name>
             <properties>
                 <property>
                     <property-name>serverName</property-name>
                     <property-value>localhost</property-value>
                 </property>
                 <property>
                     <property-name>databaseName</property-name>
                     <property-value>SCP</property-value>
                 </property>
                 <property>
                     <property-name>portNumber</property-name>
                     <property-value>1433</property-value>
                 </property>
                 <property>
                     <property-name>user</property-name>
                     <property-value>myUser</property-value>
                 </property>
                 <property>
                     <property-name>password</property-name>
                     <property-value>myPassword<property-value>
                  </property>
             </properties>
         </jdbc-2.0>
    </data-source>
    And this works.

  • Unalbe to create DataSource in WAS

    Hi All,
    I am trying to create a DataSource to conenct to Orable DB using Visaul Administrator.
    I tried creating a Data Source per the guidelines mentioned on the Help Potral: http://help.sap.com/saphelp_nw04/helpdata/en/ab/082484173ae045ab8dad8a41d33da3/frameset.htm
    But when I try to save the details of the Data Source, it throws an expection saying Unable to Create Data Source. The nested exceptions are 'Remote Exceptions' & 'Server Deployment Exceptions', etc.
    Am I missing some configuration which is required before directly jumping to Data Source creation?
    Thanks in advance.
    -Vaibhav.

    Hi Vladimir,
    Thanks for replying. I've getting following Exception Stack Trace:
    [code]Java.rmi.RemoteException: Error occurred while starting application in whole cluster and wait.; nested exception is:
         com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Clusterwide execption: server ID 1212750:Cannot create DataSource "testDS".
         at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:679)
         at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:661)
         at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:562)
         at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.deploy(DataSourceManagerImpl.java:261)
         at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.createDataSource(DataSourceManagerImpl.java:317)
         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:324)
         at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
         at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
         at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
         at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
         at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:400)
         at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
         at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
         at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
         at com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:157)
         at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:220)
         at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:803)
         at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:102)
         at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
         at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:291)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    Caused by: com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Clusterwide execption: server ID 1212750:Cannot create DataSource "testDS".
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.sleepClientThread(ParallelAdapter.java:232)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:113)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:214)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4601)
         at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:677)
         ... 31 more[/code]
    In this case I was using SYSTEM_DRIVER. Now I've imported the Classes12.zip using Visual Administrator. Now I'm able to save the DataSource but unable to test the DataSource. How to test if the DS i've created is working or not?
    Thanks!
    -Vaibhav.

  • Creating datasource in visual Administrator

    Hi,
    i am trying to create a datasource from the  visual adminsitrator to connect to the mssql as backend,but it is giving the error as not able to connect and raising some exceptions.
    the properties i am specifying to the datasource is extracted from the following link
    http://help.sap.com/saphelp_webas630/helpdata/en/ab/082484173ae045ab8dad8a41d33da3/content.htm
    can any one of u tell me the solution to connect to the database, if u have given in the steps wise, it will be more helpful to me.
    u can tell me the steps from the startingi.e., total connections.
    Thanks & Regards,
    sireesha.

    the error is,
    ava.rmi.RemoteException: Error occurred while starting application in whole cluster and wait.; nested exception is:
         com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Clusterwide execption: server ID 1761750:Cannot create DataSource "first_dsn".
         at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:679)
         at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:661)
         at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:562)
         at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.deploy(DataSourceManagerImpl.java:261)
         at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.createDataSource(DataSourceManagerImpl.java:317)
         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:324)
         at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
         at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
         at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
         at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
         at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:400)
    kindly go through the error specified here,
    regards,
    sireesha.

  • Cannot create resource instance (Works on NetBeans/Tomcat)

    I have a project that works just fine in NetBeans w/ Tomcat but when I deploy it to Sun One Web Server 6.1 SP5 I get the following error:
    StandardWrapperValve[jsp]: WEB2792: Servlet.service() for servlet jsp threw exception
    javax.servlet.ServletException: Cannot create resource instance
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536)
         at jsps.index_jsp._jspService(_index_jsp.java:91)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:687)
         at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:459)
         at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
         at com.iplanet.ias.web.WebContainer.service(WebContainer.java:580)
    ----- Root Cause -----
    javax.naming.NamingException: Cannot create resource instance
         at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:167)
         at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:834)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
         at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at jsps.index_jsp._jspService(_index_jsp.java:79)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:687)
         at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:459)
         at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
         at com.iplanet.ias.web.WebContainer.service(WebContainer.java:580)
    I have the following in my in context.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/BOEnterpriseTest1">
    <Resource name="jdbc/dev10g" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@10.10.10.10:1521:dev" username="userid" password="pwd" maxActive="20" maxIdle="10" maxWait="-1"/>
    </Context>
    I have the following in my web.xml:
    <resource-ref>
    <description>jdbc:oracle:thin:@10..10.10.10:1521:dev</description>
    <res-ref-name>jdbc/dev10g</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    What�s missing on the Sun One server?

    I am trying to do a refresh of a Crystal Reports report in a JSP.
    Using the web.xml looking like:
    <resource-ref>
    <description>jdbc:oracle:thin:@10.10.
    10.10:1521:dev10g</description>
    <res-ref-name>jdbc/dev10g</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    and code in my JSP:
    <%
    InitialContext initContext = new InitialContext();
    DataSource source = (DataSource) initContext.lookup("java:comp/env/jdbc/dev10g");
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    try{
    DataSource ds = (DataSource)initCtx.lookup("Data");
    catch ( NamingException e ){
    DataSource ds = (DataSource) initContext.lookup("java:comp/env/jdbc/dev10g");
    initCtx.bind("Data", ds);     
    I get the following error:
    WEB2720: Error initializing naming context for context /BOEnterpriseTest1
         javax.naming.NameNotFoundException: WEB3885: Name Data is not bound in this Context
              at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
              at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
              at com.iplanet.ias.web.WebModule.verifyResType(WebModule.java:510)
              at com.iplanet.ias.web.WebModule.bindResources(WebModule.java:410)
              at com.iplanet.ias.web.WebModule.bindGlobalResourceRefs(WebModule.java:352)
              at com.iplanet.ias.web.WebModule.createNamingContext(WebModule.java:323)
              at org.apache.catalina.core.StandardContext.start(StandardContext.java:3718)
              at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
              at org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
              at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
              at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
              at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
              at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
              at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
    What steps do I need to do on the Server side or in my code?

  • Cannot create a session after the response has been committed (Tomcat 6)

    I'm getting a rather annoying error when I try to open a pretty basic JSP page.
    I'm rather new to the whole JSP scene, so I'm following the example found on pages 287 and onwards in "JSF in Action - Manning" in case anyone wanted to check my code against the source.
    I've searched for about 4 hours now, coming back to this site a couple of times, once reading about writeouts and stuff. But I'm not really sure this is the issue in this case and if it is, where exactly the problem lies.
    I've already fixed a number of errors I got (jtsl.jar and standard.jar missing etc...) but this particular problem is driving me (and my co-workers for that matter :-) ) up the wall.
    Anyone willing to help me out here?
    Error:
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Cannot create a session after the response has been committed
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
    root cause
    java.lang.IllegalStateException: Cannot create a session after the response has been committed
         org.apache.catalina.connector.Request.doGetSession(Request.java:2301)
         org.apache.catalina.connector.Request.getSession(Request.java:2075)
         org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
         org.apache.myfaces.context.servlet.SessionMap.setAttribute(SessionMap.java:53)
         org.apache.myfaces.util.AbstractAttributeMap.put(AbstractAttributeMap.java:103)
         org.apache.myfaces.util.AbstractAttributeMap.put(AbstractAttributeMap.java:35)
         org.apache.myfaces.application.jsp.JspStateManagerImpl.saveSerializedViewInServletSession(JspStateManagerImpl.java:523)
         org.apache.myfaces.application.jsp.JspStateManagerImpl.saveSerializedView(JspStateManagerImpl.java:358)
         javax.faces.application.StateManager.saveView(StateManager.java:47)
         org.apache.myfaces.application.jsp.JspViewHandlerImpl$StateMarkerAwareWriter.flushToWriter(JspViewHandlerImpl.java:387)
         org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:322)
         org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
         org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
    Source Code of login.jsp:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <f:view>
    <html>
    <head>
         <title>
              <h:outputText value="ProjectTrack"/>
         </title>
    </head>
         <body>
              <table>
                   <tr>
                        <td>
                             <h:graphicImage url="/images/logo Skillteam.jpg"
                             alt="Welcome to ProjectTrack"
                             title="Welcome to ProjectTrack"
                             width="435" height="120"/>
                        </td>
                   <td>
                        <font face="Arial, sans-serif"
                        size="6">
                        <h:outputText value="ProjectTrack"/>
                        </font>
                   </td>
                   </tr>
         http://forum.java.sun.com/post!default.jspa?forumID=45#
    Click for bold     </table>
         </body>
    </html>
    </f:view>
    web.xml & faces-config
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
         <display-name>ProjectTrack</display-name>
         <welcome-file-list>
         <welcome-file>faces/login.jsp</welcome-file>
         <welcome-file>index.html</welcome-file>
         </welcome-file-list>
         <servlet>
         <servlet-name>Faces Servlet</servlet-name>
         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
         <load-on-startup>1</load-on-startup>
         </servlet>
         <servlet-mapping>
         <servlet-name>Faces Servlet</servlet-name>
         <url-pattern>/faces/*</url-pattern>
         </servlet-mapping>
    </web-app>
    <?xml version="1.0"?>
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
    <faces-config>
         <navigation-rule>
              <from-view-id>/login.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>success</from-outcome>
                   <to-view-id>/inbox.jsp</to-view-id>
              </navigation-case>
              <navigation-case>
                   <from-outcome>failure</from-outcome>
                   <to-view-id>/login.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
    </faces-config>Setup:
    Eclipse Europe 3.3.0
    Tomcat 6.0.13
    MyFaces 1.2
    JRE 1.6.0_02

    When searching for this error, this was the first page google gave me. I found the answer and just in case anyone else stumbles in here with the same question I thought I'd share my findings.
    Unfortunately, if your problem is the same as mine, you're going to feel pretty silly. I was navigating to the wrong page. If MyFaces(when running tomcat) tries to resolve to a page that doesn't exist, the error given above is what happens.
    In my case I accidentally put my .jsp page into the wrong directory and ended up banging my head against the wall for an hour figuring that out. Hope this helps someone.

  • What's this?--Exception creating DataSource: org.hsql.jdbcDriver

    How to register the MS-SQL Server2000 DataSource in Tomcat4.04?
    Hi friends,
         I only have the MS SQL Server 2000 Database,and prog with jsp and Tomcat.
    Since the MS issue their JDBC Driver for SQL Server,I always use "DriverManager"
    to get the database connection,
    eg:
         Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
         Connection conn = DriverManager.getConnection
    ("jdbc:microsoft:sqlserver://server1:1433","username","password");
    Now I want to use "DataSource" to get connection in my prog,and I know it is necessary to register the DataSouce with JNDI in Tomcat before I can use it.
    But how to register and use the SQL Server DataSource in Tomcat4.04? I had tried some times and all failed,tomcat throws a exception like this:"javax.servlet.ServletException: Exception creating DataSource: org.hsql.jdbcDriver"
    what is "org.hsql.jdbcDriver"? may be it is tomcat's build in,but how can make my sql server driver work?
         Any Commnet Will Be Appreicate!
    ----Below is my fail trail when try to config the Tomcat--------------------
    Fellow the Tomcat's document,I modify the
    "$CATALINA_HOME/conf/server.xml" like this.
    <Context path="/MySite" docBase ="MySite" debug = "0" privileged = "true">
    <Resource name="jdbc/pubsDb" auth="Container"
    type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/pubsDb">
    <parameter>
              <name>user</name>
              <value>LJS</value>
         </parameter>
         <parameter>
              <name>password</name>
              <value>121212</value>
         </parameter>
    <parameter>
              <name>driverClassName</name>
    <value>com.microsoft.jdbcx.sqlserver.SQLServerDriver</value>
    </parameter>
    <parameter>
    <name>driverName</name>
    <value>jdbc:microsoft:sqlserver://localhost:1433/pubs</value>
    </parameter>
    </ResourceParams>     
    </Context>
    PS: the MSSQL Sever2000 has installed and had a user named "LJS" which password is 121212
    and default database is "pubs".
    Then,I modified the $CATALINA_HOME/webapps/MySite/WEB-INF/web.xml like this
         <resource-ref>
              <description>
                   Resource reference to a factory for java.sql.Connection
                   instances that may be used for talking to a particular
                   database that is configured in the server.xml file.
              </description>
              <res-ref-name>
                   jdbc/pubsDB
              </res-ref-name>
              <res-type>
                   javax.sql.DataSource
              </res-type>
              <res-auth>
                   Container
              </res-auth>
         </resource-ref>     
    finally I code a DB.jsp like this
    <%@ page content="text/html"%>
    <%@ page import="java.sql.*,javax.sql.*,java.naming.*"%>
    <%
         Context ctx = new InitialContext();
         DataSource ds = (DataSource)(new InitialContext().lookup("java:comp/env/jdbc/pubsDB"));
    %>
         after all done, I launch the Tomcat 4.0 and type "http://localhost:8080/MySite/DS.jsp" in
    my browser.
         then Tomcat throw exception like this:
    javax.servlet.ServletException: Exception creating DataSource: org.hsql.jdbcDriver
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
         at org.apache.jsp.DS$jsp._jspService(DS$jsp.java:83)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:484)
    root cause
    javax.naming.NamingException: Exception creating DataSource: org.hsql.jdbcDriver
         at
    org.apache.naming.factory.TyrexDataSourceFactory.getObjectInstance(TyrexDataSourceFactory.java:233)
         at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:165)
         at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:835)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
         at org.apache.jsp.DS$jsp._jspService(DS$jsp.java:70)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:484)

    Hi,
    don't know if you've already found a solution to this problem. Anyway, I had the same problem and the cause turned out to be a non-valid server.xml file.
    Here is my (working) server.xml:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!-- Example Server Configuration File --><!-- Note that component elements are nested corresponding to their
    parent-child relationships with each other --><!-- A "Server" is a singleton element that represents the entire JVM,
    which may contain one or more "Service" instances. The Server
    listens for a shutdown command on the indicated port.
    Note: A "Server" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    --><Server debug="0" name="TestServer" port="8005" shutdown="SHUTDOWN">
    <!-- A "Service" is a collection of one or more "Connectors" that share
    a single "Container" (and therefore the web applications visible
    within that Container). Normally, that Container is an "Engine",
    but this is not required.
    Note: A "Service" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <!-- Define the Tomcat Stand-Alone Service -->
    <Service name="Tomcat-Standalone">
    <!-- A "Connector" represents an endpoint by which requests are received
    and responses are returned. Each Connector passes requests on to the
    associated "Container" (normally an Engine) for processing.
    By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
    You can also enable an SSL HTTP/1.1 Connector on port 8443 by
    following the instructions below and uncommenting the second Connector
    entry. SSL support requires the following steps:
    * Download and install JSSE 1.0.2 or later, and put the JAR files
    into "$JAVA_HOME/jre/lib/ext".
    * Edit "$JAVA_HOME/jre/lib/security/java.security" and add
    security.provider.2=com.sun.net.ssl.internal.ssl.Provider
    * Execute: keytool -genkey -alias tomcat -keyalg RSA
    with a password value of "changeit".
    By default, DNS lookups are enabled when a web application calls
    request.getRemoteHost(). This can have an adverse impact on
    performance, so you can disable it by setting the
    "enableLookups" attribute to "false". When DNS lookups are disabled,
    request.getRemoteHost() will return the String version of the
    IP address of the remote client.
    -->
    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector acceptCount="10" className="org.apache.catalina.connector.http.HttpConnector" connectionTimeout="60000" debug="0" enableLookups="true" maxProcessors="75" minProcessors="5" port="8080" redirectPort="8443"/>
    <!-- Note : To disable connection timeouts, set connectionTimeout value
    to -1 -->
    <!-- Define an SSL HTTP/1.1 Connector on port 8443 -->
    <!--
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
    port="8443" minProcessors="5" maxProcessors="75"
    enableLookups="true"
         acceptCount="10" debug="0" scheme="https" secure="true">
    <Factory className="org.apache.catalina.net.SSLServerSocketFactory"
    clientAuth="false" protocol="TLS"/>
    </Connector>
    -->
    <!-- Define a Proxied HTTP/1.1 Connector on port 8081 -->
    <!-- See proxy documentation for more information about using this. -->
    <!--
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
    port="8081" minProcessors="5" maxProcessors="75"
    enableLookups="true"
    acceptCount="10" debug="0" connectionTimeout="60000"
    proxyPort="80"/>
    -->
    <!-- Define a non-SSL HTTP/1.0 Test Connector on port 8082 -->
    <!--
    <Connector className="org.apache.catalina.connector.http10.HttpConnector"
    port="8082" minProcessors="5" maxProcessors="75"
    enableLookups="true" redirectPort="8443"
    acceptCount="10" debug="0"/>
    -->
    <!-- An Engine represents the entry point (within Catalina) that processes
    every request. The Engine implementation for Tomcat stand alone
    analyzes the HTTP headers included with the request, and passes them
    on to the appropriate Host (virtual host). -->
    <!-- Define the top level container in our container hierarchy -->
    <Engine debug="0" defaultHost="localhost" name="Standalone">
    <!-- The request dumper valve dumps useful debugging information about
    the request headers and cookies that were received, and the response
    headers and cookies that were sent, for all requests received by
    this instance of Tomcat. If you care only about requests to a
    particular virtual host, or a particular application, nest this
    element inside the corresponding <Host> or <Context> entry instead.
    For a similar mechanism that is portable to all Servlet 2.3
    containers, check out the "RequestDumperFilter" Filter in the
    example application (the source for this filter may be found in
    "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
    Request dumping is disabled by default. Uncomment the following
    element to enable it. -->
    <!--
    <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
    -->
    <!-- Global logger unless overridden at lower levels -->
    <Logger className="org.apache.catalina.logger.FileLogger" prefix="catalina_log." suffix=".txt" timestamp="true"/>
    <!-- Because this Realm is here, an instance will be shared globally -->
    <Realm className="org.apache.catalina.realm.MemoryRealm"/>
    <!-- Define the default virtual host -->
    <Host appBase="webapps" debug="0" name="localhost" unpackWARs="true">
    <!-- Normally, users must authenticate themselves to each web app
    individually. Uncomment the following entry if you would like
    a user to be authenticated the first time they encounter a
    resource protected by a security constraint, and then have that
    user identity maintained across all web applications contained
    in this virtual host. -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn"
    debug="0"/>
    -->
    <!-- Access log processes all requests for this virtual host. By
    default, log files are created in the "logs" directory relative to
    $CATALINA_HOME. If you wish, you can specify a different
    directory with the "directory" attribute. Specify either a relative
    (to $CATALINA_HOME) or absolute path to the desired directory.
    -->
    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="common" prefix="localhost_access_log." suffix=".txt"/>
    <!-- Logger shared by all Contexts related to this virtual host. By
    default (when using FileLogger), log files are created in the "logs"
    directory relative to $CATALINA_HOME. If you wish, you can specify
    a different directory with the "directory" attribute. Specify either a
    relative (to $CATALINA_HOME) or absolute path to the desired
    directory.-->
    <Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="localhost_log." suffix=".txt" timestamp="true"/>
    <!-- Define properties for each web application. This is only needed
    if you want to set non-default properties, or have web application
    document roots in places other than the virtual host's appBase
    directory. -->
    <!-- Tomcat Root Context -->
    <!--
    <Context path="" docBase="ROOT" debug="0"/>
    -->
    <Context docBase="D:\Program Files\IBM\WebSphere Studio\workspaces\Test\StudentWEB\Web Content"
                   path="/StudentWEB"
                   reloadable="true"
                   source="com.ibm.etools.webtools.server:StudentWEB">
                   <Logger className="org.apache.catalina.logger.FileLogger"
         prefix="localhost_DBTest_log." suffix=".txt"
         timestamp="true"/>
                   <Resource name="jdbc/TestDB"
              auth="Container"
    type="javax.sql.DataSource"/>
                   <ResourceParams name="jdbc/TestDB">
                   <parameter>
                        <name>factory</name>
                        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                   </parameter>
                   <!-- Maximum number of dB connections in pool. Make sure you
              configure your mysqld max_connections large enough to handle
              all of your db connections. Set to 0 for no limit.
              -->
                   <parameter>
                        <name>maxActive</name>
                        <value>100</value>
                   </parameter>
                   <!-- Maximum number of idle dB connections to retain in pool.
              Set to 0 for no limit.
              -->
                   <parameter>
                        <name>maxIdle</name>
                        <value>30</value>
                   </parameter>
                   <!-- Maximum time to wait for a dB connection to become available
              in ms, in this example 10 seconds. An Exception is thrown if
              this timeout is exceeded. Set to -1 to wait indefinitely.
              -->
                   <parameter>
                        <name>maxWait</name>
                        <value>10000</value>
                   </parameter>
                   <!-- MySQL dB username and password for dB connections -->
                   <parameter>
                        <name>username</name>
                        <value>admin</value>
                   </parameter>
                   <parameter>
                        <name>password</name>
                        <value>admin</value>
                   </parameter>
                   <!-- Class name for mm.mysql JDBC driver -->
                   <parameter>
                        <name>driverClassName</name>
                        <value>org.gjt.mm.mysql.Driver</value>
                   </parameter>
                   <!-- The JDBC connection url for connecting to your MySQL dB.
              The autoReconnect=true argument to the url makes sure that the
              mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
              connection. mysqld by default closes idle connections after 8 hours.
              -->
                   <parameter>
                        <name>url</name>
                        <value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
                   </parameter>
                   </ResourceParams>
         </Context>
    </Host>
    </Engine>
    </Service>
    <!-- The MOD_WEBAPP connector is used to connect Apache 1.3 with Tomcat 4.0
    as its servlet container. Please read the README.txt file coming with
    the WebApp Module distribution on how to build it.
    (Or check out the "jakarta-tomcat-connectors/webapp" CVS repository)
    To configure the Apache side, you must ensure that you have the
    "ServerName" and "Port" directives defined in "httpd.conf". Then,
    lines like these to the bottom of your "httpd.conf" file:
    LoadModule webapp_module libexec/mod_webapp.so
    WebAppConnection warpConnection warp localhost:8008
    WebAppDeploy examples warpConnection /examples/
    The next time you restart Apache (after restarting Tomcat, if needed)
    the connection will be established, and all applications you make
    visible via "WebAppDeploy" directives can be accessed through Apache.
    -->
    <!-- Define an Apache-Connector Service -->
    <Service name="Tomcat-Apache">
    <Connector acceptCount="10" className="org.apache.catalina.connector.warp.WarpConnector" debug="0" enableLookups="true" maxProcessors="75" minProcessors="5" port="8008"/>
    <!-- Replace "localhost" with what your Apache "ServerName" is set to -->
    <Engine appBase="webapps" className="org.apache.catalina.connector.warp.WarpEngine" debug="0" name="Apache">
    <!-- Global logger unless overridden at lower levels -->
    <Logger className="org.apache.catalina.logger.FileLogger" prefix="apache_log." suffix=".txt" timestamp="true"/>
    <!-- Because this Realm is here, an instance will be shared globally -->
    <Realm className="org.apache.catalina.realm.MemoryRealm"/>
    </Engine>
    </Service>
    </Server>
    My web.xml looks like this:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <description>MySQL Test App</description>
    <servlet>
         <servlet-name>TestServlet</servlet-name>
         <display-name>TestServlet</display-name>
         <servlet-class>TestServlet</servlet-class>
    </servlet>
    <servlet-mapping>
         <servlet-name>TestServlet</servlet-name>
         <url-pattern>/TestServlet</url-pattern>
    </servlet-mapping>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/TestDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    You can of course leave out the comments if you want...
    Please let me know if this works on [email protected].
    Kind regards,
    Johan

  • Tomcat - MySQL - Cannot create resource instance

    I keep getting an error when trying to lookup my JNDI name. I know that this name is bound to a Context because I can list the bindings
    Context initCtx = new InitialContext();
    NamingEnumeration enum = initCtx.listBindings("java:comp/env/jdbc");
    while (enum.hasMoreElements()) {
    System.out.println(enum.nextElement().toString());
    And sure enough the name of my database I added through the console appears. However, I keep getting this error:
    javax.naming.NamingException: Cannot create resource instance
    on this second line of code
    Context ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/ArgonautDB");
    My MySQL Connector jar file is in $CATALINA_HOME/common/lib and I believe my server.xml settings are correct because I added this Data Source to the context through the console and the web.xml file should be simple...nevertheless I still get this error.
    Any suggestions on where I else I can turn. Pulling my precious few last hairs out here....

    Thank you very much. That did the trick. Actually what did the trick was to reinstall tomcat with the standard installation, NOT the LE installation which doesn't include the dbcp jar files needed for connecting to a database - but you were right about missing those.
    I was dissapointed in Tomcat's documentation of this issue. I would have thought that something that has to have caused other developers problems like this would have been documented somewhere more pronounced (if at all) on Tomcat's site.
    For those other newbies out there who don't want to pull out your hair...here is a summary of the steps I took to remedy this problem.
    1) Install the latest version of Tomcat. Do NOT install the LE version, it does not include the neccessary library files to connect to a database (commons-dbcp.jar and commons-pool.jar).
    2) Download the latest mysql connector library from http://www.mysql.com/downloads/mysqlcc.html. Once you have extracted the tar file, there will be some directories, a README file, a couple other text files and a jar file named mysql-connector-java-VERSION-stable-bin.jar. Move the mysql-connector-java-VERSION-stable-bin.jar file to $CATALINA_HOME/common/lib.
    3) Follow the instructions on http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    to create a test database, a test jsp file and a test class to access the database.

  • Tomcat 6.0.18, Cannot create JDBC driver of class '' for connect URL 'null'

    hi,
    I have searched through the web, none of the solution works for me. Hope I could get some suggestion from you.
    I am running tomcat 6.0.18 + eclipse 3.4.1 + jre 1.6 + jsp + jsf + mysql 5.0 on Ubuntu 8.10.
    The <GlobalNamingResources> configuration of TOMCAT_HOME/conf/server.xml
    <GlobalNamingResources>
        <!-- Editable user database that can also be used by
             UserDatabaseRealm to authenticate users
        -->
        <Resource name="UserDatabase" auth="Container"
                  type="org.apache.catalina.UserDatabase"
                  description="User database that can be updated and saved"
                  factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
                  pathname="conf/tomcat-users.xml" />
    <Resource name="jdbc/db" auth="Container"
    type="javax.sql.DataSource"
    factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/db?autoReconnect=true"
    username="xxx"
    password="xxx"
    maxActive="20"
    maxIdle="10"
    poolPreparedStatements="true" />
      </GlobalNamingResources>TOMCAT_HOME/conf/context.xml
    <Context>
        <!-- Default set of monitored resources -->
        <WatchedResource>WEB-INF/web.xml</WatchedResource>
        <!-- Uncomment this to disable session persistence across Tomcat restarts -->
        <!--
        <Manager pathname="" />
        -->
        <!-- Uncomment this to enable Comet connection tacking (provides events
             on session expiration as well as webapp lifecycle) -->
        <!--
        <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
        -->
    <ResourceLink global="jdbc/db" name="jdbc/db" type="javax.sql.DataSource"/>                
    </Context>An additional context.xml at eclipse'sworkspace/MyApplication/WebContent/META-INF
    <?xml version="1.0" encoding="UTF-8"?>
    <Context>
    <ResourceLink global="jdbc/db" name="jdbc/db" type="javax.sql.DataSource"/>                  
    </Context>web.xml of my application
      <resource-ref>
          <description>DB Connection</description>
          <res-ref-name>jdbc/db</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
      </resource-ref>This is the current configuration of the application, before this, I have followed the guidance of:
    [Apache Tomcat 6.0 JNDI Datasource HOW-TO|http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations]
    and all the solutions from
    [Cannot create JDBC driver of class..|http://www.theserverside.com/discussions/thread.tss?thread_id=25459]
    Please advice, what's going wrong?

    hi,
    I have searched through the web, none of the solution works for me. Hope I could get some suggestion from you.
    I am running tomcat 6.0.18 + eclipse 3.4.1 + jre 1.6 + jsp + jsf + mysql 5.0 on Ubuntu 8.10.
    The <GlobalNamingResources> configuration of TOMCAT_HOME/conf/server.xml
    <GlobalNamingResources>
        <!-- Editable user database that can also be used by
             UserDatabaseRealm to authenticate users
        -->
        <Resource name="UserDatabase" auth="Container"
                  type="org.apache.catalina.UserDatabase"
                  description="User database that can be updated and saved"
                  factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
                  pathname="conf/tomcat-users.xml" />
    <Resource name="jdbc/db" auth="Container"
    type="javax.sql.DataSource"
    factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/db?autoReconnect=true"
    username="xxx"
    password="xxx"
    maxActive="20"
    maxIdle="10"
    poolPreparedStatements="true" />
      </GlobalNamingResources>TOMCAT_HOME/conf/context.xml
    <Context>
        <!-- Default set of monitored resources -->
        <WatchedResource>WEB-INF/web.xml</WatchedResource>
        <!-- Uncomment this to disable session persistence across Tomcat restarts -->
        <!--
        <Manager pathname="" />
        -->
        <!-- Uncomment this to enable Comet connection tacking (provides events
             on session expiration as well as webapp lifecycle) -->
        <!--
        <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
        -->
    <ResourceLink global="jdbc/db" name="jdbc/db" type="javax.sql.DataSource"/>                
    </Context>An additional context.xml at eclipse'sworkspace/MyApplication/WebContent/META-INF
    <?xml version="1.0" encoding="UTF-8"?>
    <Context>
    <ResourceLink global="jdbc/db" name="jdbc/db" type="javax.sql.DataSource"/>                  
    </Context>web.xml of my application
      <resource-ref>
          <description>DB Connection</description>
          <res-ref-name>jdbc/db</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
      </resource-ref>This is the current configuration of the application, before this, I have followed the guidance of:
    [Apache Tomcat 6.0 JNDI Datasource HOW-TO|http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations]
    and all the solutions from
    [Cannot create JDBC driver of class..|http://www.theserverside.com/discussions/thread.tss?thread_id=25459]
    Please advice, what's going wrong?

Maybe you are looking for

  • IPhoto Time/Date Change problem

    There is one particular event in my iPhoto program that registered the wrong date when downloaded.  In trying to change it, the program automatically sets the date about 130 years earlier, regardless of what date I type in.  It only happens with this

  • Change the stock quantity!!

    Hi Is ther any fm for changing the HU Quantity . I tried using HUINV_ITEM_CHANGE , doesn't seems to be working.. pls help Regards Gunjan

  • No item category exists (Table T184L HID  V )

    HI ALL GETTING THIS ERROR WHEN CARRYING OUT MIGO FOR INBOUND DELIVERY. PLEASE GUIDE REGARDS REDDY

  • FDM in EPMA 64 bit

    Hi all, I was trying to install FDM in the same machine where EPMA 64bit is installed, but installer didnt permit to proceed with the installation. Oracle compatibility matrix doc also says that its not possible to install FDM/HSF (32bit) in the same

  • Uninstall MobileMe control panel for windows

    Hi I saw a post from turingtest2 Re: MobileMe Services has stopped working in Windows.  Feb 8, 2014 5:58 PM (in response to AKAJEF) on:  MobileMe is a discontinued service and the control panel should be removed if still present. Not doing so could c