3 Replies Latest reply on Jun 3, 2004 3:57 PM by buka

    Hypersonic Database Access Problems...

    jakelee

      Hi, all,

      I am going through chapter 3 of that TUSC J2EE tutorial (Eclipse/JBoss).
      For some reason: it returned null.
      *************Result**************
      Request from client :
      Reply from Server: Your userid is null
      ********************************

      Errors in Console:
      ----------------------------------------------------------------------
      00:05:37,738 INFO [STDOUT] Entering StoreAccessBean
      00:05:37,738 INFO [STDOUT] Leaving StoreAccessBean
      00:05:37,768 INFO [STDOUT] Entering StoreAccessDAOImpl.init()
      00:05:37,768 INFO [STDOUT] Leaving StoreAccessDAOImpl.init()
      00:05:37,768 INFO [STDOUT] Entering StoreAccessDAOImpl.init()
      00:05:37,778 ERROR [STDERR] java.sql.SQLException: Table not found: STOREACCESS in statement [select userid from STOREACCESS where username = 'ANDY' and password = 'PASSWD']
      00:05:37,778 ERROR [STDERR] at org.hsqldb.Trace.getError(Unknown Source)
      00:05:37,778 ERROR [STDERR] at org.hsqldb.jdbcResultSet.(Unknown Source)
      00:05:37,778 ERROR [STDERR] at org.hsqldb.jdbcConnection.executeStandalone(Unknown Source)
      00:05:37,778 ERROR [STDERR] at org.hsqldb.jdbcConnection.execute(Unknown Source)
      00:05:37,778 ERROR [STDERR] at org.hsqldb.jdbcStatement.fetchResult(Unknown Source)
      00:05:37,788 ERROR [STDERR] at org.hsqldb.jdbcStatement.executeQuery(Unknown Source)
      00:05:37,788 ERROR [STDERR] at org.hsqldb.jdbcPreparedStatement.executeQuery(Unknown Source)
      00:05:37,788 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:304)
      00:05:37,788 ERROR [STDERR] at au.com.tusc.dao.StoreAccessDAOImpl.loginUser(StoreAccessDAOImpl.java:56)
      00:05:37,788 ERROR [STDERR] at au.com.tusc.session.StoreAccessSession.loginUser(StoreAccessSession.java:60)
      00:05:37,788 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      00:05:37,788 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      00:05:37,788 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      00:05:37,788 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      00:05:37,788 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
      00:05:37,788 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
      00:05:37,788 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      00:05:37,788 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      00:05:37,788 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
      00:05:37,788 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
      00:05:37,788 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
      00:05:37,788 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      00:05:37,788 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      00:05:37,788 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
      00:05:37,788 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:700)
      00:05:37,788 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      00:05:37,798 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      00:05:37,798 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      00:05:37,798 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      00:05:37,798 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      00:05:37,798 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      00:05:37,798 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
      00:05:37,798 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      00:05:37,798 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      00:05:37,798 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      00:05:37,798 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      00:05:37,798 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      00:05:37,798 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      00:05:37,798 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
      00:05:37,798 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      00:05:37,798 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      00:05:37,798 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      00:05:37,798 ERROR [STDERR] at java.lang.Thread.run(Thread.java:534)
      00:05:37,798 INFO [STDOUT] Inside StoreAccessDAOImpl.loginUser()java.sql.SQLException: Table not found: STOREACCESS in statement [select userid from STOREACCESS where username = 'ANDY' and password = 'PASSWD']
      00:05:37,798 INFO [STDOUT] Leaving StoreAccessDAOImpl.loginUser()
      -------------------------------------------------------------------------------

      Please let me know if you can help...thankx a lot...

      J-

      FYI - StoreAccessBean.java

      /*
      * Created on May 11, 2004
      *
      * To change the template for this generated file go to
      * Window>Preferences>Java>Code Generation>Code and Comments
      */
      package au.com.tusc.session;

      import javax.ejb.SessionBean;
      import javax.ejb.SessionContext;

      /**
      * @ejb.bean name="StoreAccess"
      * jndi-name="StoreAccessBean"
      * type="Stateless"
      *
      * @ejb.dao class="au.com.tusc.session.StoreAccessDAO"
      * impl-class="au.com.tusc.dao.StoreAccessDAOImpl"
      *
      * @ejb.resource-ref res-ref-name="jdbc/DefaultDS"
      * res-type="javax.sql.Datasource"
      * res-auth="Container"
      *
      * @jboss.resource-ref res-ref-name="jdbc/DefaultDS"
      * jndi-name="java:/DefaultDS"
      *
      * **/

      public abstract class StoreAccessBean implements SessionBean {

      protected SessionContext ctx;

      /**
      * @ejb.interface-method
      * view-type="remote"
      * @dao.call name="loginUser"
      **/
      public String loginUser (String username, String password){

      System.out.println("Entering StoreAccessBean");
      System.out.println("Leaving StoreAccessBean");
      return null;
      }

      /**
      * Sets the session context
      * @param javax.ejb.SessionContext the new ctx value
      * @ejb.method stSessionContext
      **/
      public void setSessionContext(javax.ejb.SessionContext ctx) {
      this.ctx = ctx;
      }

      /**
      * Unsets the session context
      * @param javax.ejb.SessionContext ctx value
      * @ejb.method unsetSessionContext
      **/
      public void unsetSessionContext() {
      this.ctx = null;
      }
      }