1、错误描述
WARN:HHH00027:Could not bind factory to JNDI
org.hibernate.engine.jndi.JndiException:Error parsing JNDI name[foo]
Caused by:javax.naming.NoInitialContextException:Need to specify class name in environment or system property,or as an applet parameter,or in an application resource file:java.naming.factory.inital
2、错误原因
在hibernate.cfg.xml中配置
<session-factory name="foo"></session-factory>
中添加了name属性
3、解决办法
去掉<session-factory name="foo"></session-factory>中的name属性