0 Replies Latest reply on Jun 6, 2003 9:45 AM by aamstutz

    problem with PostgresDAO

    aamstutz Newbie

      My environment:
      JBoss-3.2.1
      PostgreSQL 7.2.1
      XDoclet-1.1.2

      After deploying a SLSB 'ScheduleEJB' I'm doing some junit testing on that bean.
      The mentioned bean uses ScheduleDAO wich accesses the postgres back-end.
      The ScheduleDAO successfully looks up the DS and gets a connection.
      But executing a query thows an exception complaining about a table name not beeing found.
      Confusingly that table-name is in "UPPERCASE" like SCHEDULEEJBTABLE.
      I renamed the table in question to the uppecase name, but that does not help:-(

      Exactly the same sql query executed over an connection retrieved via a plain DriverManager like:
      Class.forName("org.postgresql.Driver");
      Connection conn = (java.sql.Connection)
      java.sql.DriverManager.getConnection("jdbc:postgresql://192.168.1.40/javabootcamp", "myuser", "mypassword");

      works just fine and delivers the expected result

      I did not have any problems with datasources configured via Struts.

      So, is there something I must configure on the Jboss side??
      Maybe a driver problem?

      cheers,
      Andreas

      more $JBOSS_HOME/server/default/deploy/postgres-ds.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <!-- ==================================================================== -->
      <!-- Datasource config for Postgres -->
      <!-- ==================================================================== -->

      <local-tx-datasource>
      <jndi-name>JCampDS</jndi-name>
      <connection-url>jdbc:postgresql://192.168.1.40/javabootcamp</connection-url>
      <driver-class>org.postgresql.Driver</driver-class>
      <user-name>myuser</user-name>
      mypassword
      <min-pool-size>2</min-pool-size>
      <max-pool-size>1000</max-pool-size>
      <blocking-timeout-millis>5000</blocking-timeout-millis>
      </local-tx-datasource>



      excerpt from the log:

      [junit] Testcase: testJDBCConnection took 0.352 sec
      [junit] Testcase: testSearchByCourseTitle took 2.137 sec
      [junit] Caused an ERROR
      [junit] SearchByCourseTitle exception = Query exception Table not found: SCHEDULEEJBTABLE in statement [SELECT sid, courseid, locationid, city, state, country, startdate, enddate, status, title, instructorID, price, maxenrollment, currentenrollment FROM "SCHEDULEEJBTABLE" s, courseejbtable c, locationejbtable l where courseid = c.id AND locationid = l.id AND title LIKE '%Java%']
      [junit] dk.javaconsulting.xdoclet.ejbdoclet.dao.ScheduleDAOException: SearchByCourseTitle exception = Query exception Table not found: SCHEDULEEJBTABLE in statement [SELECT sid, courseid, locationid, city, state, country, startdate, enddate, status, title, instructorID, price, maxenrollment, currentenrollment FROM "SCHEDULEEJBTABLE" s, courseejbtable c, locationejbtable l where courseid = c.id AND locationid = l.id AND title LIKE '%Java%']
      [junit] at dk.javaconsulting.xdoclet.ejbdoclet.ejb.search.ScheduleEJB.searchByCourseTitle(Unknown Source)
      [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [junit] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
      [junit] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      [junit] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      [junit] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      [junit] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
      [junit] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
      [junit] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
      [junit] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      [junit] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      [junit] at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
      [junit] at org.jboss.ejb.Container.invoke(Container.java:674)
      [junit] at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
      [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [junit] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      [junit] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      [junit] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:359)
      [junit] at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)
      [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [junit] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      [junit] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      [junit] at java.security.AccessController.doPrivileged(Native Method)
      [junit] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      [junit] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      [junit] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      [junit] at java.lang.Thread.run(Thread.java:554)
      [junit] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
      [junit] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
      [junit] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
      [junit] at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
      [junit] at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135)
      [junit] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:87)
      [junit] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      [junit] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
      [junit] at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
      [junit] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
      [junit] at $Proxy1.searchByCourseTitle(Unknown Source)
      [junit] at dk.javaconsulting.xdoclet.ejbdoclet.client.TestScheduleEJB.testSearchByCourseTitle(Unknown Source)
      [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)