Thanks for your help.
Look like it's a bug from Tomcat.
If the jar of my appli are in the shared/lib, I get the exception.
If packaged with my app, mo problem !!
"ThanksButNo" <no.no.thanks@gmail.com> a écrit dans le message de news:
4243afbe-c3ca-4bcb-b952-499e9364cdb3...oglegroups.com...
> On Mar 7, 10:56 am, lark <ham...@sbcglobal.net> wrote:
>> 1 connu wrote:
>> > Hi,
>>
>> > When trying to commit an insert from a java app, I get a
>> > NullPointerException
>> > The data is saved correctly in the database !
>>
>> > Thanks in advance for any help.
>> > Pierre
>>
>> > Trace :
>> > INFO QueryLogger: INSERT INTO documentComite (dateCreation, isPublie,
>> > membreId, nomFichier, titre, url) VALUES (?, ?, ?,
>> > ?, ?, ?)
>> > INFO QueryLogger: [bind: '2008-03-07 03:30:40.913', NULL, 60,
>> > 'optionMembres.PNG', 'Choose title',
>> > '/Pharmaco/FichierComite/optionMembres.PNG']
>> > INFO QueryLogger: *** error.
>> > java.lang.NullPointerException
>> > at com.mysql.jdbc.Field.getMaxBytesPerCharacter(Field .java:259)
>> > at
>> > com.mysql.jdbc.ResultSetMetaData.getColumnDisplayS ize(ResultSetMetaData.java:331)
>> > at
>> > org.apache.cayenne.access.jdbc.ColumnDescriptor.(C olumnDescriptor.java:156)
>>
>> looks like you're trying to insert null in a feild that doesn't take
>> null.
>
> I would double-check the Java code that does the insert.
>
> I would expect that trying to insert a null value into a column that
> doesn't take null should generate a Database error, not a Java
> NullPointerException. Plus, it should reject the entire insert
> attempt.
>
> There might be a bug in the driver, but I'd recommend going through
> your own code with a fine-tooth comb.