首页上一页 1 下一页尾页 3 条记录 1/1页
JAVA项目开发全程实录-第3章的问题
发表在Java图书答疑
2012-04-01
是否精华
是
否
版块置顶:
是
否
版主你好:
我在看第三章企业人事管理系统的时候遇到了一些问题,具体情况如下:
环境条件:1、oracle数据库已经安装成功,并产生数据库实例orcl
2、personnel_manage.dmp已经导入进数据库实例orcl
3、Eclipse已经正常启动
4、有关的jar包已经导入(Hibernate3.2,OracleDriver)
Hibernate.cfg.xml的配置如下:
<property name="connection.driver_class"><!-- 配置数据库的驱动类 -->
oracle.jdbc.driver.OracleDriver
</property>
<property name="connection.url"><!-- 配置数据库的连接路径 -->
jdbc:oracle:thin:@localhost:1158/em
</property>
<property name="connection.username">PERSONNEL_MANAGE</property><!-- 配置数据库的连接用户名 -->
<property name="connection.password">uservip</property><!-- 配置数据库的连接密码,这里密码为空,在这种情况下也可以省略该行配置代码 -->
<property name="dialect"><!-- 配置数据库使用的方言 -->
org.hibernate.dialect.OracleDialect
</property>
下面附问题说明:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at org.hibernate.cfg.Configuration.reset(Configuration.java:168)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:187)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:191)
at com.mwq.hibernate.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:16)
at com.mwq.hibernate.BaseDao.queryList(BaseDao.java:29)
at com.mwq.hibernate.Dao.queryManagerOfNatural(Dao.java:141)
at com.mwq.frame.LandFrame.<init>(LandFrame.java:100)
at com.mwq.PersonnelManage.land(PersonnelManage.java:32)
at com.mwq.PersonnelManage$1.run(PersonnelManage.java:26)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.NullPointerException
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:144)
at org.hibernate.cfg.Environment.<clinit>(Environment.java:529)
... 17 more
请版主帮忙看下,谢了!
我在看第三章企业人事管理系统的时候遇到了一些问题,具体情况如下:
环境条件:1、oracle数据库已经安装成功,并产生数据库实例orcl
2、personnel_manage.dmp已经导入进数据库实例orcl
3、Eclipse已经正常启动
4、有关的jar包已经导入(Hibernate3.2,OracleDriver)
Hibernate.cfg.xml的配置如下:
<property name="connection.driver_class"><!-- 配置数据库的驱动类 -->
oracle.jdbc.driver.OracleDriver
</property>
<property name="connection.url"><!-- 配置数据库的连接路径 -->
jdbc:oracle:thin:@localhost:1158/em
</property>
<property name="connection.username">PERSONNEL_MANAGE</property><!-- 配置数据库的连接用户名 -->
<property name="connection.password">uservip</property><!-- 配置数据库的连接密码,这里密码为空,在这种情况下也可以省略该行配置代码 -->
<property name="dialect"><!-- 配置数据库使用的方言 -->
org.hibernate.dialect.OracleDialect
</property>
下面附问题说明:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at org.hibernate.cfg.Configuration.reset(Configuration.java:168)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:187)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:191)
at com.mwq.hibernate.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:16)
at com.mwq.hibernate.BaseDao.queryList(BaseDao.java:29)
at com.mwq.hibernate.Dao.queryManagerOfNatural(Dao.java:141)
at com.mwq.frame.LandFrame.<init>(LandFrame.java:100)
at com.mwq.PersonnelManage.land(PersonnelManage.java:32)
at com.mwq.PersonnelManage$1.run(PersonnelManage.java:26)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.NullPointerException
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:144)
at org.hibernate.cfg.Environment.<clinit>(Environment.java:529)
... 17 more
请版主帮忙看下,谢了!