BLOB mapping with XDoclet tags
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, November 26, 2002 09:01 AM

Hello, We have problems when trying to work with a BLOB field within a CMP EntityBean (we use EJB2.0, XDoclet1.2beta1, Oracle9i). We wrote the following tags: /** * @return the image * @ejb.persistent-field * @ejb.interface-method  view-type="local" * @ejb.transaction  type="Supports" * @ejb.persistence  column-name="IMAGE"  jdbc-type="JAVA_OBJECT" sql-type="BLOB" */ public abstract Object getImage(); /** * Sets the image * @param data the image data * @ejb.transaction  type="Required" * @ejb.interface-method  view-type="local" */ public abstract v   More>>

Hello,


We have problems when trying to work with a BLOB field within a CMP
EntityBean (we use EJB2.0, XDoclet1.2beta1, Oracle9i). We wrote the following
tags:


			/**
			
* @return the image
* @ejb.persistent-field
* @ejb.interface-method  view-type="local"
* @ejb.transaction  type="Supports"
* @ejb.persistence  column-name="IMAGE"  jdbc-type="JAVA_OBJECT" sql-type="BLOB"
*/
public abstract Object getImage();
/**
* Sets the image
* @param data the image data
* @ejb.transaction  type="Required"
* @ejb.interface-method  view-type="local"
*/
public abstract void setImage(Object data);


Were are we wrong? When trying to call the create method of this entity bean,
we get the following logged exception:


			2002-11-26 17:21:23,344 ERROR [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.OrgUnitType] Could not create entity
			
javax.ejb.EJBException: Internal error setting parameters for field image; CausedByException is:
Invalid column type
at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setArgumentParameters(JDBCAbstractCMPFieldBridge.java:289)
at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setInstanceParameters(JDBCAbstractCMPFieldBridge.java:262)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.insertEntity(JDBCCreateEntityCommand.java:192)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:131)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:527)
at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:253)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:270)
at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:580)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1119)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:209)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:88)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:230)
at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
at $Proxy50.create(Unknown Source)
at com.creon.module.organization.ejb.impl.OrgUnitTypeManagerBean.createOrgUnitType(OrgUnitTypeManagerBean.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
......


Any idea would be valuable to us.

Thank you in advance, Cristina.

   <<Less

Re: BLOB mapping with XDoclet tags

Posted By:   Ara_Abrahamian  
Posted On:   Wednesday, November 27, 2002 01:45 PM

It doesn't seem to be a XDoclet problem. The jdbc driver or the db complains about the "BLOB" type.


Ara.

About | Sitemap | Contact