-->
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: Upgrade problem
PostPosted: Fri May 04, 2007 2:19 pm 
Senior
Senior

Joined: Mon Jul 24, 2006 8:43 am
Posts: 160
Hibernate version:
Annoations: Version: 3.3.0.GA, Core: version 3.2.3 GA, Entity Manager Version: 3.3.1.GA

Hi,
I am trying to upgrade from:

Annotations: Version: 3.2.0 CR1, 13.05.2006
Core: version 3.2 cr2, May 5, 2006
EntityManager: Version: 3.2.0.CR1, 13.05.2006

to the latest hibernate version listed above.

Upon start up I get a null pointer exception with no stack trace.

Upon inspection and examination of Hibernation log:

19:16:24,119 DEBUG CollectionSecondPass:41 - Second pass for collection: com.fineos.ta3g.test.garage.Person.family
19:16:24,119 DEBUG CollectionBinder:1023 - Binding as ManyToMany: com.fineos.ta3g.test.garage.Person.family
Failed to invoke suite():javax.persistence.PersistenceException: java.lang.NullPointerException

It appears that hibernate has a problem with how I use the OrderBy annotation.
Because when I remove the OrderBy annotation, I don't get this problem.

I am using compound primary keys.

Here is an example of how it is defined:

Code:
@ManyToMany
    @JoinTable(name="RPERSONPERSONFAMILY", joinColumns={@JoinColumn(name="C_FROM", referencedColumnName="C"),
            @JoinColumn(name="I_FROM", referencedColumnName="I")},
            inverseJoinColumns={@JoinColumn(name="C_TO", referencedColumnName="C"),
            @JoinColumn(name="I_TO", referencedColumnName="I")})
    @OrderBy("pk.c, pk.i ASC")
    private List <Person> family = new ArrayList();



I didn't have this problem in the last version I was using


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 04, 2007 2:45 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Which @OrderBy are you using, the javax.persistence or the o.h.annotations one?

Also a complete stacktrace plus the info to repruduce the issue will help

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 08, 2007 6:14 am 
Senior
Senior

Joined: Mon Jul 24, 2006 8:43 am
Posts: 160
Hi,
I am using the javax.persistence.OrderBy.
There is no stack trace, when I turn on full hibernate logging I get below:
[I will put code in separate post]

Code:
11:14:44,741 DEBUG Ejb3Configuration:202 - Look up for persistence unit: h-source
11:14:44,741 DEBUG Ejb3Configuration:214 - Analyse of persistence.xml: jar:file:/D:/ta20April/build/persistence.jar!/META-INF/persistence.xml
11:14:44,788 DEBUG PersistenceXmlLoader:156 - Persistent Unit name from persistence.xml: h-source
11:14:44,788 DEBUG Ejb3Configuration:221 - PersistenceMetadata [
   name: h-source
   jtaDataSource: null
   nonJtaDataSource: null
   transactionType: RESOURCE_LOCAL
   provider: null
   classes[
   ]
   packages[
   ]
   mappingFiles[
   ]
   jarFiles[
   ]
   hbmfiles: 0
   properties[
      hibernate.connection.username: o2kuser
      hibernate.connection.password: o2kuser
      hibernate.cache.provider_class: org.hibernate.cache.HashtableCacheProvider
      hibernate.dialect: com.fineos.ta3g.jpa.dialects.TaSQLServerDialect
      hibernate.connection.url: jdbc:sqlserver://opc151:1433;DatabaseName=test_garageDB;forwardReadOnlyMetehod=serverCursor
      hibernate.show_sql: true
      hibernate.connection.driver_class: com.microsoft.sqlserver.jdbc.SQLServerDriver
   ]]
11:14:44,804 DEBUG JarVisitor:91 - JAR URL from URL Entry: jar:file:/D:/ta20April/build/persistence.jar!/META-INF/persistence.xml >> file:/D:/ta20April/build/persistence.jar
11:14:44,804 DEBUG Ejb3Configuration:553 - Detect class: true; detect hbm: true
11:14:44,819 DEBUG JarVisitor:218 - Searching mapped entities in jar/par: file:/D:/ta20April/build/persistence.jar
11:14:44,819 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.EntityFactory
11:14:44,882 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.InstanceGenerator$1
11:14:44,882 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.InstanceGenerator$DB2InstanceCreater
11:14:44,882 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.InstanceGenerator$InstanceCreater
11:14:44,882 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.InstanceGenerator$OracleInstanceCreater
11:14:44,897 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.InstanceGenerator$SQLServerInstanceCreater
11:14:44,897 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.InstanceGenerator
11:14:44,897 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.TaEntityManagerFactory
11:14:44,897 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.datatypes.BaseEntity
11:14:44,929 DEBUG JarVisitor:309 - Java element filter matched for com.fineos.ta3g.jpa.datatypes.BaseEntity
11:14:44,929 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.datatypes.EntityOid
11:14:44,929 DEBUG JarVisitor:309 - Java element filter matched for com.fineos.ta3g.jpa.datatypes.EntityOid
11:14:44,929 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.datatypes.JPADateTime
11:14:44,929 DEBUG JarVisitor:309 - Java element filter matched for com.fineos.ta3g.jpa.datatypes.JPADateTime
11:14:44,929 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.datatypes.JPAEntity
11:14:44,944 DEBUG JarVisitor:309 - Java element filter matched for com.fineos.ta3g.jpa.datatypes.JPAEntity
11:14:44,944 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.datatypes.JPAMoney
11:14:44,944 DEBUG JarVisitor:309 - Java element filter matched for com.fineos.ta3g.jpa.datatypes.JPAMoney
11:14:44,944 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.datatypes.JPAUser
11:14:44,944 DEBUG JarVisitor:309 - Java element filter matched for com.fineos.ta3g.jpa.datatypes.JPAUser
11:14:44,944 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.jpa.dialects.TaSQLServerDialect
11:14:44,944 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.garage.Address
11:14:44,944 DEBUG JarVisitor:309 - Java element filter matched for com.fineos.ta3g.test.garage.Address
11:14:44,944 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.garage.Car
11:14:44,944 DEBUG JarVisitor:309 - Java element filter matched for com.fineos.ta3g.test.garage.Car
11:14:44,944 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.garage.CarPart
11:14:44,944 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.garage.Company
11:14:44,944 DEBUG JarVisitor:309 - Java element filter matched for com.fineos.ta3g.test.garage.Company
11:14:44,944 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.garage.Customer
11:14:44,944 DEBUG JarVisitor:309 - Java element filter matched for com.fineos.ta3g.test.garage.Customer
11:14:44,944 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.garage.Employee
11:14:44,944 DEBUG JarVisitor:309 - Java element filter matched for com.fineos.ta3g.test.garage.Employee
11:14:44,944 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.garage.Mechanic
11:14:44,960 DEBUG JarVisitor:309 - Java element filter matched for com.fineos.ta3g.test.garage.Mechanic
11:14:44,960 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.garage.Person
11:14:44,960 DEBUG JarVisitor:309 - Java element filter matched for com.fineos.ta3g.test.garage.Person
11:14:44,960 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.garage.WorkOrder
11:14:44,960 DEBUG JarVisitor:309 - Java element filter matched for com.fineos.ta3g.test.garage.WorkOrder
11:14:44,960 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.jpatests.AnyTest
11:14:44,960 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.jpatests.BulkPOJOTests
11:14:44,960 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.jpatests.JPAEnumTests
11:14:44,960 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.jpatests.JPARelsTests
11:14:44,960 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.jpatests.JPATestUtils
11:14:44,975 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.jpatests.JPATests
11:14:44,975 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.jpatests.JPAUsageTests$QueryPersonThread
11:14:44,975 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.jpatests.JPAUsageTests$ThreadUpdate
11:14:44,975 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.jpatests.JPAUsageTests
11:14:44,975 DEBUG JarVisitor:258 - Filtering: com.fineos.ta3g.test.jpatests.POJOTests
11:14:44,975 DEBUG Ejb3Configuration:553 - Detect class: true; detect hbm: true
11:14:44,975 DEBUG Ejb3Configuration:154 - Creating Factory: h-source
11:14:45,022 DEBUG AnnotationConfiguration:244 - Execute first pass mapping processing
11:14:45,132 DEBUG AnnotationConfiguration:481 - Process hbm files
11:14:45,132 DEBUG AnnotationConfiguration:489 - Process annotated classes
11:14:45,132  INFO AnnotationBinder:398 - Binding entity from annotated class: com.fineos.ta3g.test.garage.Person
11:14:45,194 DEBUG EntityBinder:292 - Import with entity name=Person
11:14:45,210  INFO EntityBinder:420 - Bind entity com.fineos.ta3g.test.garage.Person on table TPerson
11:14:45,210 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Person property annotation
11:14:45,241 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Person property annotation
11:14:45,241 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Person field annotation
11:14:45,257 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Person field annotation
11:14:45,257 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.test.garage.Person.pk
11:14:45,272 DEBUG Ejb3Column:161 - Binding column pk unique false
11:14:45,272 DEBUG AnnotationBinder:1207 - pk is an id
11:14:45,272 DEBUG AnnotationBinder:1705 - Binding component with path: com.fineos.ta3g.test.garage.Person.pk
11:14:45,272 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.jpa.datatypes.EntityOid field annotation
11:14:45,272 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.jpa.datatypes.EntityOid.c
11:14:45,272 DEBUG Ejb3Column:161 - Binding column c unique false
11:14:45,288 DEBUG PropertyBinder:106 - binding property c with lazy=false
11:14:45,288 DEBUG SimpleValueBinder:220 - building SimpleValue for c
11:14:45,288 DEBUG PropertyBinder:128 - Building property c
11:14:45,304 DEBUG PropertyBinder:172 - Cascading c with null
11:14:45,304 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.jpa.datatypes.EntityOid.i
11:14:45,304 DEBUG Ejb3Column:161 - Binding column i unique false
11:14:45,304 DEBUG PropertyBinder:106 - binding property i with lazy=false
11:14:45,304 DEBUG SimpleValueBinder:220 - building SimpleValue for i
11:14:45,304 DEBUG PropertyBinder:128 - Building property i
11:14:45,304 DEBUG PropertyBinder:172 - Cascading i with null
11:14:45,304 DEBUG PropertyBinder:128 - Building property pk
11:14:45,304 DEBUG PropertyBinder:172 - Cascading pk with null
11:14:45,304 DEBUG AnnotationBinder:1244 - Bind @EmbeddedId on pk
11:14:45,304  INFO AnnotationBinder:398 - Binding entity from annotated class: com.fineos.ta3g.test.garage.Employee
11:14:45,304 DEBUG EntityBinder:292 - Import with entity name=Employee
11:14:45,304  INFO EntityBinder:420 - Bind entity com.fineos.ta3g.test.garage.Employee on table TEmployee
11:14:45,335 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Employee field annotation
11:14:45,335  INFO AnnotationBinder:398 - Binding entity from annotated class: com.fineos.ta3g.test.garage.Mechanic
11:14:45,335 DEBUG EntityBinder:292 - Import with entity name=Mechanic
11:14:45,335  INFO EntityBinder:420 - Bind entity com.fineos.ta3g.test.garage.Mechanic on table TMechanic
11:14:45,335 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Mechanic field annotation
11:14:45,335 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.test.garage.Mechanic.email
11:14:45,335 DEBUG Ejb3Column:161 - Binding column email unique false
11:14:45,335 DEBUG PropertyBinder:106 - binding property email with lazy=false
11:14:45,335 DEBUG SimpleValueBinder:220 - building SimpleValue for email
11:14:45,335 DEBUG PropertyBinder:128 - Building property email
11:14:45,335 DEBUG PropertyBinder:172 - Cascading email with null
11:14:45,335 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.test.garage.Mechanic.grade
11:14:45,335 DEBUG Ejb3Column:161 - Binding column grade unique false
11:14:45,335 DEBUG PropertyBinder:106 - binding property grade with lazy=false
11:14:45,335 DEBUG SimpleValueBinder:220 - building SimpleValue for grade
11:14:45,335 DEBUG PropertyBinder:128 - Building property grade
11:14:45,335 DEBUG PropertyBinder:172 - Cascading grade with null
11:14:45,335  INFO AnnotationBinder:398 - Binding entity from annotated class: com.fineos.ta3g.test.garage.Company
11:14:45,350 DEBUG Ejb3Column:161 - Binding column DTYPE unique false
11:14:45,350 DEBUG EntityBinder:292 - Import with entity name=Company
11:14:45,350  INFO EntityBinder:420 - Bind entity com.fineos.ta3g.test.garage.Company on table TCompany
11:14:45,350 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Company property annotation
11:14:45,350 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Company property annotation
11:14:45,350 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Company field annotation
11:14:45,350 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Company field annotation
11:14:45,350 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.test.garage.Company.pk
11:14:45,350 DEBUG Ejb3Column:161 - Binding column pk unique false
11:14:45,350 DEBUG AnnotationBinder:1207 - pk is an id
11:14:45,350 DEBUG AnnotationBinder:1705 - Binding component with path: com.fineos.ta3g.test.garage.Company.pk
11:14:45,350 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.jpa.datatypes.EntityOid field annotation
11:14:45,350 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.jpa.datatypes.EntityOid.c
11:14:45,350 DEBUG Ejb3Column:161 - Binding column c unique false
11:14:45,350 DEBUG PropertyBinder:106 - binding property c with lazy=false
11:14:45,350 DEBUG SimpleValueBinder:220 - building SimpleValue for c
11:14:45,350 DEBUG PropertyBinder:128 - Building property c
11:14:45,366 DEBUG PropertyBinder:172 - Cascading c with null
11:14:45,366 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.jpa.datatypes.EntityOid.i
11:14:45,366 DEBUG Ejb3Column:161 - Binding column i unique false
11:14:45,366 DEBUG PropertyBinder:106 - binding property i with lazy=false
11:14:45,366 DEBUG SimpleValueBinder:220 - building SimpleValue for i
11:14:45,366 DEBUG PropertyBinder:128 - Building property i
11:14:45,366 DEBUG PropertyBinder:172 - Cascading i with null
11:14:45,366 DEBUG PropertyBinder:128 - Building property pk
11:14:45,366 DEBUG PropertyBinder:172 - Cascading pk with null
11:14:45,366 DEBUG AnnotationBinder:1244 - Bind @EmbeddedId on pk
11:14:45,366  INFO AnnotationBinder:398 - Binding entity from annotated class: com.fineos.ta3g.test.garage.WorkOrder
11:14:45,366 DEBUG Ejb3Column:161 - Binding column DTYPE unique false
11:14:45,366 DEBUG EntityBinder:292 - Import with entity name=WorkOrder
11:14:45,366  INFO EntityBinder:420 - Bind entity com.fineos.ta3g.test.garage.WorkOrder on table TWorkOrder
11:14:45,366 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.WorkOrder property annotation
11:14:45,366 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.WorkOrder property annotation
11:14:45,382 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.WorkOrder field annotation
11:14:45,382 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.WorkOrder field annotation
11:14:45,397 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.test.garage.WorkOrder.pk
11:14:45,397 DEBUG Ejb3Column:161 - Binding column pk unique false
11:14:45,397 DEBUG AnnotationBinder:1207 - pk is an id
11:14:45,397 DEBUG AnnotationBinder:1705 - Binding component with path: com.fineos.ta3g.test.garage.WorkOrder.pk
11:14:45,397 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.jpa.datatypes.EntityOid field annotation
11:14:45,397 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.jpa.datatypes.EntityOid.c
11:14:45,397 DEBUG Ejb3Column:161 - Binding column c unique false
11:14:45,413 DEBUG PropertyBinder:106 - binding property c with lazy=false
11:14:45,413 DEBUG SimpleValueBinder:220 - building SimpleValue for c
11:14:45,413 DEBUG PropertyBinder:128 - Building property c
11:14:45,413 DEBUG PropertyBinder:172 - Cascading c with null
11:14:45,413 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.jpa.datatypes.EntityOid.i
11:14:45,413 DEBUG Ejb3Column:161 - Binding column i unique false
11:14:45,413 DEBUG PropertyBinder:106 - binding property i with lazy=false
11:14:45,413 DEBUG SimpleValueBinder:220 - building SimpleValue for i
11:14:45,413 DEBUG PropertyBinder:128 - Building property i
11:14:45,413 DEBUG PropertyBinder:172 - Cascading i with null
11:14:45,413 DEBUG PropertyBinder:128 - Building property pk
11:14:45,413 DEBUG PropertyBinder:172 - Cascading pk with null
11:14:45,413 DEBUG AnnotationBinder:1244 - Bind @EmbeddedId on pk
11:14:45,413 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.test.garage.WorkOrder.bigDecimalType
11:14:45,413 DEBUG Ejb3Column:161 - Binding column BIGDECIMALTYP unique false
11:14:45,413 DEBUG PropertyBinder:106 - binding property bigDecimalType with lazy=false
11:14:45,413 DEBUG SimpleValueBinder:220 - building SimpleValue for bigDecimalType
11:14:45,413 DEBUG PropertyBinder:128 - Building property bigDecimalType
11:14:45,413 DEBUG PropertyBinder:172 - Cascading bigDecimalType with null
11:14:45,413 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.test.garage.WorkOrder.mechanics
11:14:45,413 DEBUG Ejb3Column:161 - Binding column C_WKORDER_WORKERS unique false
11:14:45,429 DEBUG Ejb3Column:161 - Binding column I_WKORDER_WORKERS unique false
11:14:45,429 DEBUG Ejb3Column:161 - Binding column mechanics unique false
11:14:45,429 DEBUG Ejb3Column:161 - Binding column null unique false
11:14:45,491 DEBUG Ejb3Column:161 - Binding column element unique false
11:14:45,491 DEBUG Ejb3Column:161 - Binding column mapkey unique false
11:14:45,491 DEBUG Ejb3Column:161 - Binding column null unique false
11:14:45,491 DEBUG Ejb3Column:161 - Binding column null unique false
11:14:45,491 DEBUG Ejb3Column:161 - Binding column null unique false
11:14:45,491 DEBUG CollectionBinder:287 - Collection role: com.fineos.ta3g.test.garage.WorkOrder.mechanics
11:14:45,507 DEBUG PropertyBinder:128 - Building property mechanics
11:14:45,507 DEBUG PropertyBinder:172 - Cascading mechanics with none
11:14:45,507  INFO AnnotationBinder:398 - Binding entity from annotated class: com.fineos.ta3g.test.garage.Address
11:14:45,507 DEBUG Ejb3Column:161 - Binding column DTYPE unique false
11:14:45,507 DEBUG EntityBinder:292 - Import with entity name=Address
11:14:45,507  INFO EntityBinder:420 - Bind entity com.fineos.ta3g.test.garage.Address on table TAddress
11:14:45,507 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Address property annotation
11:14:45,507 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Address property annotation
11:14:45,507 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Address field annotation
11:14:45,507 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Address field annotation
11:14:45,507 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.test.garage.Address.pk
11:14:45,507 DEBUG Ejb3Column:161 - Binding column pk unique false
11:14:45,507 DEBUG AnnotationBinder:1207 - pk is an id
11:14:45,507 DEBUG AnnotationBinder:1705 - Binding component with path: com.fineos.ta3g.test.garage.Address.pk
11:14:45,507 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.jpa.datatypes.EntityOid field annotation
11:14:45,507 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.jpa.datatypes.EntityOid.c
11:14:45,522 DEBUG Ejb3Column:161 - Binding column c unique false
11:14:45,522 DEBUG PropertyBinder:106 - binding property c with lazy=false
11:14:45,522 DEBUG SimpleValueBinder:220 - building SimpleValue for c
11:14:45,522 DEBUG PropertyBinder:128 - Building property c
11:14:45,522 DEBUG PropertyBinder:172 - Cascading c with null
11:14:45,522 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.jpa.datatypes.EntityOid.i
11:14:45,522 DEBUG Ejb3Column:161 - Binding column i unique false
11:14:45,522 DEBUG PropertyBinder:106 - binding property i with lazy=false
11:14:45,522 DEBUG SimpleValueBinder:220 - building SimpleValue for i
11:14:45,522 DEBUG PropertyBinder:128 - Building property i
11:14:45,522 DEBUG PropertyBinder:172 - Cascading i with null
11:14:45,522 DEBUG PropertyBinder:128 - Building property pk
11:14:45,522 DEBUG PropertyBinder:172 - Cascading pk with null
11:14:45,522 DEBUG AnnotationBinder:1244 - Bind @EmbeddedId on pk
11:14:45,522  INFO AnnotationBinder:398 - Binding entity from annotated class: com.fineos.ta3g.test.garage.Customer
11:14:45,522 DEBUG EntityBinder:292 - Import with entity name=Customer
11:14:45,522  INFO EntityBinder:420 - Bind entity com.fineos.ta3g.test.garage.Customer on table TCustomer
11:14:45,522 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Customer field annotation
11:14:45,522  INFO AnnotationBinder:398 - Binding entity from annotated class: com.fineos.ta3g.test.garage.Car
11:14:45,522 DEBUG Ejb3Column:161 - Binding column DTYPE unique false
11:14:45,522 DEBUG EntityBinder:292 - Import with entity name=Car
11:14:45,522  INFO EntityBinder:420 - Bind entity com.fineos.ta3g.test.garage.Car on table TCar
11:14:45,522 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Car property annotation
11:14:45,538 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Car property annotation
11:14:45,538 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Car field annotation
11:14:45,538 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.test.garage.Car field annotation
11:14:45,538 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.test.garage.Car.pk
11:14:45,538 DEBUG Ejb3Column:161 - Binding column pk unique false
11:14:45,538 DEBUG AnnotationBinder:1207 - pk is an id
11:14:45,538 DEBUG AnnotationBinder:1705 - Binding component with path: com.fineos.ta3g.test.garage.Car.pk
11:14:45,538 DEBUG AnnotationBinder:983 - Processing com.fineos.ta3g.jpa.datatypes.EntityOid field annotation
11:14:45,538 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.jpa.datatypes.EntityOid.c
11:14:45,538 DEBUG Ejb3Column:161 - Binding column c unique false
11:14:45,538 DEBUG PropertyBinder:106 - binding property c with lazy=false
11:14:45,538 DEBUG SimpleValueBinder:220 - building SimpleValue for c
11:14:45,538 DEBUG PropertyBinder:128 - Building property c
11:14:45,538 DEBUG PropertyBinder:172 - Cascading c with null
11:14:45,538 DEBUG AnnotationBinder:1086 - Processing annotations of com.fineos.ta3g.jpa.datatypes.EntityOid.i
11:14:45,538 DEBUG Ejb3Column:161 - Binding column i unique false
11:14:45,538 DEBUG PropertyBinder:106 - binding property i with lazy=false
11:14:45,538 DEBUG SimpleValueBinder:220 - building SimpleValue for i
11:14:45,538 DEBUG PropertyBinder:128 - Building property i
11:14:45,538 DEBUG PropertyBinder:172 - Cascading i with null
11:14:45,538 DEBUG PropertyBinder:128 - Building property pk
11:14:45,538 DEBUG PropertyBinder:172 - Cascading pk with null
11:14:45,538 DEBUG AnnotationBinder:1244 - Bind @EmbeddedId on pk
11:14:45,538 DEBUG AnnotationConfiguration:375 - processing manytoone fk mappings
11:14:45,554 DEBUG Configuration:1120 - processing extends queue
11:14:45,554 DEBUG Configuration:1124 - processing collection mappings
11:14:45,554 DEBUG CollectionSecondPass:41 - Second pass for collection: com.fineos.ta3g.test.garage.WorkOrder.mechanics
11:14:45,554 DEBUG CollectionBinder:597 - Binding a OneToMany: com.fineos.ta3g.test.garage.WorkOrder.mechanics through a foreign key
Failed to invoke suite():javax.persistence.PersistenceException: java.lang.NullPointerException
[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 08, 2007 6:21 am 
Senior
Senior

Joined: Mon Jul 24, 2006 8:43 am
Posts: 160
Code:

Primary Key

Code:
@Embeddable
public class EntityOid implements Comparable, Serializable {
    static final Logger logger = Logger.getLogger(LogUtils.loggerName(EntityOid.class.getName()));
    private Integer c;
    private Integer i;
    public static int counter = 0;
    @Transient
    private int hashCode = -1;
   
    public EntityOid() {
    }
   
    public EntityOid(Integer c, Integer i) {
        this.c = c;
        this.i = i;
    }
   
    public Integer getC() {
        return c;
    }
   
   
   
    public Integer getI() {
        return i;
    }


    public boolean equals(Object obj){
        boolean equals = false;
        if (obj == this)
            return true;
        //if (!(obj instanceof EntityOid)) return false;
        try {
            EntityOid ciPK = (EntityOid)obj;
            if ((ciPK.c.equals(c)) && (ciPK.i.equals(i))){
                equals = true;
            }
        } catch(Exception e){
            // Ignore exception:  its faster to occassionally get NullPointerException (eg if EntityObj==null)
            // or ClassCastException (obj is not Oid) than to check for these every time.
            equals = false;
        }
        return equals;
    }
   
    public int hashCode() {
        if (hashCode == -1){
            hashCode = calcHashcode();
        }
        return hashCode;
    }
   
    private int calcHashcode(){
        int hcode = ((int) (c ^ i) % 1031 );
        return hcode;
    }
   
    public int compareTo(Object o) {
        EntityOid pk = (EntityOid)o;

        if (this.c > pk.c)
            return 1;
        else if (this.c < pk.c)
            return -1;
        // Check IndexIds
        else if (this.i < pk.i)
            return -1;
        else if (this.i > pk.i)
            return 1;
        else
            return 0;
    }
   
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("C=" + c);
        sb.append(",I="+ i);
        return sb.toString();
    }

}


Base entity

Code:
@MappedSuperclass
public abstract class JPAEntity implements Comparable, Cloneable{
    @EmbeddedId
    protected EntityOid pk;
    public void setPk(EntityOid pk){
        this.pk = pk;
    }
   
    public EntityOid getPk() {
        return pk;
    }
}


Mechanic
Code:
@Entity
@Table(name="TMechanic")
public class Mechanic extends JPAEntity  {
}


WorkOrder

Code:
@Entity
@Table(name="TWorkOrder")
public class WorkOrder extends JPAEntity{
    @OneToMany
    @JoinColumns({
        @JoinColumn(name="C_WKORDER_WORKERS", referencedColumnName="C"),
        @JoinColumn(name="I_WKORDER_WORKERS", referencedColumnName="I")})
    @OrderBy("pk.c, pk.i ASC")
    private List<Mechanic> mechanics = new ArrayList();
    public static int CLASSID = 3012;
   
    @Column(name="BIGDECIMALTYP",scale=6)
    private BigDecimal bigDecimalType;
   
   
    public List<Mechanic> getMechanics() {
        return mechanics;
    }
   
    public void setMechanics(List<Mechanic> mechanics) {
        this.mechanics = mechanics;
    }
   
    public int getClassId() {
        return CLASSID;
    }
   
}


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 31, 2007 12:19 pm 
Senior
Senior

Joined: Mon Jul 24, 2006 8:43 am
Posts: 160
Hi,
Do you have the info you need? Should I raise a JIRA for this?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 31, 2007 1:32 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
There should be a stack trace
Code:
Failed to invoke suite():javax.persistence.PersistenceException: java.lang.NullPointerException

This is the one I'm interested in

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 06, 2007 8:56 am 
Senior
Senior

Joined: Mon Jul 24, 2006 8:43 am
Posts: 160
emmanuel wrote:
There should be a stack trace
Code:
Failed to invoke suite():javax.persistence.PersistenceException: java.lang.NullPointerException

This is the one I'm interested in


Here you go:
java.lang.NullPointerException
at org.hibernate.cfg.annotations.CollectionBinder.buildOrderByClauseFromHql(CollectionBinder.java:851)
at org.hibernate.cfg.annotations.CollectionBinder.bindOneToManySecondPass(CollectionBinder.java:608)
at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:563)
at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:517)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:43)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:316)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1269)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:150)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:888)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:186)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:246)
... 15 more



In the hibernate code for CollectionBinder
Code:
PersistentClass pc = p.getPersistentClass();
String table;
if (pc != associatedClass) {
    table = pc.getTable().getQuotedName() + ".";
} else {
    table = "";
}

pc is null.

Is there anything else you need?

PS
This issue is a blocker we cannot upgrade to this release until we resolve this.


Top
 Profile  
 
 Post subject: Any update?
PostPosted: Fri Aug 10, 2007 10:33 am 
Senior
Senior

Joined: Mon Jul 24, 2006 8:43 am
Posts: 160
Hi,
any update on this, should I write a JIRA?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 10, 2007 11:06 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is fixed in SVN

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 13, 2007 5:27 am 
Senior
Senior

Joined: Mon Jul 24, 2006 8:43 am
Posts: 160
Hi,
Thanks for that. Is the fix in a release or do you know when there will be a release with the fix?
The issue is a blocker for us.

We are currently using:

Annotations: Version: 3.2.0 CR1
Core: version 3.2 cr2
EntityManager: Version: 3.2.0.CR1

and wish to upgrade as there are issues with that release fixed in further releases.

Kind Rgds


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 15, 2007 9:49 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This will be fixed in the next release of annotations (3.3.2)
I don't have a firm date sorry

_________________
Emmanuel


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.