Hibernate在EntityTuplizerFactory.constructTuplizer中的NullPointerException失败?为什么? [英] Hibernate fails with NullPointerException in EntityTuplizerFactory.constructTuplizer? Why?

查看:121
本文介绍了Hibernate在EntityTuplizerFactory.constructTuplizer中的NullPointerException失败?为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试实例化Hibernate并连接MySQL数据库时,我有一个问题(参见下面的错误信息)。

I have a problem when I try to instantiate Hibernate and connect with a MySQL database (see error message below).

运行Junit测试时,使用完全相同的hibernate.cfg.xml文件,连接工作正常,但是从Tomcat ...运行时拒绝工作...

Curiously enough the connection works fine using the exact same hibernate.cfg.xml file when running Junit tests but it refuses to work when run from Tomcat...

我开始用尽了想法。

有什么线索或提示吗?


导致:org.hibernate.HibernateException:无法在org.hibernate上实例化默认的tuplizer [org.hibernate.tuple.entity.DynamicMapEntityTuplizer]
。 tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:110)
在org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:135)
在org.hibernate.tuple.entity。 EntityEntityModeToTuplizerMapping(EntityEntityModeToTuplizerMapping.java:69)
在org.hibernate.tuple.entity.EntityMetamodel(EntityMetamodel.java:323)
在org.hibernate.persister.entity.AbstractEntityPersister(AbstractEntityPersister.java :456)
在org.hibernate.persister.entity.SingleTableEntityPersister。(SingleTableEntityPersister.java:131)
在org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
在org.hibernate.impl .SessionFactoryImpl。(SessionFactoryImpl.java:267)
在org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
at se.fmt.atlantism.util.HibernateUtil.buildSessionFactory(HibernateUtil。 java:16)
... 38更多
导致:java.lang.NullPointerException
在org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:107)
... 47更多

Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.DynamicMapEntityTuplizer] at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:110) at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:135) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.(EntityEntityModeToTuplizerMapping.java:69) at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:323) at org.hibernate.persister.entity.AbstractEntityPersister.(AbstractEntityPersister.java:456) at org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:131) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84) at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:267) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341) at se.fmt.atlantism.util.HibernateUtil.buildSessionFactory(HibernateUtil.java:16) ... 38 more Caused by: java.lang.NullPointerException at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:107) ... 47 more


推荐答案

我为未来的Google员工和参考书写

I'm writing this for future Googlers and reference.

我做了一些更多的研究,问题的根源仍然是未知的。但是以下文章让我在正确的轨道上。

I've done some more research and the root source of the problem is still not known. However the following article throw me on the right track.

http://www.howtogeek.com/howto/linux/installing-tomcat-6-on-ubuntu/

看起来像在Ubuntu(和Debian)中可用的Tomcat(至少版本6)不能正常工作。相反,我使用以下指南安装Tomcat:

It seems like the Tomcat (version 6 at least) packages available in Ubuntu (and Debian) are not working correctly. Instead I installed Tomcat using the following guide:

http://www.ctrip.ufl.edu/tomcat6-debian-lenny-howto

虽然这可能不是高级安装选择似乎有必要在Ubuntu和/或Debian Lenny上获取Tomcat版本6,而不会出现问题。

While this might not be the premium choice of installation it seems necessary to get Tomcat version 6 running without problems on Ubuntu and/or Debian Lenny.

这篇关于Hibernate在EntityTuplizerFactory.constructTuplizer中的NullPointerException失败?为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆