3 Replies Latest reply on Mar 7, 2003 1:23 PM by ndijkstra

    Can someone show me how to set up Access as a datasouce?

    scprotz

      I am a true newbie to Jboss. I am trying to create some entity beans for simple data retrieval. I have created an Access Db (and please, I know this isn't a very good db, but its just for learning purposes right now). I have moved the msaccess-service.xml file to my deploy directory. I created my entity bean and then created created client to view it (if anyone is interested, i'm trying the entity bean example in Deitel & Deitel's Advanced Java: How to Program in chapter 15, the BMP version).

      I use the sun deploytool to create a .ear file, and put it in my deploy directory.

      jboss starts it just fine (it gives a warning about thrown exceptions matching in the bean class and the home class, but otherwise seems to work ok).

      I created the client in the book as well, and use it to access the ejb that i created. The client talks to the ejb (console statements show this), but whenever I try to do some sort of SQL query, it says the TABLE not found.

      Did I miss something on my set up? (also, on the JBoss machine, I did go into the ODBC settings, and set up the database as an odbc source.)

      If there is any other info that I can provide to help in this area, please let me know.

      Thanks very much

      scprotz

        • 1. Here is a copy of my console:
          scprotz

          After looking through my console, it appears JBoss is trying to use hsqldb instead of sun.jdbc.odbc . Is this correct?. and how can I change that?


          17:08:23,802 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
          -3.0.4_tomcat-4.1.12/server/default/deploy/EmployeeEJB.ear
          17:08:23,812 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-3.0.4_tom
          cat-4.1.12/server/default/deploy/EmployeeEJB.ear
          17:08:24,253 INFO [EJBDeployer]
          Bean : EmployeeEJB
          Method : public abstract Employee findByPrimaryKey(Integer) throws RemoteExcepti
          on, FinderException
          Section: 12.2.9
          Warning: All the exceptions defined in the throws clause of an ejbFind method of
          the entity bean class must be included in the throws clause of the matching fin
          d method of the home interface.

          17:08:24,253 INFO [EjbModule] Creating
          17:08:24,293 INFO [EjbModule] Deploying EmployeeEJB
          17:08:24,443 INFO [EjbModule] Created
          17:08:24,443 INFO [EjbModule] Starting
          17:08:24,463 INFO [EjbModule] Started
          17:08:24,463 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.0.4_tomcat-
          4.1.12/server/default/deploy/EmployeeEJB.ear
          17:08:24,483 INFO [URLDeploymentScanner] Started
          17:08:24,483 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.0.4_tomcat-
          4.1.12/server/default/conf/jboss-service.xml
          17:08:24,483 INFO [Server] JBoss (MX MicroKernel) [3.0.4 Date:200211021607] Sta
          rted in 0m:16s:984ms
          17:10:11,647 ERROR [LogInterceptor] EJBException, causedBy:
          java.sql.SQLException: Table not found: EMPLOYEE in statement [SELECT employeeID
          FROM Employee WHERE employeeID = 1]
          at org.hsqldb.Trace.getError(Trace.java:180)
          at org.hsqldb.Result.(Result.java:175)
          at org.hsqldb.jdbcConnection.executeHSQL(jdbcConnection.java:907)
          at org.hsqldb.jdbcConnection.execute(jdbcConnection.java:718)
          at org.hsqldb.jdbcStatement.fetchResult(jdbcStatement.java:686)
          at org.hsqldb.jdbcStatement.executeQuery(jdbcStatement.java:68)
          at org.hsqldb.jdbcPreparedStatement.executeQuery(jdbcPreparedStatement.j
          ava:133)
          at org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.executeQ
          uery(LocalPreparedStatement.java:289)
          at com.deitel.advjhtp1.ejb.entity.EmployeeEJB.ejbFindByPrimaryKey(Employ
          eeEJB.java:243)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
          java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.ejb.plugins.BMPPersistenceManager.callFinderMethod(BMPPersi
          stenceManager.java:638)
          at org.jboss.ejb.plugins.BMPPersistenceManager.findEntity(BMPPersistence
          Manager.java:330)
          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.find
          Entity(CachedConnectionInterceptor.java:301)
          at org.jboss.ejb.EntityContainer.find(EntityContainer.java:690)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
          java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityC
          ontainer.java:1119)
          at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(Ent
          itySynchronizationInterceptor.java:206)
          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
          keHome(CachedConnectionInterceptor.java:215)
          at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractIntercep
          tor.java:73)
          at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInst
          anceInterceptor.java:90)
          at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInte
          rceptor.java:79)
          at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCrea
          tionInterceptor.java:44)
          at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
          rceptor.java:111)
          at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
          torCMT.java:178)
          at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.ja
          va:52)
          at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
          tor.java:105)
          at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1
          29)
          at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
          at org.jboss.ejb.Container.invoke(Container.java:730)
          at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
          at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
          382)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
          java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
          at sun.rmi.transport.Transport$1.run(Transport.java:148)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
          60)
          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
          .java:701)
          at java.lang.Thread.run(Thread.java:536)



          scprotz

          • 2. Re: Can someone show me how to set up Access as a datasouce?
            gary_kephart

            I had the same problem in the last few weeks. Finally solved it. Attached is a zip file of an example. Please let me know if this helps.

            • 3. Re: Can someone show me how to set up Access as a datasouce?
              ndijkstra

              So, you have to put the xml containing the datasource definition in the deploy directory??