I have changed that, but it does not help.

Have a look at my jaws.xml and jdbc-type for pk.
<jaws>
   <enterprise-beans>
      <entity>
         <ejb-name>Application</ejb-name>
         <table-name>APPLICATION</table-name>
         <cmp-field>
            <field-name>pk</field-name>
            <column-name>PK</column-name>
            <jdbc-type>JAVA_OBJECT</jdbc-type>
            <sql-type>VARCHAR(250)</sql-type>
         </cmp-field>
         <cmp-field>
            <field-name>name</field-name>
            <column-name>NAME</column-name>
            <jdbc-type>VARCHAR</jdbc-type>
            <sql-type>VARCHAR(255)</sql-type>
         </cmp-field>
         <cmp-field>
            <field-name>description</field-name>
            <column-name>DESCRIPTION</column-name>
            <jdbc-type>VARCHAR</jdbc-type>
            <sql-type>VARCHAR(255)</sql-type>
         </cmp-field>
         
      </entity>
   </enterprise-beans>
</jaws>
Is it correct ?
>From the examples on the Web, they supply INTEGER so I guess I should
put VARCHAR here.
When I change it to VARCHAR, I receive Exception on the server.
Default] JBoss PRE-2.1 Started
    DEBUG [RMI TCP Connection(4)-192.168.0.1]
com.hm.base.services.OrganizationServiceBean     - Executing
setSessionContext
0   DEBUG [RMI TCP Connection(4)-192.168.0.1]
com.hm.base.services.OrganizationServiceBean     - Executing ejbCreate
0   DEBUG [RMI TCP Connection(4)-192.168.0.1]
com.hm.base.services.OrganizationServiceImpl     - Executing
findApplication
0   DEBUG [RMI TCP Connection(4)-192.168.0.1]
com.hm.base.domain.ApplicationCMPBean     - Executing setEntityContext
30  DEBUG [RMI TCP Connection(4)-192.168.0.1]
com.hm.base.domain.ApplicationCMPBean     - Executing ejbActivate
Application] TRANSACTION ROLLBACK EXCEPTION:Load failed; nested
exception is:
       java.sql.SQLException: Unable to load a ResultSet column into a
variable of type 'com.hm.base.detail.GeneralPK':
java.io.StreamCorruptedException: InputStream does not contain a
serialized object; nested exception is:
       java.rmi.ServerException: Load failed; nested exception is:
       java.sql.SQLException: Unable to load a ResultSet column into a
variable of type 'com.hm.base.detail.GeneralPK':
java.io.StreamCorruptedException: InputStream does not contain a
serialized object
Application] java.rmi.ServerException: Load failed; nested exception
is:
Application]   java.sql.SQLException: Unable to load a ResultSet column
into a variable of type 'com.hm.base.detail.GeneralPK':
java.io.StreamCorruptedException: InputStream does not contain a
serialized object
Application] java.sql.SQLException: Unable to load a ResultSet column
into a variable of type 'com.hm.base.detail.GeneralPK':
java.io.StreamCorruptedException: InputStream does not contain a
serialized object
Application]   at
org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.getResultObject(JDBCCommand.java:463)
Application]   at
org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.handleResult(JDBCLoadEntityCommand.java:114)
Application]   at
org.jboss.ejb.plugins.jaws.jdbc.JDBCQueryCommand.executeStatementAndHandleResult(JDBCQueryCommand.java:59)
Application]   at
org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:158)
Application]   at
org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:77)


-----Message d'origine-----
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]De la part de Rickard �berg
Envoy� : jeudi 28 d�cembre 2000 14:15
� : jBoss
Objet : Re: [jBoss-User] EJB PrimaryKey not primitive, Jaws Type
Mapping
andfindBPK


Hi!

Vincent Harcq wrote:
> I have one CMP that use a String as PK.
> I create a findBPK method, test it.
> No problems.
> 
> Then I change my PK to a GeneralPK class, change my ejb-jar.xml
files,
> chnage create,ejbcreate,fBPK and ejbFBPK methods, add a jaws.xml
file.
> Then my fBPK method returns no more data.
> I have set my JDBCCommand.java to debug
> 
> The "select count" statement is correct but with JAVA_OBJECT instead
of
> String and it seems to return 0 instead of 1.

Well, if all you did was change the String to GeneralPK that sounds
perfectly normal.

I am assuming now that your GeneralPK class has a String field, and
it's
really *that* field you want to use as pk, right? And your bean has a
CMP field with the same name, correct?

If so you need to remove the "primkey-field" from your ejb-jar.xml
file,
becuase it is not used for complex keys.

/Rickard

-- 
Rickard �berg

Email: [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]



__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to