- This topic has 10 replies, 3 voices, and was last updated 19 years, 3 months ago by
Haris Peco.
-
AuthorPosts
-
Douglas FarmerMemberHello,
first things first. I just installed a fresh eclipse 3.1.2 and myeclipse 4.1.1 release today. There are no other third party plugins.My problem is this…when I run my application with log4j rootLogger=info there is no problem. When I run the same code changing only the rootLogger=debug hibernate is no longer able to insert data into the database. This is very weird and I have been stuck trying to figure out how to resolve this issue. Any help would be greatly appreciated. Also, please let me know if I have missed any information.
Thanks,
DougMarch 8, 2006 at 5:43 am #248000
Haris PecoMemberDoug,
Please send ud Error log (Windows-show View-Other-PDE runtime-Error log View).I will try your case
Best
March 8, 2006 at 6:10 am #248002
Haris PecoMemberDoug,
I have tried your case (log4j.logger.org.hibernate=debug) and it work for me, but I haven’t all details
Please, send your database and version and mappings and log4j detailsThanks
March 8, 2006 at 7:21 am #248007
Douglas FarmerMemberHello and thanks for the quick response.
Here is the error that i am getting. ### There was a problem with creating the rule! com.med.aae.domain.RuleAttributeJoin Problem was: null
java.lang.ClassCastException: com.med.aae.domain.RuleAttributeJoin
at org.hibernate.type.EntityType.toLoggableString(EntityType.java:154)
at org.hibernate.pretty.Printer.toString(Printer.java:53)
at org.hibernate.pretty.Printer.toString(Printer.java:90)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:97)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
at com.med.aae.dao.RuleDAO.saveRuleAttributeValue(RuleDAO.java:203)
at com.med.aae.dao.RuleDAO.saveAttributeMetaData(RuleDAO.java:299)
at com.med.aae.dao.RuleDAO.createRuleDefinition(RuleDAO.java:339)
at com.med.aae.bo.RuleDefinition.createRule(RuleDefinition.java:81)
at com.med.aae.bo.RuleDefinition.main(RuleDefinition.java:379)This class is mapped to a bridge table which is a parent of 1 and a child of 2.
It is just weird that this issue only pops up when the logging is set to debug. FYI…I am not using the MyEclipse library’s for hibernate and instead I am copy all the necessary folders to the lib directory of my feature and then placing them in the classpath. It works fine when logging is set to info but as soon as I run it with debug it has a problem. Also, I am not able to run this in the app server at all. I get the same error regardless of what the value is set to. FYI again, I am running jboss4.0.3 and it’s a clean install.
Any further help wold be greatly appreciated.
Thanks,
DougMarch 8, 2006 at 7:45 am #248011
Haris PecoMemberDoug,
What is your database and version, hibernate version (your libraries) ? Can you send us problematic database schema script, mapping files, POJO and application code ?
Best
March 8, 2006 at 8:24 am #248015
Douglas FarmerMemberI am running mysql 5.0 and hibernate 3.1. I would rather not send my business code but I would be happy to send my mappings so you could create a database. How do you want me to handle that?
March 8, 2006 at 8:48 am #248020
Haris PecoMemberDoug,
I will try simple mapping and insert with MySQL 5.0 (5.0.15) and you send mappings – it is ok
Best
March 8, 2006 at 9:42 am #248032
Haris PecoMemberDoug,
I have tried with MySQL 5.0.15 : make MyEclipse mappings, make test for update and delete (2 tables with FK) and it work
I saw your log and this is your class ‘java.lang.ClassCastException: com.med.aae.domain.RuleAttributeJoin’
If you have logging in your class then you have problem with mixed log libraries (2 kind log libraries) in projects
I suppose that you have own libraries (incompatible with hibernate) and in some moment you get ClassCastException.
I’don’t sure and it is very hard find bug without more details – however , select/update/insert/delete with mySQL 5.0 and MyEclipse generating work – I will try help more if you send more details (what you can, of course)Best
March 10, 2006 at 9:51 am #248272
Douglas FarmerMemberI am actually investigating wether this is a Hibernate bug. The exception gets thrown when the logging is in debug mode because Hibernate’s EntityType.toLoggableString(EntityType.java:154) can’t determine what type of object this is. Thanks for your help and I’ll try post my findings.
March 24, 2006 at 3:33 pm #249296
NorthVanMemberI had a similar problem, though I wasn’t using My eclipse.
I had an
ClassCastException at org.hibernate.type.EntityType.toLoggableString(EntityType.java:154)
I found the the problem was something to do with hibernate debugging.
To fix, try making sure that you have log4j set up properly: copy the log4j.properties file from hibenate-3.1/etc to the root of the classpath.
This fixed things for me.
(I believe the bug is something to do with descendent classes not begin able to be cast to ancestors because of cglib)
March 24, 2006 at 3:59 pm #249298
Haris PecoMemberThere is bug with type conversion in some version hibernate 3.1.x
Try use latest 3.1.3, but MyEclipse support 3.0.5 and it is better that you use version 3.0.5Best
-
AuthorPosts