openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From justin_gru...@us.ibm.com
Subject Getting PersistenceException due to MalformedInputException OR corrupt ResultList
Date Thu, 12 Jun 2008 14:44:42 GMT
We are getting a problem that is only occurring with one very large 
database (over 40,000 rows):  when we make a certain query 
(org.apache.openjpa.persistence.QueryImpl.getResultList()), instead of 
getting a List of persistent objects, openJPA is throwing a 
PersistenceException which it claims is caused by a 
MalformedInputException.  OpenJPA seems to think that one of the columns 
on one of the rows has non-UTF-8 data in it. 

Unfortunately, openJPA does not include any logging code in 
ResultSetResult or in any of the places that might illuminate which column 
or which row is causing this error.  I've had to resort to brute force by 
manipulating the data in the table so different parts of it are returned 
by the query, in order to see if I can narrow it down.  (Although in fact 
I?m not convinced that there really IS invalid data in the table -- if you 
run the SQL query manually you get the results with no error). 

Now that I'm down to only about 2,500 rows, what I?m seeing is even 
weirder:  sometimes when the query runs, it does throw the exception 
below.  Other times (unpredictably), *on the very same data set*, when the 
query runs, it DOES return a list, but the list of objects is corrupt: 
specifically, the first 26 rows seem to be repeated over and over again: 
that is, after you pull the 26th java object out of the Collection, you 
get a java object that is identical to the first one, and so on down the 
line.  I know that the table doesn't contain any duplicate rows, so I know 
that this is a problem in the openJPA logic that converts the SQL results 
into persistent objects. 

Justin Grunau

Exception stack trace below:

<openjpa-1.0.0-r420667:568756 nonfatal general error> 
org.apache.openjpa.persistence.PersistenceException: Input length = 24346 
        at 
org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:3849) 

        at 
org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:458) 

        at 
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:97) 
        at 
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:83) 
        at 
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:59) 
        at 
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:260) 

        at 
org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:111)


        at 
org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57) 

        at 
org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:843) 
        at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:801) 
        at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:723) 
        at 
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:776) 

        at 
org.apache.openjpa.jdbc.kernel.GenericResultObjectProvider.getResultObject(GenericResultObjectProvider.java:93)


        at 
org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:36) 

        at 
org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1223) 
        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:990) 

        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:799) 

        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:769) 

        at 
org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:533) 

        at 
org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:235) 
        at 
org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:277) 

        at 
cattail.dao.openjpa.OpenJPACattailDao.fetchAll(OpenJPACattailDao.java:324) 

        at 
cattail.dao.openjpa.OpenJPACattailDao.getAllUnindexedFilesAsOf(OpenJPACattailDao.java:1861)


        at cattail.lucene.ItemIndexingJob.execute(ItemIndexingJob.java:47) 

        at org.quartz.core.JobRunShell.run(JobRunShell.java:202) 
        at 
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529) 

Caused by: 
com.ibm.db2.jcc.c.SqlException: Input length = 24346 
        at com.ibm.db2.jcc.c.eb.a(eb.java:1613) 
        at com.ibm.db2.jcc.c.eb.n(eb.java:451) 
        at com.ibm.db2.jcc.c.eb.H(eb.java:1156) 
        at com.ibm.db2.jcc.c.bh.getString(bh.java:870) 
        at 
org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:174) 

        at 
org.apache.openjpa.lib.jdbc.DelegatingResultSet.getString(DelegatingResultSet.java:118) 

        at 
org.apache.openjpa.jdbc.sql.DBDictionary.getString(DBDictionary.java:712) 
        at 
org.apache.openjpa.jdbc.sql.ResultSetResult.getStringInternal(ResultSetResult.java:452) 

        at 
org.apache.openjpa.jdbc.sql.AbstractResult.getString(AbstractResult.java:724) 

        at 
org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy.load(StringFieldStrategy.java:155)


        at 
org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:789) 
        at 
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:833) 

        at 
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:785) 

        at 
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:336)


        at 
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:255) 

        ... 20 more 
Caused by: 
java.nio.charset.MalformedInputException: Input length = 24346 
        at com.ibm.db2.jcc.c.t.a(t.java:19) 
        at com.ibm.db2.jcc.c.eb.a(eb.java:1609) 
        ... 34 more 
Caused by: 
sun.io.MalformedInputException 
        at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:278) 
        at com.ibm.db2.jcc.c.t.a(t.java:16) 
        ... 35 more 
ErrorLogger.schedulerError: Job (Cattail.Lucene Item Change Queue Startup 
threw an exception. 
org.quartz.SchedulerException: Job threw an unhandled exception. [See 
nested exception: <openjpa-1.0.0-r420667:568756 nonfatal general error> 
org.apache.openjpa.persistence.PersistenceException: Input length = 24346] 

        at org.quartz.core.JobRunShell.run(JobRunShell.java:213) 
        at 
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529) 

Caused by: 
<openjpa-1.0.0-r420667:568756 nonfatal general error> 
org.apache.openjpa.persistence.PersistenceException: Input length = 24346 
        at 
org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:3849) 

        at 
org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:458) 

        at 
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:97) 
        at 
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:83) 
        at 
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:59) 
        at 
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:260) 

        at 
org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:111)


        at 
org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57) 

        at 
org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:843) 
        at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:801) 
        at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:723) 
        at 
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:776) 

        at 
org.apache.openjpa.jdbc.kernel.GenericResultObjectProvider.getResultObject(GenericResultObjectProvider.java:93)


        at 
org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:36) 

        at 
org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1223) 
        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:990) 

        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:799) 

        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:769) 

        at 
org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:533) 

        at 
org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:235) 
        at 
org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:277) 

        at 
cattail.dao.openjpa.OpenJPACattailDao.fetchAll(OpenJPACattailDao.java:324) 

        at 
cattail.dao.openjpa.OpenJPACattailDao.getAllUnindexedFilesAsOf(OpenJPACattailDao.java:1861)


        at cattail.lucene.ItemIndexingJob.execute(ItemIndexingJob.java:47) 

        at org.quartz.core.JobRunShell.run(JobRunShell.java:202) 
        ... 1 more 
Caused by: 
com.ibm.db2.jcc.c.SqlException: Input length = 24346 
        at com.ibm.db2.jcc.c.eb.a(eb.java:1613) 
        at com.ibm.db2.jcc.c.eb.n(eb.java:451) 
        at com.ibm.db2.jcc.c.eb.H(eb.java:1156) 
        at com.ibm.db2.jcc.c.bh.getString(bh.java:870) 
        at 
org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:174) 

        at 
org.apache.openjpa.lib.jdbc.DelegatingResultSet.getString(DelegatingResultSet.java:118) 

        at 
org.apache.openjpa.jdbc.sql.DBDictionary.getString(DBDictionary.java:712) 
        at 
org.apache.openjpa.jdbc.sql.ResultSetResult.getStringInternal(ResultSetResult.java:452) 

        at 
org.apache.openjpa.jdbc.sql.AbstractResult.getString(AbstractResult.java:724) 

        at 
org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy.load(StringFieldStrategy.java:155)


        at 
org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:789) 
        at 
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:833) 

        at 
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:785) 

        at 
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:336)


        at 
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:255) 

        ... 20 more 
Caused by: 
java.nio.charset.MalformedInputException: Input length = 24346 
        at com.ibm.db2.jcc.c.t.a(t.java:19) 
        at com.ibm.db2.jcc.c.eb.a(eb.java:1609) 
        ... 34 more 
Caused by: 
sun.io.MalformedInputException 
        at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:278) 
        at com.ibm.db2.jcc.c.t.a(t.java:16) 
        ... 35 more




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message