[Hibernate-JIRA] Created: (HHH-6642) NullPointerException in method AbstractReadWriteEhcacheAccessStrategy.handleLockExpiry
by Guenther Demetz (JIRA)
NullPointerException in method AbstractReadWriteEhcacheAccessStrategy.handleLockExpiry
--------------------------------------------------------------------------------------
Key: HHH-6642
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6642
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2)
Affects Versions: 4.0.0.CR2
Environment: Hiberante4.0.0CR2, SQLServer 2008
Reporter: Guenther Demetz
Priority: Trivial
javax.persistence.RollbackException: Error while committing the transaction
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:90)
at com.wuerth.phoenix.bcserver.base.PhoenixSession.executeCommit(PhoenixSession.java:642)
at com.wuerth.phoenix.bcserver.base.PhoenixSession.transactionInternalCommit(PhoenixSession.java:546)
at com.wuerth.phoenix.bcserver.base.PhoenixSession.transactionCommit(PhoenixSession.java:507)
at com.wuerth.phoenix.bcserver.base.TransactionContext.commit(TransactionContext.java:260)
at com.wuerth.phoenix.test.bart.roles.peers.RefreshOnTimestampTest.testcreateDanglingChildDueRefresh(RefreshOnTimestampTest.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:91)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.hibernate.AssertionFailure: Exception releasing cache locks
at org.hibernate.engine.spi.ActionQueue$AfterTransactionCompletionProcessQueue.afterTransactionCompletion(ActionQueue.java:611)
at org.hibernate.engine.spi.ActionQueue.afterTransactionCompletion(ActionQueue.java:211)
at org.hibernate.internal.SessionImpl.afterTransactionCompletion(SessionImpl.java:527)
at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.afterTransaction(TransactionCoordinatorImpl.java:145)
at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.afterTransactionCompletion(JdbcTransaction.java:137)
at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:182)
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:73)
... 24 more
Caused by: java.lang.NullPointerException
at org.hibernate.cache.ehcache.internal.strategy.AbstractReadWriteEhcacheAccessStrategy.handleLockExpiry(AbstractReadWriteEhcacheAccessStrategy.java:182)
at org.hibernate.cache.ehcache.internal.strategy.AbstractReadWriteEhcacheAccessStrategy.unlockItem(AbstractReadWriteEhcacheAccessStrategy.java:158)
at org.hibernate.cache.ehcache.internal.nonstop.NonstopAwareCollectionRegionAccessStrategy.unlockItem(NonstopAwareCollectionRegionAccessStrategy.java:206)
at org.hibernate.action.internal.CollectionAction$CacheCleanupProcess.doAfterTransactionCompletion(CollectionAction.java:195)
at org.hibernate.engine.spi.ActionQueue$AfterTransactionCompletionProcessQueue.afterTransactionCompletion(ActionQueue.java:604)
... 30 more
Scenario is following:
Transaction - commit fails --> rollback --> open new Transaction --> commit --> reported NPE exception
Fix:
diff AbstractReadWriteEhcacheAccessStrategy.java /home/pb00067/hibernate-ehcache4.0.0CR2/src/org/hibernate/cache/ehcache/internal/strategy/AbstractReadWriteEhcacheAccessStrategy.java
182c182
< LOG.softLockedCacheExpired( region.getName(), key, lock.toString() );
---
> LOG.softLockedCacheExpired( region.getName(), key, lock != null ? lock.toString() : "null");
N.B.: As the fix is trivial, please save me this time from the duty to provide a testcase ;-)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-921) NullPointerException in AvroSerializationProvider due to wrong resource path
by Hardy Ferentschik (JIRA)
NullPointerException in AvroSerializationProvider due to wrong resource path
----------------------------------------------------------------------------
Key: HSEARCH-921
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-921
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 4.0.0.Beta1
Reporter: Hardy Ferentschik
Priority: Critical
Fix For: 4.0.0.Beta2
>From AvroSerializationProvider:
{code}
private void parseSchema(String filename) {
String fullFileName = V1_PATH + filename + ".avro";
fullFileName = fullFileName.replace( '/', File.separatorChar );
InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream( fullFileName );
String messageSchemaAsString;
try {
messageSchemaAsString = readInputStream( in, fullFileName );
}
finally {
try {
in.close();
}
catch ( IOException e ) {
//we don't care
}
}
schemas.put( filename, messageSchemaAsString );
}
{code}
the problem is:
{code}
fullFileName = fullFileName.replace( '/', File.separatorChar );
{code}
Since the files are loaded from the jar the forward slash has to be used regardless. On windows you will get a wrong file name and the loading of the resource will fail.
See also: https://forum.hibernate.org/viewtopic.php?f=9&t=1012548
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Created: (HBX-1191) Reverse engineer one-to-one
by Erki (JIRA)
Reverse engineer one-to-one
----------------------------
Key: HBX-1191
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1191
Project: Hibernate Tools
Issue Type: Bug
Components: reverse-engineer
Affects Versions: 3.2LATER
Environment: eclipse indigo 64bit, postgresql 9.1 64bit, java 6 64bit, windows 7 64bit
Reporter: Erki
Attachments: hibernate.reveng.xml, hib_tools_one_to_one_create.sql
Hello, I'm using the latest development milestone of hibernate tools 3.4.0.v20110915-1559-H24-M3.
I am trying to reverse egineer the tables defined in the attached creeation sql file using the attached reveng file.
Table parent has just an id column.
Tables child and child2 have an id column and an unique parent_id column which references the parent.id.
If I try to reverse engineer the parent with 2 child tables, I get an exception saying that parent table class does not exist.
org.test.hibernate.MappingException: An association from the table child refers to an unmapped class: ee.hibernate.reveng.generated.Parent
An association from the table child refers to an unmapped class: ee.test.hibernate.reveng.generated.Parent
<No message>
If try to reverse engineer the parent with only 1 child, it succeeds.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Created: (HHH-6162) SessionFactory in QueryKey
by Pawel Omelko (JIRA)
SessionFactory in QueryKey
--------------------------
Key: HHH-6162
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6162
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 4.0.0.Alpha2, 3.6.3, 4.0.0.Alpha1, 3.6.2
Environment: Hibernate 3.6.2, Postgresql 8.3
Reporter: Pawel Omelko
Priority: Blocker
I guess that after improvement HHH-5138, a ManyToOneType.java (and many other types) has reference to SessionFactory (by TypeFactory.TypeScope scope field). And now QueryKey, which contains Type[] positionalParameterTypes field, contains also SessionFactory - eg. ManyToOneType. So now we can find SessionFactory in QueryCache elements, which unnecessarily increase memory usage. There is another problem when cache replication is used (ehcache via RMI), I've got an exception during SessionFactory deserialization in receiver node:
Apr 27 06:17:58 WARN net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator:320 - Unable to send message to remote peer. Message was: null
Apr 27 06:17:58 java.lang.NullPointerException
Apr 27 06:17:58 at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
Apr 27 06:17:58 at org.hibernate.impl.SessionFactoryObjectFactory.getNamedInstance(SessionFactoryObjectFactory.java:159)
Apr 27 06:17:58 at org.hibernate.impl.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:753)
Apr 27 06:17:58 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Apr 27 06:17:58 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Apr 27 06:17:58 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Apr 27 06:17:58 at java.lang.reflect.Method.invoke(Method.java:597)
Apr 27 06:17:58 at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1061)
Apr 27 06:17:58 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
Apr 27 06:17:58 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
Apr 27 06:17:58 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
Apr 27 06:17:58 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
Apr 27 06:17:58 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
Apr 27 06:17:58 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
Apr 27 06:17:58 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
Apr 27 06:17:58 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
Apr 27 06:17:58 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
Apr 27 06:17:58 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
Apr 27 06:17:58 at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
Apr 27 06:17:58 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
Apr 27 06:17:58 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
Apr 27 06:17:58 at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:480)
Apr 27 06:17:58 at org.hibernate.cache.QueryKey.readObject(QueryKey.java:192)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months