Need to specify class name in environment or system property, or as an applet parameter, or in an ap

参考:http://www.blogjava.net/keweibo/articles/353676.html

错误:Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial


原因:hibernate.cfg.xml中的session-factory标签多了name属性,hibernate会试图把这个sessionfacotry注册到JNDI中去,而却找不大JNDI的配置


解决方法一:添加配置

在hibernate.cfg.xml添加如下配置

  org.jnp.interfaces.NamingContextFactory
  localhost:1099


解决方法二:去session-factory标签的name属性



你可能感兴趣的:(hibernate)