one more CMR mapping problem
knorki Mar 28, 2002 8:34 AMHi
I am using jboss beta with postgres database. when i add an 1:n cmr relationship to a bean and get an error like this:
ERROR [EntityContainer] Exception in service lifecyle operation: start
org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable is: java.sql.SQLException: ERROR: parser: parse error at or near "/"
java.sql.SQLException: ERROR: parser: parse error at or near "/"
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:94)
at org.postgresql.Connection.ExecSQL(Connection.java:398)
at org.postgresql.jdbc2.Statement.execute(Statement.java:130)
at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)
at org.jboss.resource.adapter.jdbc.local.StatementInPool.executeUpdate(StatementInPool.java:736)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:158)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:80)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:329)
at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:175)
at org.jboss.ejb.EntityContainer.start(EntityContainer.java:368)
at org.jboss.ejb.Container.invoke(Container.java:749)
at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:995)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:777)
at $Proxy2.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:341)
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:78)
at $Proxy1.start(Unknown Source)
at org.jboss.ejb.Application.start(Application.java:265)
at org.jboss.ejb.EJBDeployer.deploy(EJBDeployer.java:459)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:458)
at org.jboss.deployment.MainDeployer.scan(MainDeployer.java:296)
at org.jboss.deployment.MainDeployer.run(MainDeployer.java:259)
at java.lang.Thread.run(Thread.java:484)
org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable is: java.sql.SQLException: ERROR: parser: parse error at or near "/"
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:173)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:80)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:329)
at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:175)
at org.jboss.ejb.EntityContainer.start(EntityContainer.java:368)
at org.jboss.ejb.Container.invoke(Container.java:749)
at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:995)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:777)
at $Proxy2.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:341)
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:78)
at $Proxy1.start(Unknown Source)
at org.jboss.ejb.Application.start(Application.java:265)
at org.jboss.ejb.EJBDeployer.deploy(EJBDeployer.java:459)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:458)
at org.jboss.deployment.MainDeployer.scan(MainDeployer.java:296)
at org.jboss.deployment.MainDeployer.run(MainDeployer.java:259)
at java.lang.Thread.run(Thread.java:484)
14:18:29,177 ERROR [ServiceController] JMException thrown during ServiceProxy operation start on mbean jboss.j2ee:service=EJB,jndiName=beans/DestIPJNDI
org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable is: java.sql.SQLException: ERROR: parser: parse error at or near "/"
java.sql.SQLException: ERROR: parser: parse error at or near "/"
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:94)
at org.postgresql.Connection.ExecSQL(Connection.java:398)
at org.postgresql.jdbc2.Statement.execute(Statement.java:130)
at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)
at org.jboss.resource.adapter.jdbc.local.StatementInPool.executeUpdate(StatementInPool.java:736)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:158)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:80)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:329)
at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:175)
at org.jboss.ejb.EntityContainer.start(EntityContainer.java:368)
at org.jboss.ejb.Container.invoke(Container.java:749)
at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:995)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:777)
at $Proxy2.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:341)
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:78)
at $Proxy1.start(Unknown Source)
at org.jboss.ejb.Application.start(Application.java:265)
at org.jboss.ejb.EJBDeployer.deploy(EJBDeployer.java:459)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:458)
at org.jboss.deployment.MainDeployer.scan(MainDeployer.java:296)
at org.jboss.deployment.MainDeployer.run(MainDeployer.java:259)
at java.lang.Thread.run(Thread.java:484)
org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable is: java.sql.SQLException: ERROR: parser: parse error at or near "/"
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:173)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:80)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:329)
at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:175)
at org.jboss.ejb.EntityContainer.start(EntityContainer.java:368)
at org.jboss.ejb.Container.invoke(Container.java:749)
at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:995)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:777)
at $Proxy2.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:341)
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:78)
at $Proxy1.start(Unknown Source)
at org.jboss.ejb.Application.start(Application.java:265)
at org.jboss.ejb.EJBDeployer.deploy(EJBDeployer.java:459)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:458)
at org.jboss.deployment.MainDeployer.scan(MainDeployer.java:296)
at org.jboss.deployment.MainDeployer.run(MainDeployer.java:259)
at java.lang.Thread.run(Thread.java:484)
-> ejb-jar.xml
<ejb-relation>
<ejb-relation-name>destIps</ejb-relation-name>
<!-- unidirectional -->
<ejb-relationship-role>
<ejb-relationship-role-name>PingConf-has-destIPs</ejb-relationship-role-name>
One
<relationship-role-source>
<ejb-name>beans/PingConfEntityBean</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>destinationIPs</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>Ip-for-Conf</ejb-relationship-role-name>
Many
<relationship-role-source>
<ejb-name>beans/DestIPEntityBean</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
-> jbosscmp-jdbc.xml
<ejb-relation>
<ejb-relation-name>destIps</ejb-relation-name>
<foreign-key-mapping>
<ejb-relationship-role>
<ejb-relationship-role-name>PingConf-has-destIPs</ejb-relationship-role-name>
<fk-constraint>true</fk-constraint>
<foreign-key-fields>
<foreign-key-field>
<field-name>obID</field-name>
<column-name>obID</column-name>
</foreign-key-field>
</foreign-key-fields>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>Ip-for-Conf</ejb-relationship-role-name>
<foreign-key-fields/>
</ejb-relationship-role>
</foreign-key-mapping>
</ejb-relation>
obid is primary Key for Pingconfbean and the collection DestinationIps should relate to the other table. I think a foreign key will automatically be created.
hope this is not too dumb cause i am new to ejb and jboss
Thanks for help
Knorki