我弄的是公司员工管理系统是java项目,用的是swing+hibernate3.2+Oracle9i
以下是错误提示:
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(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
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
以下是我的hibernate.cfg.xml配置文件的内容:
<?xml version='1.0' encoding='GBK'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><hibernate-configuration> <session-factory> <property name="connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="connection.url">
jdbc:oracle:thin:@127.0.0.1:1521:DBSQL
</property>
<property name="connection.username">PERSONNEL_MANAGE</property>
<property name="connection.password">MWQ</property>
<property name="dialect">
org.hibernate.dialect.OracleDialect
</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="use_sql_comments">true</property> <mapping resource="com/mwq/hibernate/mapping/TbDept.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbPersonalInfo.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbNativePlace.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbBringUpContent.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbReckoningList.hbm.xml" />
<mapping resource="com/mwq/hibernate/mapping/TbManager.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbRewardsAndPunishment.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbAccountItem.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbDutyInfo.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbReckoning.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbTimecard.hbm.xml" />
<mapping resource="com/mwq/hibernate/mapping/TbNation.hbm.xml" />
<mapping resource="com/mwq/hibernate/mapping/TbRecord.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbReckoningInfo.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbAccessionForm.hbm.xml" />
<mapping resource="com/mwq/hibernate/mapping/TbDuty.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbBringUpOntent.hbm.xml" /> </session-factory></hibernate-configuration>先谢谢了!!!
以下是错误提示:
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(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
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
以下是我的hibernate.cfg.xml配置文件的内容:
<?xml version='1.0' encoding='GBK'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><hibernate-configuration> <session-factory> <property name="connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="connection.url">
jdbc:oracle:thin:@127.0.0.1:1521:DBSQL
</property>
<property name="connection.username">PERSONNEL_MANAGE</property>
<property name="connection.password">MWQ</property>
<property name="dialect">
org.hibernate.dialect.OracleDialect
</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="use_sql_comments">true</property> <mapping resource="com/mwq/hibernate/mapping/TbDept.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbPersonalInfo.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbNativePlace.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbBringUpContent.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbReckoningList.hbm.xml" />
<mapping resource="com/mwq/hibernate/mapping/TbManager.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbRewardsAndPunishment.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbAccountItem.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbDutyInfo.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbReckoning.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbTimecard.hbm.xml" />
<mapping resource="com/mwq/hibernate/mapping/TbNation.hbm.xml" />
<mapping resource="com/mwq/hibernate/mapping/TbRecord.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbReckoningInfo.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbAccessionForm.hbm.xml" />
<mapping resource="com/mwq/hibernate/mapping/TbDuty.hbm.xml" />
<mapping
resource="com/mwq/hibernate/mapping/TbBringUpOntent.hbm.xml" /> </session-factory></hibernate-configuration>先谢谢了!!!
解决方案 »
- 返回Integer,call.setReturnType该怎么设置
- 传参数问题,急!
- 求教,用IDEA的人遇到过类文件上有个小叉吗?代表什么意思?
- 在jbuilder2005里使用jdbc连接oracle 9i 数据库问题
- 急急急急,请教axis web服务的问题.
- 寻求'WEB权限设计'的资料或意见,希望大家畅所欲言...
- 散分
- 配置jbuilder7自带的sample中的ESiteWL有错,来者有分!
- 用jbuilder写ejb的测试程序时的问题?
- 各位前辈,救救我吧!我的SQL SERVER数据库中有时间字段create_date(数值为2003-3-4这种形式),在JSP中如何根据这个字段值筛选出某一周
- 很奇怪的问题
- 在 hibernate中configuration.configure(configFile);这句报错java.lang.SecurityException: org/apache/commons/
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)
主要看这里,初始化hibernate工厂的时候没有能够成功,空指针异常,看看这几个方法之间的连接是哪个就明白了。
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:144)
at org.hibernate.cfg.Environment. <clinit>(Environment.java:529) 空指针 ,貌似没找到配置文件中的某些内容