Bugs item #516404, was opened at 2002-02-12 04:31
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=516404&group_id=22866

Category: JBossCMP
Group: v3.0 Rabbit Hole
>Status: Closed
Resolution: Invalid
Priority: 5
Submitted By: Thomas Hamann (thomash76)
Assigned to: Dain Sundstrom (dsundstrom)
Summary: invalid type mapping

Initial Comment:
Hi,

i tried to run an application which uses entity beans with cmp 2.0. Those entities 
have cmp fields 
containing values of type java.util.HashMap which is serializable and therefore a 
valid cmp field 
type. During deployment the tables for all entities are created successfully and with 
the correct 
column types (according to standardjbosscmp-jdbc.xml type-mappings "Oracle8"). But 
when 
creating such an entity via a create method on its home interface an exception is 
thrown (written 
below). The problem can be solved by declaring the return and parameter types of the 
abstract 
cmp field methods to be java.lang.Object instead of any (valid) serializable type...

btw: "Ungnltiger Spaltentyp" is german for "invalid column type"

javax.ejb.EJBException: Internal error setting parameters for field allowedUsers
Embedded Exception
Ungnltiger Spaltentyp
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setArgumentParameters(JDBCAbs
tractCMPFieldBr
idge.java:220)
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setInstanceParameters(JDBCAbst
ractCMPFieldBr
idge.java:193)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.insertEntity(JDBCCreateEntityCommand.j
ava:194)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:
131)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:380)
        at 
org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:233)
        at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:680)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1187)
        at 
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
        at 
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationIntercepto
r.java:222)
        at 
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:136)
        at 
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:80)
        at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:158)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:55)
        at 
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:102)
        at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)
        at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:459)
        at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1086)
        at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
        at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
        at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:320)
        at java.lang.reflect.Method.invoke(Native Method)
        at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
        at sun.rmi.transport.Transport$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
java.sql.SQLException: Ungnltiger Spaltentyp
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
        at 
oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:4560)
        at 
oracle.jdbc.driver.OraclePreparedStatement.setNull(OraclePreparedStatement.java:869)
        at 
org.jboss.resource.adapter.jdbc.local.PreparedStatementInPool.setNull(PreparedStatementInPool.ja
va:78)
        at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.setParameter(JDBCUtil.java:144)
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setArgumentParameters(JDBCAbs
tractCMPFieldBr
idge.java:214)
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setInstanceParameters(JDBCAbst
ractCMPFieldBr
idge.java:193)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.insertEntity(JDBCCreateEntityCommand.j
ava:194)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:
131)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:380)
        at 
org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:233)
        at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:680)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1187)
        at 
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
        at 
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationIntercepto
r.java:222)
        at 
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:136)
        at 
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:80)
        at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:158)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:55)
        at 
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:102)
        at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)
        at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:459)
        at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1086)
        at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
        at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
        at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:320)
        at java.lang.reflect.Method.invoke(Native Method)
        at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
        at sun.rmi.transport.Transport$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
13:07:31,105 ERROR [EntityContainer] invoke returned an exception
javax.ejb.CreateException: Could not create entity:javax.ejb.EJBException: Internal 
error setting 
parameters for field a
llowedUsers
Embedded Exception
Ungnltiger Spaltentyp
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.insertEntity(JDBCCreateEntityCommand.j
ava:201)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:
131)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:380)
        at 
org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:233)
        at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:680)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1187)
        at 
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
        at 
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationIntercepto
r.java:222)
        at 
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:136)
        at 
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:80)
        at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:158)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:55)
        at 
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:102)
        at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)
        at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:459)
        at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1086)
        at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
        at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
        at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:320)
        at java.lang.reflect.Method.invoke(Native Method)
        at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
        at sun.rmi.transport.Transport$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

with kind regards,
Thomas

----------------------------------------------------------------------

>Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-02-12 09:08

Message:
Logged In: YES 
user_id=251431

Why was this reopened?

----------------------------------------------------------------------

Comment By: Thomas Hamann (thomash76)
Date: 2002-02-12 08:48

Message:
Logged In: YES 
user_id=445709

The following is in the log file...

2002-02-12 16:35:30,980 DEBUG 
[org.jboss.ejb.plugins.cmp.jdbc.JDBCDeclaredSQLQuery.jatek/GlossaryEntry.ejbSelectTitle]
 Executing SQL: 
SELECT DISTINCT uid_column, locale_column FROM TITLE WHERE locale=? and uid=?
2002-02-12 16:35:30,996 DEBUG 
[org.jboss.ejb.plugins.cmp.jdbc.JDBCDeclaredSQLQuery.jatek/GlossaryEntry.ejbSelectTitle]
 Set parameter: 
index=1, jdbcType=VARCHAR, value=de_DE
2002-02-12 16:35:30,996 DEBUG 
[org.jboss.ejb.plugins.cmp.jdbc.JDBCDeclaredSQLQuery.jatek/GlossaryEntry.ejbSelectTitle]
 Set parameter: 
index=2, jdbcType=BIGINT, value=768
2002-02-12 16:35:31,152 DEBUG 
[org.jboss.ejb.plugins.cmp.jdbc.JDBCDeclaredSQLQuery.jatek/GlossaryEntry.ejbSelectTitle]
 Find failed
java.sql.SQLException: ORA-00904: invalid column name
...

What i'm trying to do is: creating an instance of a local bean TITLE while in the 
ejbCreate() of the remote 
bean GLOSSARYENTRY.
It is likely to happen that the ejbSelectTitle() fails, because for a new 
GLOSSARYENTRY there are no 
existing TITLEs. But according to my code the FinderException should be caught and a 
new TITLE instance 
for the not yet existing GLOSSARYENTRY should be created.

Isn't it allowed to create other (local) bean instances during the creation of a bean?!

----------------------------------------------------------------------

Comment By: Thomas Hamann (thomash76)
Date: 2002-02-12 07:48

Message:
Logged In: YES 
user_id=445709

ok, i got it!

due to a change of my columns i mixed up some settings of column-name and declared-sql.
anyway, thanks for your help!

----------------------------------------------------------------------

Comment By: Thomas Hamann (thomash76)
Date: 2002-02-12 07:44

Message:
Logged In: YES 
user_id=445709

The following is in the log file...

2002-02-12 16:35:30,980 DEBUG 
[org.jboss.ejb.plugins.cmp.jdbc.JDBCDeclaredSQLQuery.jatek/GlossaryEntry.ejbSelectTitle]
 Executing SQL: 
SELECT DISTINCT uid_column, locale_column FROM TITLE WHERE locale=? and uid=?
2002-02-12 16:35:30,996 DEBUG 
[org.jboss.ejb.plugins.cmp.jdbc.JDBCDeclaredSQLQuery.jatek/GlossaryEntry.ejbSelectTitle]
 Set parameter: 
index=1, jdbcType=VARCHAR, value=de_DE
2002-02-12 16:35:30,996 DEBUG 
[org.jboss.ejb.plugins.cmp.jdbc.JDBCDeclaredSQLQuery.jatek/GlossaryEntry.ejbSelectTitle]
 Set parameter: 
index=2, jdbcType=BIGINT, value=768
2002-02-12 16:35:31,152 DEBUG 
[org.jboss.ejb.plugins.cmp.jdbc.JDBCDeclaredSQLQuery.jatek/GlossaryEntry.ejbSelectTitle]
 Find failed
java.sql.SQLException: ORA-00904: invalid column name
...

What i'm trying to do is: creating an instance of a local bean TITLE while in the 
ejbCreate() of the remote 
bean GLOSSARYENTRY.
It is likely to happen that the ejbSelectTitle() fails, because for a new 
GLOSSARYENTRY there are no 
existing TITLEs. But according to my code the FinderException should be caught and a 
new TITLE instance 
for the not yet existing GLOSSARYENTRY should be created.

Isn't it allowed to create other (local) bean instances during the creation of a bean?!

----------------------------------------------------------------------

Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-02-12 07:26

Message:
Logged In: YES 
user_id=251431

What is happing is JBossCMP is attempting to set your
HashMap column to null.  Is this column marked NOT NULL in
your database?  

I need some more information before I can look at this. 
Immedately before this exception in your server.log file you
should see a debug message that looks like this:

Set parameter: index=2, jdbcType=INTEGER, value=NULL

Can you post this in a follow up comment?

----------------------------------------------------------------------

Comment By: Thomas Hamann (thomash76)
Date: 2002-02-12 04:38

Message:
Logged In: YES 
user_id=445709

sorry, i forgot...
os: win2k
jdk: jdk1.3.1_01

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=516404&group_id=22866

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to