-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: IllegalArgumentException, GenericJDBCException
PostPosted: Mon Oct 31, 2005 7:16 pm 
Newbie

Joined: Mon Oct 31, 2005 7:04 pm
Posts: 2
I am trying to save a class to my database that represents information that I received from a payment service.

It is a basic class with the following structure, methods excluded.

protected String textRequest;
protected String textResponse;
protected String clientIp;
protected Date whenOccured;
protected String merchantId;
protected Integer databaseId;
protected String status;
protected Integer result;
protected String authCode;
protected Integer providerId;

Note that databaseId is my primary key with auto_increment turned on (MySQL 4.1).

I have it mapped appropriately.


<hibernate-mapping package="com.devotion.payment.model">
<class name="Transaction" table="Transactions">
<cache usage="transactional"/>
<id name="databaseId" column="databaseId" type="int">
<generator class="native"/>
</id>
<property name="textRequest" column="textRequest" not-null="true"/>
<property name="textResponse" column="textResponse" not-null="true"/>
<property name="clientIp" column="clientIp" not-null="true"/>
<property name="whenOccured" column="whenOccured" type="date" not-null="true"/>
<property name="merchantId" column="merchantId" not-null="true"/>
<property name="status" column="status" not-null="true"/>
<property name="result" column="result" not-null="true"/>
<property name="authCode" column="authCode"/>
<property name="providerId" column="providerId" not-null="true"/>
</class>
</hibernate-mapping>

What is strange is that when I call save, Hibernate throws a java.lang.IllegalArgumentException; but the a row is created in the table.

Hibernate: /* insert com.devotion.payment.model.Transaction */ insert into Transactions (textRequest, textResponse, clientIp, whenOccured, merchantId, status, result, authCode, providerId) values (?, ?, ?, ?, ?, ?, ?, ?, ?)
Oct 31, 2005 5:47:24 PM org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: -1, SQLState: S1000
Oct 31, 2005 5:47:24 PM org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: General error: java.lang.IllegalArgumentException

Query being executed when exception was thrown:

com.mysql.jdbc.ServerPreparedStatement[1] - /* insert com.devotion.payment.model.Transaction */ insert into Transactions (textRequest, textResponse, clientIp, whenOccured, merchantId, status, result, authCode, providerId) values ('', '', 'unknown', '2005-10-31', 'V63A0A942881', 'Declined', 12, '', 1)
org.hibernate.exception.GenericJDBCException: could not insert: [com.devotion.payment.model.Transaction]
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
Blah blah blah, nothing any more specific farther down the stack trace.

Does anyone else have experience with strange problems like this?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 31, 2005 10:05 pm 
Beginner
Beginner

Joined: Thu Jan 22, 2004 8:22 pm
Posts: 48
A JDBCReporterException generally means that your JDBC driver has thrown an exception. There are many possible causes. I've seen a incorrect mapping file cause the problem usually were the columns tpe wasn't properly declared. A incorrect dialect can cause it. Sometimes you can guess the cause but in many cases I've had to turn on call tracing in the JDBC driver to find out exactly what call is being made when the error is encountered.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.