Menu

Error While creating tyrex Datasource(MS SQL)

Help
2002-11-01
2003-09-04
  • Khurram M Khokhar

    I hav configured tyrex with tomcat 4.1.12 but getting exception whle getting datasource i.e

    Could not get DataSource : 29_10ds   javax.naming.NamingException: Exception creating Tyrex Resource: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Could not find stored procedure 'master..xp_jdbc_open'.

    tyrex domain file is

    <domain>
    <name>k29</name>
      <maximum>50</maximum>
      <timeout>120</timeout>
      <resources>
        <dataSource>
          <name>k297_10ds</name>
          <jar>C:\_JavaJars\mssqlserver.jar</jar>
          <class>com.microsoft.jdbcx.sqlserver.SQLServerDataSource</class>
          <config>
            <user>sa</user>
            <password></password>
            <serverName>projectserver</serverName>
            <portNumber>1433</portNumber>
            <databaseName>acbcf</databaseName>
            <selectMethod>cursor</selectMethod>
          </config>
          <limits>
            <maximum>50</maximum>
            <minimum>5</minimum>
            <initial>5</initial>
            <maxRetain>300</maxRetain>
            <timeout>10</timeout>
          </limits>
        </dataSource>
      </resources>
    </domain>

    any suggestions what might be the error in my configuration.

     
    • Khurram M Khokhar

      One More thing if i create a stored procedure in master database of sql server with name 'xp_jdbc_open' and write down a query which atleast effect one row witgout any error if query executed more then once in that stored procedure then i m not getting any error but i m unable to underatand the reason why its happening and with mysql database its giving me NULL poinyter exception on each step that is

      java.lang.NullPointerException
          at com.mysql.jdbc.xa.XAConnectionImpl.getUnderlying(Unknown Source)
          at com.mysql.jdbc.xa.ClientConnection.getUnderlying(Unknown Source)
          at com.mysql.jdbc.xa.ClientConnection.getMetaData(Unknown Source)
          at com.ablecommerce.acb.db.AcbDatabase.getDBMSName(AcbDatabase.java:210)
          at com.ablecommerce.acb.util.AcbShared.updateMasterInfo(AcbShared.java:1200)
          at org.apache.jsp.masterDatasource_jsp._jspService(masterDatasource_jsp.java:95)
          at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
          at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
          at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
          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:260)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
          at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
          at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
          at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
          at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
          at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
          at java.lang.Thread.run(Thread.java:484)

      That is becoming a big head ach for me :)

      i want to know the reason of this behaviour of Tyrex 1.0.

       
      • Anonymous

        Anonymous - 2003-04-29

        Hi,

        I also face the same problem, but I am using MYSQL 4.0.

        I actually follow the sample in Tomcat 4.1 but the Tomcat throw exception

        Below is the exception message.

        Starting Tyrex  Version 1.0
        Intalio Inc. (C) 1999-2001. All rights reserved.

        TyrexResourceFactory:  Cannot create Tyrex Resource, Exception
        java.lang.NullPointerException
                at org.apache.naming.factory.TyrexResourceFactory.getObjectInstance(Tyre
        xResourceFactory.java:140)
                at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceF
        actory.java:186)

        Server.xml
                  <Environment name="tyrexDomainConfig" type="java.lang.String" value="domain.xml"/>
                  <Environment name="tyrexDomainName" type="java.lang.String" value="myDomain"/>

                  <Resource name="my-datasource" auth="Container" type="tyrex.resource.Resource"/>
                  <ResourceParams name="my-datasource">
                    <parameter><name>name</name><value>myDataSource</value></parameter>
                  </ResourceParams>

        domain.xml

        <domain>
          <name>myDomain</name>
          <maximum>50</maximum>
          <timeout>120</timeout>
          <resources>
            <dataSource>
              <name>myDatasource</name>
              <jar>C:/jakarta-tomcat-4.1.18-1/common/lib/mm.mysql-2.0.14-bin.jar</jar>
              <class>org.gjt.mm.mysql.jdbc2.optional.MysqlXaDataSource</class>
              <config>
                <user>root</user>
                <password></password>
                <serverName>dhl-pc5</serverName>
                <port>3306</port>
                <database>innodbtest</database>
              </config>
              <limits>
                <maximum>50</maximum>
                <minimum>5</minimum>
                <initial>5</initial>
                <maxRetain>300</maxRetain>
                <timeout>20</timeout>
              </limits>
            </dataSource>
          </resources>
        </domain>

        2nd Question:

        I have compare Tyrex and Tomcat documentation as below:
        The configuration for domain.xml in

        Tyrex:

              <config>
                <!-- Configuration for SybXADataSource -->
                <user>arkin</user>
                <password>secret</password>
                <serverName>tyrex.exolab.org</serverName>
                <postNumber>4100</portNumber>
              </config>

        Tomcat :

              <config>
                <user>david</user>
                <password>secret</password>
                <serverName>localhost</serverName>
                <port>3306</port>
                <database>daviddb</database>
              </config>

        In Tomcat additional tag <database>daviddb</database> found, but the server to exception. The error message
        as
        "org.apache.jasper.JasperException: Exception creating Tyrex Resource: Could not create TransactionDomain: unable to find FieldDescriptor for 'database' in ClassDescriptor of mysqlXaDataSource"

        should I i use <database> tag?

        or wrong version of jars?

         
        • Anonymous

          Anonymous - 2003-09-04

          Hi, 

          It seems that these two value should be same.

          server.xml
          <parameter><name>name</name><value>myDataSource</value></parameter>

          domain.xml
          <name>myDatasource</name>

          and

          We must use <databaseName> tag instead of <database> tag at MySQL JDBC Driver(it has setDatabaseName() method).

          I'm sorry about my poor English.

           

Log in to post a comment.