-->
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.  [ 11 posts ] 
Author Message
 Post subject: junit fails with mysql
PostPosted: Mon Mar 01, 2004 10:58 pm 
Regular
Regular

Joined: Sat Feb 21, 2004 8:54 pm
Posts: 60
Location: Lakewood, California
using 2.1.2 and mysql server 4.0.18-9.

the first problem seems to have something to do with the case in the table name. the second one says he can not deserialize a long.

anybody got a clue?

thanks

from sql loader test:

SQLException occurred

net.sf.hibernate.JDBCException: SQLException occurred
at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3767)
at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)
at org.hibernate.test.SQLLoaderTest.testFindBySQLStar(SQLLoaderTest.java:64)
at org.hibernate.test.TestCase.runTest(TestCase.java:82)
Caused by: java.sql.SQLException: General error, message from server: "Table 'test.Category' doesn't exist"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1905)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1109)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1203)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2090)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1496)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:795)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:950)
at net.sf.hibernate.loader.Loader.list(Loader.java:941)
at net.sf.hibernate.loader.SQLLoader.list(SQLLoader.java:92)
at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3764)
... 14 more


from foo bar test:

could not deserialize

net.sf.hibernate.type.SerializationException: could not deserialize
at net.sf.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:194)
at net.sf.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:220)
at org.hibernate.test.FooBarTest.testPersistCollections(FooBarTest.java:2429)
at org.hibernate.test.TestCase.runTest(TestCase.java:82)
Caused by: java.lang.ClassNotFoundException: long
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:649)
at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:913)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:361)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:345)
at java.io.ObjectInputStream.inputArray(ObjectInputStream.java:1137)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at java.util.HashMap.readObject(HashMap.java:835)
at java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1406)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
at net.sf.hibernate.impl.SessionImpl.readObject(SessionImpl.java:449)
at java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1406)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at net.sf.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:190)
... 14 more

_________________
<http://tayek.com/>, co-chair <http://www.ocjug.org/>, actively
seeking telecommuting work. hate spam?
<https://www1.ietf.org/mailman/listinfo/asrg>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 02, 2004 12:31 am 
Regular
Regular

Joined: Mon Nov 24, 2003 6:36 pm
Posts: 105
table not found- I think i'd try to fix that prob first.

make sure your mysql user/name hibernate is using can see the table.

make sure it's not a mysql privs prob by logging in as the same user with same "host" as hibernate is on.
--James


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 02, 2004 3:59 am 
Regular
Regular

Joined: Sat Feb 21, 2004 8:54 pm
Posts: 60
Location: Lakewood, California
the eg sample runs fine. the problem with table.Category is that the table name in mysql appears to be category (not Category). so i think the maping is hosed somhow. i tried changing all of the "create"'s to "Create", but no joy.

has anyone ran into the case sensitive problem with mysql? i hear it may be peculiar to mysql since many rdbms'es are case insensitive while i believ that mysql is case sensitive (many of the table names were in camelcase like their corresponding classes).

thanks

_________________
<http://tayek.com/>, co-chair <http://www.ocjug.org/>, actively
seeking telecommuting work. hate spam?
<https://www1.ietf.org/mailman/listinfo/asrg>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 02, 2004 9:08 am 
Regular
Regular

Joined: Mon Nov 24, 2003 6:36 pm
Posts: 105
I should have noticed that- Mysql on unix platforms- table names seem to be case sensitive. Seems to be OS dependent. Change the mapping file to the correct case and all should be well.

James


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 02, 2004 3:00 pm 
Regular
Regular

Joined: Sat Feb 21, 2004 8:54 pm
Posts: 60
Location: Lakewood, California
yes, that;s what i am going to try to do.

thanks

_________________
<http://tayek.com/>, co-chair <http://www.ocjug.org/>, actively
seeking telecommuting work. hate spam?
<https://www1.ietf.org/mailman/listinfo/asrg>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 02, 2004 3:13 pm 
Regular
Regular

Joined: Sat Feb 21, 2004 8:54 pm
Posts: 60
Location: Lakewood, California
but just changing: table="category" to" table="Categgor" does not seem to work. maybe there is something else one must do.

thanks

_________________
<http://tayek.com/>, co-chair <http://www.ocjug.org/>, actively
seeking telecommuting work. hate spam?
<https://www1.ietf.org/mailman/listinfo/asrg>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 02, 2004 7:25 pm 
Regular
Regular

Joined: Sat Feb 21, 2004 8:54 pm
Posts: 60
Location: Lakewood, California
making the following changes got me further:

6c6
< table="category"
---
> table="Category"
38,39c38,39
< <return alias="category" class="org.hibernate.test.Category"/>
< <return alias="assignable" class="org.hibernate.test.Assignable"/>
---
> <return alias="Category" class="org.hibernate.test.Category"/>
> <return alias="Assignable" class="org.hibernate.test.Assignable"/>
43c43
< </hibernate-mapping>
\ No newline at end of file
---
> </hibernate-mapping>
66c66
< session.createSQLQuery("select {a.*} from A {a}", "a", A.class).list();
---
> session.createSQLQuery("select {A.*} from A {A}", "A", A.class).list();
331c331
< Query query = session.createSQLQuery("select identifier_column as {a.id}, clazz_discriminata as {a.class}, name as {a.name}, count_ as {a.count} from {a} s", "a", A.class);
---
> Query query = session.createSQLQuery("select identifier_column as {A.id}, clazz_discriminata as {A.class}, name as {A.name}, count_ as {A.count} from {A} s", "A", A.class);
371c371
< Query query = session.createSQLQuery("select identifier_column as {a.id}, clazz_discriminata as {a.class}, count_ as {a.count}, name as {a.name} from A", "a", A.class);
---
> Query query = session.createSQLQuery("select identifier_column as {A.id}, clazz_discriminata as {A.class}, count_ as {A.count}, name as {A.name} from A", "A", A.class);

now the foo bar test blows ram (but i thinki know a way to fix this) and i get a new exception in test outer join:

IllegalArgumentException occurred calling getter of org.hibernate.test.Jay.id

net.sf.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of org.hibernate.test.Jay.id
at net.sf.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:110)
at net.sf.hibernate.persister.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:307)
at net.sf.hibernate.proxy.HibernateProxyHelper.getIdentifier(HibernateProxyHelper.java:50)
at net.sf.hibernate.type.EntityType.toString(EntityType.java:85)
at net.sf.hibernate.type.PersistentCollectionType.toString(PersistentCollectionType.java:82)
at net.sf.hibernate.impl.Printer.toString(Printer.java:49)
at net.sf.hibernate.impl.Printer.toString(Printer.java:82)
at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2245)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2203)
at org.hibernate.test.MasterDetailTest.testOuterJoin(MasterDetailTest.java:47)
at org.hibernate.test.TestCase.runTest(TestCase.java:82)
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
at net.sf.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:96)
... 21 more

thanks

_________________
<http://tayek.com/>, co-chair <http://www.ocjug.org/>, actively
seeking telecommuting work. hate spam?
<https://www1.ietf.org/mailman/listinfo/asrg>


Top
 Profile  
 
 Post subject: can not deserialize a long in the foo bar test
PostPosted: Wed Mar 03, 2004 7:25 pm 
Regular
Regular

Joined: Sat Feb 21, 2004 8:54 pm
Posts: 60
Location: Lakewood, California
the previous error seems to have gone away. i am left with the problem of attempting to deserialize a long. this has been reported before a few times by other people, but apparently not solved. it looks like there is a: "long" in the serialized object and that that is causing the error. don't know who is putting the "long" there yet.

thanks.

still getting a: could not deserialize in the foo bar test.

net.sf.hibernate.type.SerializationException: could not deserialize
at net.sf.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:194)
at net.sf.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:220)
at org.hibernate.test.FooBarTest.testPersistCollections(FooBarTest.java:2429)
at org.hibernate.test.TestCase.runTest(TestCase.java:82)
Caused by: java.lang.ClassNotFoundException: long
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:288)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:649)
at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:913)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:361)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:345)
at java.io.ObjectInputStream.inputArray(ObjectInputStream.java:1137)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at java.util.HashMap.readObject(HashMap.java:835)
at java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1406)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
at net.sf.hibernate.impl.SessionImpl.readObject(SessionImpl.java:449)
at java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1406)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at net.sf.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:190)
... 14 more

_________________
<http://tayek.com/>, co-chair <http://www.ocjug.org/>, actively
seeking telecommuting work. hate spam?
<https://www1.ietf.org/mailman/listinfo/asrg>


Top
 Profile  
 
 Post subject: seems to be a 1.3 problem
PostPosted: Thu Mar 04, 2004 3:11 am 
Regular
Regular

Joined: Sat Feb 21, 2004 8:54 pm
Posts: 60
Location: Lakewood, California
we get the deaerialize long problem on 3 flavours of java 1.3; while two versions of 1.4 pass the tests ok. unfortunately our production stuff compiles and runs on 1.3 :(

_________________
<http://tayek.com/>, co-chair <http://www.ocjug.org/>, actively
seeking telecommuting work. hate spam?
<https://www1.ietf.org/mailman/listinfo/asrg>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 04, 2004 4:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Try recompiling Hibernate on your target VM.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 08, 2004 6:38 pm 
Regular
Regular

Joined: Sat Feb 21, 2004 8:54 pm
Posts: 60
Location: Lakewood, California
been doing that. i get the can not deserialize long (see junit report and ant output below). it does this when compiled and run from windoze xp and 1.3.1_09-b03 or deadrat 7.2 and 1.3.1_04-b02. but when i compile with 1.3 and run using a 1.4.2_03, then all of the tests pass.

thanks

testPersistCollections Error could not deserialize

net.sf.hibernate.type.SerializationException: could not deserialize
at net.sf.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:194)
at net.sf.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:220)
at org.hibernate.test.FooBarTest.testPersistCollections(FooBarTest.java:2429)
at org.hibernate.test.TestCase.runTest(TestCase.java:82)
Caused by: java.lang.ClassNotFoundException: long
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:649)
at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:913)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:361)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:345)
at java.io.ObjectInputStream.inputArray(ObjectInputStream.java:1137)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at java.util.HashMap.readObject(HashMap.java:835)
at java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1406)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
at net.sf.hibernate.impl.SessionImpl.readObject(SessionImpl.java:449)
at java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1406)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at net.sf.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:190)
... 14 more

[taskdef] Could not load definitions from resource clovertasks. It could not be found.

splash:

cleantestdb:

init:
[echo] Build Hibernate-2.1 (2004-03-08 02:03:38)
[mkdir] Created dir: /Z/Users/ray/java/unpacked/hibernate-2.1/build
[copy] Copying 9 files to /Z/Users/ray/java/unpacked/hibernate-2.1/build

compile:
[javac] Compiling 463 source files to /Z/Users/ray/java/unpacked/hibernate-2.1/build

compiletest:
[javac] Compiling 107 source files to /Z/Users/ray/java/unpacked/hibernate-2.1/build

junit:
[mkdir] Created dir: /Z/Users/ray/java/unpacked/hibernate-2.1/testout
[junit] Running org.hibernate.test.ABCProxyTest
[junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 5.568 sec
[junit] Running org.hibernate.test.ABCTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 4.551 sec
[junit] Running org.hibernate.test.CacheTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 1.385 sec
[junit] Running org.hibernate.test.FooBarTest
[junit] Tests run: 99, Failures: 0, Errors: 1, Time elapsed: 51.429 sec
[junit] TEST org.hibernate.test.FooBarTest FAILED
[junit] Running org.hibernate.test.FumTest
[junit] Tests run: 11, Failures: 0, Errors: 0, Time elapsed: 22.484 sec
[junit] Running org.hibernate.test.MasterDetailTest
[junit] Tests run: 27, Failures: 0, Errors: 0, Time elapsed: 8.251 sec
[junit] Running org.hibernate.test.MultiTableTest
[junit] Tests run: 13, Failures: 0, Errors: 0, Time elapsed: 7.601 sec
[junit] Running org.hibernate.test.ODMGTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 19.524 sec
[junit] Running org.hibernate.test.ParentChildTest
[junit] Tests run: 16, Failures: 0, Errors: 0, Time elapsed: 21.887 sec
[junit] Running org.hibernate.test.QueryByExampleTest
[junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 4.57 sec
[junit] Running org.hibernate.test.SQLFunctionsTest
[junit] Tests run: 9, Failures: 0, Errors: 0, Time elapsed: 5.341 sec
[junit] Running org.hibernate.test.SQLLoaderTest
[junit] Tests run: 12, Failures: 0, Errors: 0, Time elapsed: 5.904 sec

junitreport:
[junitreport] Using Xalan version: Xalan Java 2.4.0
[junitreport] Transform time: 2931ms

BUILD SUCCESSFUL
Total time: 3 minutes 12 seconds

_________________
<http://tayek.com/>, co-chair <http://www.ocjug.org/>, actively
seeking telecommuting work. hate spam?
<https://www1.ietf.org/mailman/listinfo/asrg>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 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.