Pelle,
I ran into this yesterday. The problem is Jaws doesn't understand how to
handle cmp fields of type char. Jaws has a list of primative types and
associated methods in java.lang.ResultSet that return the primative type.
If you take a look at ResultSet, you will notice that there are no methods
that return or take a char of java.lang.Character. JDBC expects the char
type to be turned into strings. I have fixed this in the my working copy of
the new cmp 2.x code but that doesn't help you. I suggest that you switch
the field to a String and check in the setter that is is only one characer.
You can also use the transient field trick. For example:
public transient char oldField;
public String newField;
public void ejbLoad() {
oldField = newField.charAt(0);
}
public void ejbStore() {
newField = "" + oldField;
}
or something simmilar (I may have mistyped something). If this represents
the end of the world for you, you could convince me to fix jaws, but it will
just make the CMP 2.x stuff take longer.
Dain Sundstrom
> -----Original Message-----
> From: Pelle Poluha [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 29, 2001 5:23 AM
> To: [EMAIL PROTECTED]
> Subject: [JBoss-user] RE: SQLException: Unable to load a ResultSet
> column into a variable of type 'char'
>
>
> I get the exception when JBoss has created the rows too. But if I do a
> create just before reading (in this case with findAll), it
> works. Maybe the
> data is cached somewhere so that JBoss doesn't have to load
> the data from
> the db. But when I restart my client and tries to get the data (with
> findAll) I get the exception stated below.
>
> > -----Original Message-----
> > From: Pelle Poluha [mailto:[EMAIL PROTECTED]]
> > Sent: den 29 juni 2001 10:40
> > To: '[EMAIL PROTECTED]'
> > Subject: SQLException: Unable to load a ResultSet column into
> > a variable
> > of type 'char'
> >
> >
> > Hello!
> >
> > I get this strange error. It only happens when I have
> > manually loaded the db (MySql) with 'insert into project
> > values(...)', not when I let Jboss create the rows.
> >
> > Any ideas?
> >
> > Regards,
> > Pelle Poluha
> > (using JBoss 2.2.2 on Win2K, JDK 1.3.1, MySQL)
> >
> > [Project] TRANSACTION ROLLBACK EXCEPTION:Load failed; nested
> > exception is:
> > java.sql.SQLException: Unable to load a ResultSet
> > column into a variable
> > of type 'char': java.io.StreamCorruptedException: Caught
> > EOFException while rea
> > ding the stream header; 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 'char': java.io.StreamCorruptedException: Caught
> > EOFException while rea
> > ding the stream header
> >
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user