3 Replies Latest reply on Aug 5, 2005 4:28 AM by rcbeuker

    Exercise 6.1 with Ingres database

    rcbeuker

      I try to connect Database Ingres version 3.0 (0404) to jboss-4.0.0RC1. Therefore I use an example from the book 'Enterprise JavaBeans 4th Edition' I try to start Exercise 6.1 with my own made Ingress data source:

      ingres-ds.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <datasources>
       <local-tx-datasource>
       <jndi-name>IngresDS</jndi-name>
       <connection-url>jdbc:edbc://gea:21072/gea::titan</connection-url>
       <driver-class>ca.edbc.jdbc.EdbcDriver</driver-class>
       <user-name>USER_NAME</user-name>
       <password>USER_PASSWORD</password>
       <min-pool-size>1</min-pool-size>
       <max-pool-size>4</max-pool-size>
       <idle-timeout-minutes>0</idle-timeout-minutes>
       <track-statements>true</track-statements>
       </local-tx-datasource>
      </datasources>
      


      Within jbosscmp-jdbc.xml I specify:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <!DOCTYPE jbosscmp-jdbc PUBLIC
       "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN"
       "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd">
      
      <jbosscmp-jdbc>
      
       <enterprise-beans>
       <entity>
       <ejb-name>CustomerEJB</ejb-name>
       <datasource>IngresDS</datasource>
       <create-table>true</create-table>
       <remove-table>true</remove-table>
       <table-name>Customer</table-name>
       <cmp-field>
       <field-name>id</field-name>
       <column-name>ID</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>lastName</field-name>
       <column-name>LAST_NAME</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>firstName</field-name>
       <column-name>FIRST_NAME</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>hasGoodCredit</field-name>
       <column-name>HAS_GOOD_CREDIT</column-name>
       </cmp-field>
       </entity>
       </enterprise-beans>
      
      </jbosscmp-jdbc>
      

      I did not change the other files. When I try to start this configuration (with Ingress up and running):

      11:23:57,359 ERROR [EntityContainer] Starting failed jboss.j2ee:jndiName=CustomerHomeRemote,service=EJB
      java.lang.ArrayIndexOutOfBoundsException: 2
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCFunctionMappingMetaData.getFunctionSql(JDBCFunctionMappingMetaDa
      a.java:137)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.getEntityCreateTableSQL(JDBCStartCommand.java:715)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:184)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:492)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:396)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:157)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:348)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:230)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:844)
      at $Proxy18.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:369)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:230)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy49.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:394)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:230)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:844)
      at $Proxy18.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:369)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:230)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)

      [skipped the other lines]


      It it does not matter if the table Customer exist or not. Do I have to change the datasource? Or, do I have to specify more/other properties?

      Roland Beuker


        • 1. 3857698
          jvembuna

          I am using Jetspeed1.5 to run my web application as JetSpeed portal. Where in, the business component are EJB's. This Integration is working on JBoss

          Now in this application i am integrating SCARAB as an Issue Tracker.
          While i am porting the SCARAB on JBOSS, its throwing

          Could not initialise deployment: file:/D:/Data/jboss-3.2.6/server/default/deploy/scarab/WEB-INF/classes/org.rar

          org.jboss.deployment.DeploymentException: exception in init of file:/D:/Data/jboss-3.2.6/server/default/deploy/scarab/WEB-INF/classes/org.rar; - nested throwable: (java.lang.NullPointerException)
          at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:39)
          at org.jboss.deployment.MainDeployer.init(MainDeployer.java:719)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:631)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
          at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
          etc .. etc..


          Moreover, at the end when jetspeed is getting deployed it hangs at

          [TomcatDeployer] deploy, ctxPath=/jetspeed, warUrl=file:/D:/Data/jboss-3.2.6/server/default/deploy/jetspeed.war/


          Can any body tell me what are the major changes i need to do, so as to run SCARAB with JETSPEED on JBOSS3.2.6

          • 2. Re: Exercise 6.1 with Ingres database
            bruce.lunsford

            We also recently ran into this problem with one of the tutorial programs. The resolution is to change the JBoss configuration file standardjbosscmp-jdbc.xml in server/default/conf and/or server/all/conf directories, under <type-mapping> for the Ingres section of the file(s). Change the <pk-constraint-template> tag from:
            ALTER TABLE ?1 ADD CONSTRAINT ?2 PRIMARY KEY (?3)
            to
            CONSTRAINT ?1 PRIMARY KEY (?2)

            We are in the process of trying to get this fixed in JBoss. The error,
            "java.lang.ArrayIndexOutOfBoundsException", is caused by the generation of a create table statement, which uses the latter format, not the ALTER format and the fact that there are 3 required parameters for the ALTER statement, but only 2 for the 2nd format (which is used in the create table statement).
            Regards,
            Bruce Lunsford
            CA Ingres Development

            • 3. Re: Exercise 6.1 with Ingres database
              rcbeuker

              Hello Bruce,

              It?s quit on the Ingres front... Indeed there are some problems with the Ingres mapping files. I have the same problems with Ingres on Hibernate:

              http://forum.hibernate.org/viewtopic.php?t=945230&highlight=

              After a quick view I already saw some errors in this file.

              Greetings,

              Roland Beuker