Exercise 6.1 with Ingres database
rcbeuker Oct 28, 2004 6:34 AMI 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