Today I write a program with S2SH, the following error occurred:
Org.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' sessionfactory ' defined in Class path resource [Applicationcontext.xml]: Invocation of Init method failed; Nested exception is org.hibernate.HibernateException:Could not parse Configuration:file:/g:/%e5%a4%a7%e4%ba%8c%e5%af %92%e5%81%87%e5%ad%a6%e4%b9%a0/javaee/oa/webroot/web-inf/classes/hibernate.cfg.xml at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1338) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:473) at Org.springframework.beans.factory.support.abstractautowirecapablebeanfactory$1.run ( abstractautowirecapablebeanfactory.java:409) at java.security.AccessController.doPrivileged (Native Method) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (Abstractautowirecapablebeanfactory.java:380) at org.springframework.beans.factory.support.abstractbeanfactory$1. GetObject (abstractbeanfactory.java:264) at Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:222) at Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:261) at Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:185) at Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:164) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:423) at Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:728) at Org.springframework.context.support.AbstractApplicationContext.refresh (Abstractapplicationcontext.java: 380) at org.springframework.context.support.classpathxmlapplicationcontext.<init> ( classpathxmlapplicationcontext.java:139) at Org.springframework.context.support.classpathxmlapplicationcontext.<init> ( classpathxmlapplicationcontext.java:83) at yyz.oa.test.testspring.<init> (TestSpring.java:11) at Sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) at Sun.reflect.NativeConstructorAccessorImpl.newInstance (nativeconstructoraccessorimpl.java:57) at Sun.reflect.DelegatingConstructorAccessorImpl.newInstance (delegatingconstructoraccessorimpl.java:45) at Java.lang.reflect.Constructor.newInstance (constructor.java:526) at Org.junit.runners.BlockJUnit4ClassRunner.createTest (blockjunit4classrunner.java:195) at Org.junit.runners.blockjunit4classrunner$1.runreflectivecall (blockjunit4classrunner.java:244) at Org.junit.internal.runners.model.ReflectiveCallable.run (reflectivecallable.java:12) at Org.junIt.runners.BlockJUnit4ClassRunner.methodBlock (blockjunit4classrunner.java:241) at Org.junit.runners.BlockJUnit4ClassRunner.runChild (blockjunit4classrunner.java:70) at Org.junit.runners.BlockJUnit4ClassRunner.runChild (blockjunit4classrunner.java:50) at Org.junit.runners.parentrunner$3.run (parentrunner.java:238) at Org.junit.runners.parentrunner$1.schedule ( parentrunner.java:63) at Org.junit.runners.ParentRunner.runChildren (parentrunner.java:236) at org.junit.runners.parentrunner.access$000 (parentrunner.java:53) at org.junit.runners.parentrunner$2. Evaluate (parentrunner.java:229) at Org.junit.runners.ParentRunner.run (parentrunner.java:309) 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: Org.hibernate.HibernateException:Could Not parse configuration:file:/g:/%e5%a4%a7%e4%ba%8c%e5%af%92%e5%81%87%e5% Ad%a6%e4%b9%a0/javaee/oa/webroot/web-inf/classes/hibernate.cfg.xml at Org.hibernate.cfg.Configuration.doConfigure (configuration.java:1528) at Org.hibernate.cfg.Configuration.configure (configuration.java:1477) at Org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory (Localsessionfactorybean.java : 601) at Org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet ( abstractsessionfactorybean.java:211) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods ( Abstractautowirecapablebeanfactory.java:1369) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1335) Panax Notoginseng more caused by:org.dom4j.DocumentException:www.hibernate.org Nested exception:www.hibernate.org at org.dom4j . Io. Saxreader.read (saxreader.java:484) at org.hibernate.cfg.Configuration.doConfigure (configuration.java:1518) &NBSP, ..... More
In the author of various search documents, all kinds of Baidu, all kinds of entanglements, all kinds of sad after unexpectedly found this is myeclipse a bug= =. I don't know how to describe my mood. Now I write it, I hope you do not be the pit: [Applicationcontext.xml]: Invocation of the Init method failed; Nested exception is org.hibernate.HibernateException:Could not parse Configuration:file:/g:/%e5%a4%a7%e4%ba%8c%e5%af %92%e5%81%87%e5%ad%a6%e4%b9%a0/javaee/oa/webroot/web-inf/classes/hibernate.cfg.xml.
There are a bunch of garbled characters, but I do not have the Chinese path in the project. Whimsical to delete the hibernate.cfg.xml in the Chinese note after ... Bug solved ... Bug solved.
Hibernate summarizes--myeclipse's small bug