zoukankan      html  css  js  c++  java
  • Exception 01 : org.hibernate.engine.jndi.JndiException: Error parsing JNDI name [foo]

    异常名称

    org.hibernate.engine.jndi.JndiException: Error parsing JNDI name [foo]

    异常截屏

    image

    异常详细信息

    org.hibernate.engine.jndi.JndiException: Error parsing JNDI name [foo]

    at org.hibernate.engine.jndi.internal.JndiServiceImpl.parseName(JndiServiceImpl.java:141)

    at org.hibernate.engine.jndi.internal.JndiServiceImpl.bind(JndiServiceImpl.java:157)

    at org.hibernate.internal.SessionFactoryRegistry.addSessionFactory(SessionFactoryRegistry.java:103)

    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:497)

    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1859)

    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1930)

    at cn.itsource.hibernate.day1.hello.HelloTest.save(HelloTest.java:26)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)

    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)

    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)

    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)

    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)

    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)

    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)

    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)

    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)

    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)

    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)

    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

    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.initial

    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)

    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)

    at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)

    at javax.naming.InitialContext.getNameParser(Unknown Source)

    at org.hibernate.engine.jndi.internal.JndiServiceImpl.parseName(JndiServiceImpl.java:135)

    ... 29 more

    异常排除流程

    <session-factory name="foo">

    Hibernate4.x版本配置文件hibernate.cfg.xml必须去掉name="foo"

  • 相关阅读:
    R语言代写混合时间模型预测对时间序列进行点估计
    python代写安娜卡列妮娜词云图制作
    R语言代写markov switching model马尔可夫转换分析研究水资源
    R语言代写markov switching model马尔可夫转换模型研究商业周期
    Python代写数据可视化-seabornIris鸢尾花数据
    R语言代写聚类算法的应用实例
    用TensorFlow代写实现MNIST
    R语言代写Copula的贝叶斯非参数估计
    r语言代写预测波动率的实现:ARCH模型与HAR-RV模型
    CF932E Team Work 第二类斯特林数
  • 原文地址:https://www.cnblogs.com/applerosa/p/5950868.html
Copyright © 2011-2022 走看看