myeclipse下的struts+hibernate问题. private static Log log = LogFactory.getLog(HibernateUtil.class); =============這句有問題,你去看下 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 提示出错的是这句喔:throw new ExceptionInInitializerError(ex); hibernate.cfg.xml:............ <session-factory> <property name="connection.username">root</property> <property name="connection.url">jdbc:mysql://localhost/shoponline?useUnicode=true&characterEncoding=gbk</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <property name="connection.password">root</property> <property name="connection.driver_class">org.gjt.mm.mysql.Driver</property> <property name="hibernate.connection.pool_size">100</property> <property name="show_sql">false</property> <!-- Mapping files --> <mapping resource="model.hbm.xml"/> </session-factory>................ private static Log log = LogFactory.getLog(HibernateUtil.class); private static final SessionFactory sessionFactory; static { try { // Create the SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); } catch (Throwable ex) { ex.printStackTrace(); //log.error("Initial SessionFactory creation failed.", ex); throw new ExceptionInInitializerError(ex); } } 就上面着段的问题了,private static Log log = LogFactory.getLog(HibernateUtil.class); 是不是这? 你用的是log4j吧, 我用的时候是这样的 private static Logger logger = Logger.getLogger(HibernateUtil.class); ServletContextListener的问题 mysql数据库安装不了 关于 WEBSphere 的使用问题 spring初学者应该怎么才能学好? ms sql server2000 for jdbc驱动连接数据库问题 iis5+tomcat整合后图片不能正常显示。 大家一起谈谈使用struts开发工具的感受? 我想寫一個程序﹐能在客戶端將本機上同目錄下的文件一次性copy到3到4台或更多的服務器上。 昏!Struts你好毒啊? 请看我的JavaMail为何不能发邮件?有代码。 新手请教webservice问题 问一些关于动态网页的代码是怎么生成问题
hibernate.cfg.xml:
............
<session-factory>
<property name="connection.username">root</property>
<property name="connection.url">jdbc:mysql://localhost/shoponline?useUnicode=true&characterEncoding=gbk</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.password">root</property>
<property name="connection.driver_class">org.gjt.mm.mysql.Driver</property>
<property name="hibernate.connection.pool_size">100</property>
<property name="show_sql">false</property>
<!-- Mapping files -->
<mapping resource="model.hbm.xml"/>
</session-factory>
................
try {
// Create the SessionFactory
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable ex) {
ex.printStackTrace();
//log.error("Initial SessionFactory creation failed.", ex);
throw new ExceptionInInitializerError(ex);
}
}
就上面着段的问题了,private static Log log = LogFactory.getLog(HibernateUtil.class); 是不是这?
我用的时候是这样的
private static Logger logger = Logger.getLogger(HibernateUtil.class);