This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

hibernate and JPA (cross post from stack exchange)  RSS feed

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an entity with 2 foreign keys.
This class is generated DcDataDomainDs_.java

   
The entity class this is generated from is below. I can not see what I have done differently between datasetType and dataDomain. I have left out the other simple columns, as they are working fine.


both the generated classes DataDomain_ and DatasetType_ have the sets of this joining class in them

 



Here is the mapping of the missing entity


I tried running my test which didn't need the missing value and got this response

 
 
Bartender
Posts: 20356
111
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not much of a stack trace. In fact, it has no information at all about what actually caused the exception.

Can you give us more?
 
Wendy Gibbons
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just solved the missing field issue the DataDomain class wasn't  Serializable
 
Wendy Gibbons
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:That's not much of a stack trace. In fact, it has no information at all about what actually caused the exception.

Can you give us more?




I thought the stack issue was a side effect of the missing field, but it wasn't, the stack trace isn't much more use in full, it is building the application context which I haven't investigated at all yet:


 
Master Rancher
Posts: 3887
45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's got to be more as it isn't telling you the exception that's been thrown.
 
Tim Holloway
Bartender
Posts: 20356
111
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:There's got to be more as it isn't telling you the exception that's been thrown.



Yeah. I'd expect to see at least one layer of additional stacktrace headed by "Caused By". This trace says that the Hibernate getType threw an exception, but not why it threw an exception.

It probably wouldn't be a bad idea to turn on trace-level logging for Hibernate, though.
 
Wendy Gibbons
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dang it the emails went to junk email, so only just spotted this.

it turned out the DataDomain class (which was an existing object so I wasn't looking at it) didn't implement serializable, that was why it wasn't being included.

I didn't spot a single useful message telling me this, I just went through the working object and the failing one looking for differences.

I did turn on more logging, and the stack trace was a stupid typo error or 2.

Thank you and sorry I am so late returning.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!