Hello.  I have an entity bean.  Let's call it, Joemama.  It uses CMP. 
I'm trying to create an instance of that entity bean, so I call a create
method on its home interface.  When JBoss attempts to insert a row into
the database for this new bean instance, it calls
PreparedStatement.setBinaryStream() for a column and the JDBC driver
throws an exception saying that 'InputStream as parameter not
supported'.  I have a feeling JBoss might be trying to call
setBinaryStream() on a column for which setBinaryStream wouldn't make
sense.  In fact, the table definition for storing the Joemama bean,
created by JBoss using the PostGreSQL mapping is as follows:

        Table "joemama"
 Attribute |  Type   | Modifier 
-----------+---------+----------
 version   | integer | 
 catalog   | text    | 
 modified  | oid     | 
 type      | oid     | 
 created   | oid     | 
 id        | integer | 

It's not clear to me that you'd want to call setBinaryStream() on any of
those columns, but then again, I'm not sure about those oid columns. 
The actual stack trace from the server log looks like this:

[Joemama] BaseItemBean: ejbCreate()
[JAWS] InputStream as parameter not supported
[JAWS]  at
org.postgresql.jdbc2.PreparedStatement.setBinaryStream(PreparedStatement.java:417)
[JAWS]  at
org.opentools.minerva.jdbc.PreparedStatementInPool.setBinaryStream(PreparedStatementInPool.java:252)
[JAWS]  at
org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.setParameter(JDBCCommand.java:326)
[JAWS]  at
org.jboss.ejb.plugins.jaws.jdbc.JDBCCreateEntityCommand.setParameters(JDBCCreateEntityCommand.java:165)
[JAWS]  at
org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:159)
[JAWS]  at
org.jboss.ejb.plugins.jaws.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:135)
[JAWS]  at
org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.createEntity(JAWSPersistenceManager.java:122)
[JAWS]  at
org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:207)
[JAWS]  at
org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:441)
[JAWS]  at java.lang.reflect.Method.invoke(Native Method)
[JAWS]  at
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:639)
[JAWS]  at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:160)
[JAWS]  at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:87)
(snipped to protect the innocent reader from what in reality is a very
long call stack)

At any rate, I'm not really sure why this is happening or what I can do
about it.  It looks like it might be a bug in JBoss's CMP code, or it
may be the result of something screwy I've done.  Any ideas?

I've tried to run JBoss in jdb, but that didn't work for some reason. 
Hung when I asked it list threads.  I may download Forte and check out
that debugger.  

This is very strange, though, since I have another entity bean which is
effectively identical to Joemama, same table structure, same CMP fields,
and it works fine.  The table in the database is identical, the code in
the Bean class is identical, and I even copied the same deployment
descriptor and only changed the name.  Go figure.  If anybody has any
ideas, please let me know.  I'll include the deployment descriptor for
Joemama below.
 
Thanks,
Chris Rossi

   <entity>
      <description>
        An item
      </description>
      <ejb-name>Joemama</ejb-name>
      <home>com.webslingerZ.chutney.beans.JoemamaHome</home>
      <remote>com.webslingerZ.chutney.beans.Joemama</remote>
      <ejb-class>com.webslingerZ.chutney.beans.JoemamaBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <!-- Note: the prim-key-class below is not an error -->
     
<prim-key-class>com.webslingerZ.chutney.beans.ItemPK</prim-key-class>
      <reentrant>False</reentrant>
      <cmp-field><field-name>catalog</field-name></cmp-field>
      <cmp-field><field-name>version</field-name></cmp-field>
      <cmp-field><field-name>id</field-name></cmp-field>
      <cmp-field><field-name>type</field-name></cmp-field>
      <cmp-field><field-name>created</field-name></cmp-field>
      <cmp-field><field-name>modified</field-name></cmp-field>
      <ejb-ref>
        <ejb-ref-name>ejb/Catalog</ejb-ref-name>
        <ejb-ref-type>Entity</ejb-ref-type>
        <home>com.webslingerZ.chutney.beans.CatalogHome</home>
        <remote>com.webslingerZ.chutney.beans.Catalog</remote>
        <ejb-link>Catalog</ejb-link>
      </ejb-ref>
      <resource-ref>
        <description>DataSource for the database</description>
        <res-ref-name>jdbc/PostgresqlTest</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>
    </entity>

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to