1.在eclipse中用hibernate tools生成hibernate.cfg.xml后,运行程序会出现如下错误
WARN: HHH000277: Could not bind factory to JNDI
org.hibernate.service.jndi.JndiException: Error parsing JNDI name []
其实,我们仔细看hibernate.cfg.xml会发现。
只需删掉<session-factory>标签中的name属性就行了。改正后为:
2.出现如下错误:
INFO: HHH000182: No default (no-argument) constructor for class: com.mkyong.common.Category (class must be instantiated by Interceptor)
应该给javabean有一个无参的构造函数。