4 Replies Latest reply on Mar 2, 2004 10:05 AM by Debashis Dutta

    Table not found in Chapter 3 in class StoreAccessDAOImpl wit

    christof Newbie

      Hi,
      when running the client program SessionClient an exception is raised in class StoreAccessDAOImpl in line rs = ps.executeQuery();

      The select looks like this
      String queryString = "select userid from storeaccess where username = ? and password = ?";

      The log shows the following message
      Inside StoreAccessDAOImpl.loginUser()java.sql.SQLException: Table not found: STOREACCESS in statement [select userid from storeaccess where username = 'ANDY' and password = 'PASSWD']

      Most likely i did something in configuration but i can´t find it. Similiar messages about this problem did not help me.
      Thanks for your help, Christof

        • 1. Re: Table not found in Chapter 3 in class StoreAccessDAOImpl
          Debashis Dutta Newbie

          I am having the exact same problem. ps.executequery() throws sql exception, table not found : storeaccess. The table is there in the databse, you can execute the query. Tried uppecase/lowercase combination. This is a very good tutorial. Need help to continue.

          --------
          Env:
          -----
          jboss-3.2.3
          eclipse-3.0M6
          lomboz.211
          Windows Professional 2000

          • 2. Re: Table not found in Chapter 3 in class StoreAccessDAOImpl
            christof Newbie

            Hi,
            i did find my problem. I had a mismatch between the place the data for the hypersonic database was stored and the server used in the example.

            My database data was stored here :
            :\jboss-3.2.1_tomcat-4.1.24\server\default\data\hypersonic

            The file jboss321all.server stored under :
            C:\Tools\eclipse\plugins\com.objectlearn.jdt.j2ee\servers
            pointed to the all server
            C:\jboss-3.2.1_tomcat-4.1.24\server\all\data\hypersonic

            Once i made it both the same it worked. To make it the same i changed the file jboss321all.server which includes the server definiton used by eclipse. I changed all the server references from all to default
            Good luck !

            • 3. Re: Table not found in Chapter 3 in class StoreAccessDAOImpl
              Debashis Dutta Newbie

              Thank you for the info. I modified the jboss321all.server, cahnged all the reference from "/all/" to "/default/". Eclipse is not deploying MyStoreMgr with this modified settings. Kinda weird. It copies the .ear file in the /server/default/deploy directory. I do not see the deployment successfull in the eclipse console. If i try to run it says bean not bound. If i use the old settings, "/all/", it deploys the bean. I am not sure what I'm doing wrong. Any help the will appreciated.

              Thank you,
              -poqonos


              jboss321all.server
              ---------------------


              
              
              <serverDefinition
               name="JBOSS 3.2.3 ALL"
               ejbModules="true"
               webModules="true"
               earModules="true">
              <property id="serverRootDirectory"
               label="Application Server Directory:"
               type="directory"
               default="c:/jboss-3.2.3" />
              <property id="serverAddress"
               label="Address:"
               type="string"
               default="127.0.0.1" />
              <property id="serverPort"
               label="Port:"
               type="string"
               default="8080" />
              <property id="classPathVariableName"
               label="Classpath Variable Name:"
               type="string"
               default="JBOSS321" />
              <property id="classPath"
               label="Classpath Variable:"
               type="directory"
               default="c:/jboss-3.2.3" />
              <serverHome></serverHome>
              <webModulesDeployDirectory>/server/default/deploy</webModulesDeployDirectory>
              <ejbModulesDeployDirectory>/server/default/deploy</ejbModulesDeployDirectory>
              <earModulesDeployDirectory>/server/default/deploy</earModulesDeployDirectory>
              <jndiInitialContextFactory>org.jnp.interfaces.NamingContextFactory</jndiInitialContextFactory>
              <jndiProviderUrl>jnp://:1099</jndiProviderUrl>
              <startClass>org.jboss.Main</startClass>
              <startWorkingDirectory>/bin</startWorkingDirectory>
              <startVmParameters></startVmParameters>
              <startProgramArguments>-c all</startProgramArguments>
              <stopClass>org.jboss.Shutdown</stopClass>
              <stopWorkingDirectory>/bin</stopWorkingDirectory>
              <stopVmParameters></stopVmParameters>
              <stopProgramArguments> </stopProgramArguments>
              <serverClassPath>
               <jar type="variable">JDK_TOOLS</jar>
               <jar type="variable">/bin/run.jar</jar>
               <jar type="variable">/bin/shutdown.jar</jar>
               <jar type="variable">/client/jboss-j2ee.jar</jar>
               <jar type="variable">/server/default/lib/javax.servlet.jar</jar>
               <jar type="variable">/lib/concurrent.jar</jar>
               <jar type="variable">/lib/gnu-regexp.jar</jar>
               <jar type="variable">/lib/jboss-system.jar</jar>
               <jar type="variable">/lib/commons-httpclient.jar</jar>
               <jar type="variable">/lib/getopt.jar</jar>
               <jar type="variable">/lib/jboss-boot.jar</jar>
               <jar type="variable">/lib/jboss-common.jar</jar>
               <jar type="variable">/lib/jboss-jmx.jar</jar>
               <jar type="variable">/lib/log4j-boot.jar</jar>
               <jar type="variable">/lib/jdom.jar</jar>
               <jar type="variable">/lib/webdavlib.jar</jar>
               <jar type="variable">/lib/xercesImpl.jar</jar>
               <jar type="variable">/lib/xml-apis.jar</jar>
               <jar type="variable">/server/default/lib/jboss.jar</jar>
               <jar type="variable">/server/default/lib/jsse.jar</jar>
               <jar type="variable">/server/default/lib/jboss-jaas.jar</jar>
               <jar type="variable">/server/default/lib/jboss-j2ee.jar</jar>
               <jar type="variable">/server/default/lib/jts.jar</jar>
               <jar type="variable">/server/default/lib/jsse.jar</jar>
               <jar type="variable">/server/default/lib/jboss-management.jar</jar>
               <jar type="variable">/server/default/misclib/jbossmqha.jar</jar>
               <jar type="variable">/server/default/lib/jbossmq.jar</jar>
               <jar type="variable">/server/default/lib/jbosssx.jar</jar>
               <jar type="variable">/server/default/lib/jpl-pattern.jar</jar>
               <jar type="variable">/server/default/lib/jpl-util.jar</jar>
               <jar type="variable">/server/default/lib/jbossha.jar</jar>
               <jar type="variable">/server/default/lib/jnpserver.jar</jar>
               <jar type="variable">/server/default/misclib/javagroups-2.0.jar</jar>
               <jar type="variable">/server/default/lib/jboss-transaction.jar</jar>
               <jar type="variable">/server/default/lib/bcel.jar</jar>
               <jar type="variable">/server/default/lib/jboss-jsr77.jar</jar>
               <jar type="variable">/server/default/lib/log4j.jar</jar>
               <jar type="variable">/server/default/lib/hsqldb.jar</jar>
               <jar type="variable">/server/default/lib/hsqldb-plugin.jar</jar>
              </serverClassPath>
              <clientClassPath>
               <jar type="variable">/client/jboss-j2ee.jar</jar>
               <jar type="variable">/client/jnp-client.jar</jar>
               <jar type="variable">/client/jboss-client.jar</jar>
               <jar type="variable">/client/jboss-common-client.jar</jar>
               <jar type="variable">/client/jbosssx-client.jar</jar>
               <jar type="variable">/client/log4j.jar</jar>
               <jar type="variable">/client/jnet.jar</jar>
               <jar type="variable">/client/jboss-jaas.jar</jar>
              </clientClassPath>
              </serverDefinition>
              
              


              • 4. Re: Table not found in Chapter 3 in class StoreAccessDAOImpl
                Debashis Dutta Newbie

                Hi,

                Finally solved the problem. According to the exercise it creates the tables in "hsqldb default" database. While you run the EJBclient it connects to the "hsqldb all" database. I tried to modify the jboss321all.server. Changed all the references from "/all/" to "/default/". With that I have a problem deploying the app. I am not sure why it works weird. I comapared the directory, C:\jboss-3.2.3\server\all\lib and C:\jboss-3.2.3\server\default\lib, it looks ok unless the content are different. If I change back to my older settings, which is "/all/", the deployment works fine. So I decided to keep the orignal settings and point the app to "hsqldb all". To do this I modified the hsqldb-ds.xml in C:\jboss-3.2.3\server\all\deploy. Started jBoss using eclipse. Brought up the jmx-xonsole,

                http://localhost:8080/jmx-console/index.jsp

                Started the DB Admin and created those tables.

                Deployed the app and it runs fine.

                -poqonos

                ps.: Config files.

                jboss321all.server under C:\eclipse\plugins\com.objectlearn.jdt.j2ee\servers
                -----------------------------------------------------------

                
                <serverDefinition
                 name="JBOSS 3.2.3 ALL"
                 ejbModules="true"
                 webModules="true"
                 earModules="true">
                <property id="serverRootDirectory"
                 label="Application Server Directory:"
                 type="directory"
                 default="c:/jboss-3.2.3" />
                <property id="serverAddress"
                 label="Address:"
                 type="string"
                 default="127.0.0.1" />
                <property id="serverPort"
                 label="Port:"
                 type="string"
                 default="8080" />
                <property id="classPathVariableName"
                 label="Classpath Variable Name:"
                 type="string"
                 default="JBOSS321" />
                <property id="classPath"
                 label="Classpath Variable:"
                 type="directory"
                 default="c:/jboss-3.2.3" />
                <serverHome></serverHome>
                <webModulesDeployDirectory>/server/all/deploy</webModulesDeployDirectory>
                <ejbModulesDeployDirectory>/server/all/deploy</ejbModulesDeployDirectory>
                <earModulesDeployDirectory>/server/all/deploy</earModulesDeployDirectory>
                <jndiInitialContextFactory>org.jnp.interfaces.NamingContextFactory</jndiInitialContextFactory>
                <jndiProviderUrl>jnp://:1099</jndiProviderUrl>
                <startClass>org.jboss.Main</startClass>
                <startWorkingDirectory>/bin</startWorkingDirectory>
                <startVmParameters></startVmParameters>
                <startProgramArguments>-c all</startProgramArguments>
                <stopClass>org.jboss.Shutdown</stopClass>
                <stopWorkingDirectory>/bin</stopWorkingDirectory>
                <stopVmParameters></stopVmParameters>
                <stopProgramArguments> </stopProgramArguments>
                <serverClassPath>
                 <jar type="variable">JDK_TOOLS</jar>
                 <jar type="variable">/bin/run.jar</jar>
                 <jar type="variable">/bin/shutdown.jar</jar>
                 <jar type="variable">/client/jboss-j2ee.jar</jar>
                 <jar type="variable">/server/all/lib/javax.servlet.jar</jar>
                 <jar type="variable">/lib/concurrent.jar</jar>
                 <jar type="variable">/lib/gnu-regexp.jar</jar>
                 <jar type="variable">/lib/jboss-system.jar</jar>
                 <jar type="variable">/lib/commons-httpclient.jar</jar>
                 <jar type="variable">/lib/getopt.jar</jar>
                 <jar type="variable">/lib/jboss-boot.jar</jar>
                 <jar type="variable">/lib/jboss-common.jar</jar>
                 <jar type="variable">/lib/jboss-jmx.jar</jar>
                 <jar type="variable">/lib/log4j-boot.jar</jar>
                 <jar type="variable">/lib/jdom.jar</jar>
                 <jar type="variable">/lib/webdavlib.jar</jar>
                 <jar type="variable">/lib/xercesImpl.jar</jar>
                 <jar type="variable">/lib/xml-apis.jar</jar>
                 <jar type="variable">/server/all/lib/jboss.jar</jar>
                 <jar type="variable">/server/all/lib/jsse.jar</jar>
                 <jar type="variable">/server/all/lib/jboss-jaas.jar</jar>
                 <jar type="variable">/server/all/lib/jboss-j2ee.jar</jar>
                 <jar type="variable">/server/all/lib/jts.jar</jar>
                 <jar type="variable">/server/all/lib/jsse.jar</jar>
                 <jar type="variable">/server/all/lib/jboss-management.jar</jar>
                 <jar type="variable">/server/all/misclib/jbossmqha.jar</jar>
                 <jar type="variable">/server/all/lib/jbossmq.jar</jar>
                 <jar type="variable">/server/all/lib/jbosssx.jar</jar>
                 <jar type="variable">/server/all/lib/jpl-pattern.jar</jar>
                 <jar type="variable">/server/all/lib/jpl-util.jar</jar>
                 <jar type="variable">/server/all/lib/jbossha.jar</jar>
                 <jar type="variable">/server/all/lib/jnpserver.jar</jar>
                 <jar type="variable">/server/all/misclib/javagroups-2.0.jar</jar>
                 <jar type="variable">/server/all/lib/jboss-transaction.jar</jar>
                 <jar type="variable">/server/all/lib/bcel.jar</jar>
                 <jar type="variable">/server/all/lib/jboss-jsr77.jar</jar>
                 <jar type="variable">/server/all/lib/log4j.jar</jar>
                 <jar type="variable">/server/default/lib/hsqldb.jar</jar>
                 <jar type="variable">/server/default/lib/hsqldb-plugin.jar</jar>
                </serverClassPath>
                <clientClassPath>
                 <jar type="variable">/client/jboss-j2ee.jar</jar>
                 <jar type="variable">/client/jnp-client.jar</jar>
                 <jar type="variable">/client/jboss-client.jar</jar>
                 <jar type="variable">/client/jboss-common-client.jar</jar>
                 <jar type="variable">/client/jbosssx-client.jar</jar>
                 <jar type="variable">/client/log4j.jar</jar>
                 <jar type="variable">/client/jnet.jar</jar>
                 <jar type="variable">/client/jboss-jaas.jar</jar>
                </clientClassPath>
                </serverDefinition>
                
                


                hsqldb-ds.xml under
                C:\jboss-3.2.3\server\all\deploy
                -------------------------------------
                
                <?xml version="1.0" encoding="UTF-8"?>
                
                <!-- The Hypersonic embedded database JCA connection factory config
                $Id: hsqldb-ds.xml,v 1.1.2.11 2003/09/28 12:31:36 starksm Exp $ -->
                
                
                <datasources>
                 <local-tx-datasource>
                
                 <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
                 <!-- Datasources are not available outside the virtual machine -->
                 <jndi-name>DefaultDS</jndi-name>
                
                 <!-- for tcp connection, allowing other processes to use the hsqldb
                 database. This requires the org.jboss.jdbc.HypersonicDatabase mbean.
                -->
                 <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
                
                 <!-- for totally in-memory db, not saved when jboss stops.
                 The org.jboss.jdbc.HypersonicDatabase mbean is unnecessary
                 <connection-url>jdbc:hsqldb:.</connection-url>
                -->
                 <!-- for in-process db with file store, saved when jboss stops. The
                 org.jboss.jdbc.HypersonicDatabase is unnecessary
                 <connection-url>jdbc:hsqldb:/hypersonic/localDB
                 </connection-url>
                -->
                
                 <!-- The driver class -->
                 <driver-class>org.hsqldb.jdbcDriver</driver-class>
                
                 <!-- The login and password -->
                 <user-name>sa</user-name>
                 <password></password>
                
                 <!--example of how to specify class that determines if exception means connection should be destroyed-->
                 <!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->
                
                 <!-- this will be run before a managed connection is removed from the pool for use by a client-->
                 <!--<check-valid-connection-sql>select * from something</check-valid-connection-sql> -->
                
                 <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
                 <min-pool-size>5</min-pool-size>
                
                 <!-- The maximum connections in a pool/sub-pool -->
                 <max-pool-size>20</max-pool-size>
                
                 <!-- The time before an unused connection is destroyed -->
                 <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
                 <!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections -->
                 <idle-timeout-minutes>0</idle-timeout-minutes>
                
                 <!-- sql to call when connection is created
                 <new-connection-sql>some arbitrary sql</new-connection-sql>
                 -->
                
                 <!-- sql to call on an existing pooled connection when it is obtained from pool
                 <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
                 -->
                
                 <!-- example of how to specify a class that determines a connection is valid before it is handed out from the pool
                 <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyValidConnectionChecker</valid-connection-checker-class-name>
                 -->
                
                 <!-- Whether to check all statements are closed when the connection is returned to the pool,
                 this is a debugging feature that should be turned off in production -->
                 <track-statements>true</track-statements>
                
                 <!-- Use the getConnection(user, pw) for logins
                 <application-managed-security/>
                 -->
                
                 <!-- Use the security domain defined in conf/login-config.xml -->
                 <security-domain>HsqlDbRealm</security-domain>
                
                 <!-- Use the security domain defined in conf/login-config.xml or the
                 getConnection(user, pw) for logins. The security domain takes precedence.
                 <security-domain-and-application>HsqlDbRealm</security-domain-and-application>
                 -->
                
                 <!-- Add this depends tag if you are using the tcp connection url
                 <depends>jboss:service=Hypersonic</depends>
                 -->
                 </local-tx-datasource>
                
                 <!-- This mbean should be used only when using tcp connections. Uncomment
                 when the tcp based connection-url is used.
                 -->
                 <mbean code="org.jboss.jdbc.HypersonicDatabase"
                 name="jboss:service=Hypersonic">
                 <attribute name="Port">1701</attribute>
                 <attribute name="Silent">true</attribute>
                 <attribute name="Database">all</attribute>
                 <attribute name="Trace">false</attribute>
                 <attribute name="No_system_exit">true</attribute>
                 </mbean>
                
                
                </datasources>