3 Replies Latest reply on Oct 7, 2002 7:19 PM by jasonbrome

    Jboss doesn't find database table

    d97adka

      Hi
      I created one Entity CMP bean and when I run it I get:
      09:11:24,926 ERROR [JDBCCommand] Exception caught executing SQL
      java.sql.SQLException: Table not found: DBO.TBLPATIENT in statement [SELECT COUN
      T(*) FROM dbo.tblPatient WHERE strID='7507210735']
      at org.hsqldb.Trace.getError(Trace.java:180)
      at org.hsqldb.Result.(Result.java:175)
      at org.hsqldb.jdbcConnection.executeHSQL(jdbcConnection.java:907)
      ...etc
      Obviously it doesn't find my table. I defined table in jaws.xml with:
      <table-name>dbo.tblPatient</table-name>

      i use SQLServer2000 with Microsoft JDBC driver.
      I also defined:



      <config-property name="ConnectionURL" type="java.lang.String">jdbc:microsoft:sqlserver://myServer:1433;DatabaseName=MyDatabase</config-property>
      <config-property name="DriverClass" type="java.lang.String">com.microsoft.jdbc.sqlserver.SQLServerDriver</config-property>
      <!--set these only if you want only default logins, not through JAAS-->
      <config-property name="UserName" type="java.lang.String"></config-property>
      <config-property name="Password" type="java.lang.String"></config-property>



      in the mssql-service.xml and

      <application-policy name = "MSSQLDbRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
      <module-option name = "principal">sa</module-option>
      <module-option name = "userName">sa</module-option>
      <module-option name = "password">mypass</module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=JndiHospitalDataSource</module-option>
      </login-module>

      </application-policy>

      in login-config.xml


      Now I don't know what to do any more.
      Anyone with some ideas. ???
      Please...
      Adis

        • 1. Re: Jboss doesn't find database table
          d97adka

          I think that it runs configuration from
          hssqldb-service.xml

          in stead of

          mssql-service.xml

          How can I tell Jboss to use the second one??

          Adis ..again

          • 2. Re: Jboss doesn't find database table
            bingbing

            I encountered the exactly same error.
            I added the mysql-service.xml into jboss
            -service.xml. But when jboss start up, it give
            an [ERROR] about mysql data source and when I
            run client program, get the exact same error.
            If you figure it out, can you email me at
            ziyue@ucla.edu

            thanks,
            sophia

            • 3. Re: Jboss doesn't find database table
              jasonbrome

              Sounds like there might be an issue with your deployment descriptors - check out your ejb-jar.xml and jboss.xml, and ensure that the resources references are correctly defined.

              It looks like it is dropping through and using the default datasource (Hssql). If you go to the jmx console (e.g http://localhost:8080/jmx-console if you are running JBoss locally), and run the JNDI viewer, you'll be able to ensure that the MS SQL datasource has been initialized and bound to JNDI.

              Jason