2 Replies Latest reply on Sep 19, 2001 7:45 PM by Norm Nicholson

    Please help: JBoss cannot find my cloudscape tables

    José Manuel Rodriguez Newbie

      Hi,

      I'm using JBoss-2.4.0_Tomcat-3.2.3 and Cloudscape 3.6.4. All the tables are created and filled with data, but when I call the ejb I get the following error message:

      [Site] TRANSACTION ROLLBACK EXCEPTION:Error executing SQL SELECT NAME FROM SITE: java.sql.SQLException: Table not found: SITE in statement [SELECT NAME FROM SITE];

      To use JBoss with Cloudscape I made the following changes to

      JBoss-2.4.0_Tomcat-3.2.3\jboss\conf\tomcat\jboss.jcml


      org.hsql.jdbcDriver,org.enhydra.instantdb.jdbc.idbDriver,COM.cloudscape.core.JDBCDriver


      and


      DataSource
      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

      jdbc:cloudscape:D:/cloudscape/database
      ...

      In JBoss-2.4.0_Tomcat-3.2.3\jboss\conf\tomcat\standardjaws.xml I put


      java:/DataSource
      <type-mapping>Cloudscape</type-mapping>


      In my bmp ejb I access the datasource via

      javax.naming.Context context = new javax.naming.InitialContext ();
      dataSource = (DataSource) context.lookup ("java:comp/env/jdbc/DataSource");

      and in jboss.xml I have for each ejb an entry


      <ejb-name>Site</ejb-name>
      <resource-ref>
      <res-ref-name>jdbc/DataSource</res-ref-name>
      <jndi-name>java:/DataSource</jndi-name>
      </resource-ref>


      Could anybody help me with this problem?

      Thanks a lot.

      Manuel

        • 1. Re: Please help: JBoss cannot find my cloudscape tables
          David Jencks Master

          I'm not quite sure what's wrong, but if you completely remove (or comment out) all references to other datasources and databases, such as DefaultDS, hypersonic, InstantDB, you will get errors sooner when you aren't looking up the one remaining datasource properly.

          • 2. Re: Please help: JBoss cannot find my cloudscape tables
            Norm Nicholson Newbie

            Hi Manuel

            I think what you will need to do is to use the
            cloudscape.system.home variable to point to the cloudscape database directory. my run.bat file looks like this.

            @echo off
            @if not "%ECHO%" == "" echo %ECHO%
            @if "%OS%" == "Windows_NT" setlocal

            SET CLOUDSCAPE=e:\cloudscape_4.0\lib
            set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%CLOUDSCAPE%\cloudscape.jar;run.jar
            set CLASSPATH=%CLOUDSCAPE%\cloudscape.jar;%CLASSPATH%

            REM Add all login modules for JAAS-based security
            REM and all libraries that are used by them here
            set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%

            REM Add the XML parser jars and set the JAXP factory names
            REM Crimson parser JAXP setup(default)
            set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;../lib/crimson.jar
            set JAXP=-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.crimson.jaxp.DocumentBuilderFactoryImpl
            set JAXP=%JAXP% -Djavax.xml.parsers.SAXParserFactory=org.apache.crimson.jaxp.SAXParserFactoryImpl
            set CLOUDHOME=-Dcloudscape.system.home=%JBOSS_DIST%/db/cloudscape

            echo JBOSS_CLASSPATH=%JBOSS_CLASSPATH%
            java %JAXP% %CLOUDHOME% -classpath "%JBOSS_CLASSPATH%" org.jboss.Main %1 %2 %3 %4 %5 %6 %7 %8 %9

            pause

            and just remove the location stuff you had in the URL.
            e.g change
            attribute name="URL">jdbc:cloudscape:D:/cloudscape/database
            to
            attribute name="URL">jdbc:cloudscape:


            This should work fine

            Norm