org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource

时间:2021-07-02 08:56:02

二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'URIEcoding' to 'UTF-8' did not find a matching property.
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/8.0.37
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Sep 1 2016 10:01:52 UTC
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 8.0.37.0
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 7
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 6.1
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: C:\Program Files\Java\jdk1.8.0_20\jre
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.8.0_20-b26
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: E:\apache-tomcat-8.0.37
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: E:\apache-tomcat-8.0.37
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=E:\apache-tomcat-8.0.37
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=E:\apache-tomcat-8.0.37
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=E:\apache-tomcat-8.0.37\webapps
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=E:\apache-tomcat-8.0.37\endorsed
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=GBK
二月 20, 2017 3:09:47 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.8.0_20\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_20/bin/server;C:/Program Files/Java/jre1.8.0_20/bin;C:/Program Files/Java/jre1.8.0_20/lib/amd64;C:\Program Files (x86)\Common Files\NetSarang;C:\ProgramData\Oracle\Java\javapath;D:\soft\Oracle\product\11.2.0\dbhome_1\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.7.0_45\bin;C:\Program Files\Java\jdk1.8.0_20\bin;C:\Program Files\Java\jdk1.8.0_20\jre\bin;C:\Program Files\MySQL\MySQL Server 5.5\bin;E:\apache-maven-3.3.9\bin;C:\Program Files\TortoiseSVN\bin2;C:\Program Files\TortoiseSVN\bin;D:\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\Program Files\Java\jdk1.8.0_20\bin;C:\Program Files\Java\jdk1.8.0_20\jre\bin;E:\apache-maven-3.3.9\bin;G:\eclipse;;.
二月 20, 2017 3:09:48 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-nio-8080"]
二月 20, 2017 3:09:48 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
二月 20, 2017 3:09:48 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-nio-8009"]
二月 20, 2017 3:09:48 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
二月 20, 2017 3:09:48 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 870 ms
二月 20, 2017 3:09:48 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
二月 20, 2017 3:09:48 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.0.37
二月 20, 2017 3:09:48 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor E:\apache-tomcat-8.0.37\conf\Catalina\localhost\woyoubao.xml
二月 20, 2017 3:09:48 下午 org.apache.catalina.startup.HostConfig deployDescriptor
警告: A docBase E:\apache-tomcat-8.0.37\webapps\woyoubao inside the host appBase has been specified, and will be ignored
二月 20, 2017 3:09:48 下午 org.apache.catalina.startup.SetContextPropertiesRule begin
警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:woyoubao' did not find a matching property.
二月 20, 2017 3:09:55 下午 org.apache.jasper.servlet.TldScanner scanJars
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
二月 20, 2017 3:09:55 下午 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
二月 20, 2017 3:09:55 下午 org.apache.catalina.core.ApplicationContext log
信息: Set web app root system property: 'webapp.root' = [E:\apache-tomcat-8.0.37\webapps\woyoubao\]
二月 20, 2017 3:09:55 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing log4j from [classpath:log4j.xml]
二月 20, 2017 3:09:55 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
二月 20, 2017 3:09:58 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [SqlMapConfig.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error registering typeAlias for 'User'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.woyoubao.domain.User
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:736)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:587)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1798)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [SqlMapConfig.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error registering typeAlias for 'User'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.woyoubao.domain.User
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:434)
at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:340)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
... 25 more
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error registering typeAlias for 'User'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.woyoubao.domain.User
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:106)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:89)
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:428)
... 28 more
Caused by: org.apache.ibatis.builder.BuilderException: Error registering typeAlias for 'User'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.woyoubao.domain.User
at org.apache.ibatis.builder.xml.XMLConfigBuilder.typeAliasesElement(XMLConfigBuilder.java:127)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:96)
... 30 more
Caused by: java.lang.ClassNotFoundException: Cannot find class: com.woyoubao.domain.User
at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:188)
at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:87)
at org.apache.ibatis.io.Resources.classForName(Resources.java:254)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.typeAliasesElement(XMLConfigBuilder.java:120)
... 31 more

二月 20, 2017 3:09:58 下午 org.apache.catalina.core.StandardContext startInternal
严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
二月 20, 2017 3:09:58 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/woyoubao] startup failed due to previous errors
2017-02-20 15:09:58,145 [鏃ュ織鏉ヨ嚜锛歸eb.context.ContextLoader 鏃ュ織鍐呭锛欳ontext initialization failed]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [SqlMapConfig.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error registering typeAlias for 'User'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.woyoubao.domain.User
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:736)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:587)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1798)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [SqlMapConfig.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error registering typeAlias for 'User'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.woyoubao.domain.User
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:434)
at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:340)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
... 25 more
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error registering typeAlias for 'User'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.woyoubao.domain.User
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:106)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:89)
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:428)
... 28 more
Caused by: org.apache.ibatis.builder.BuilderException: Error registering typeAlias for 'User'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.woyoubao.domain.User
at org.apache.ibatis.builder.xml.XMLConfigBuilder.typeAliasesElement(XMLConfigBuilder.java:127)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:96)
... 30 more
Caused by: java.lang.ClassNotFoundException: Cannot find class: com.woyoubao.domain.User
at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:188)
at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:87)
at org.apache.ibatis.io.Resources.classForName(Resources.java:254)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.typeAliasesElement(XMLConfigBuilder.java:120)
... 31 more
二月 20, 2017 3:09:58 下午 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
二月 20, 2017 3:09:58 下午 org.apache.catalina.core.ApplicationContext log
信息: Shutting down log4j
二月 20, 2017 3:09:58 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
警告: The web application [woyoubao] appears to have started a thread named [FileWatchdog] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Thread.sleep(Native Method)
org.apache.log4j.helpers.FileWatchdog.run(FileWatchdog.java:104)
二月 20, 2017 3:09:58 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deployment of configuration descriptor E:\apache-tomcat-8.0.37\conf\Catalina\localhost\woyoubao.xml has finished in 10,046 ms
二月 20, 2017 3:09:58 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\apache-tomcat-8.0.37\webapps\docs
二月 20, 2017 3:09:58 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory E:\apache-tomcat-8.0.37\webapps\docs has finished in 47 ms
二月 20, 2017 3:09:58 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\apache-tomcat-8.0.37\webapps\examples
二月 20, 2017 3:09:58 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
二月 20, 2017 3:09:58 下午 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
二月 20, 2017 3:09:58 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory E:\apache-tomcat-8.0.37\webapps\examples has finished in 278 ms
二月 20, 2017 3:09:58 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\apache-tomcat-8.0.37\webapps\host-manager
二月 20, 2017 3:09:58 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory E:\apache-tomcat-8.0.37\webapps\host-manager has finished in 26 ms
二月 20, 2017 3:09:58 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\apache-tomcat-8.0.37\webapps\manager
二月 20, 2017 3:09:58 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory E:\apache-tomcat-8.0.37\webapps\manager has finished in 28 ms
二月 20, 2017 3:09:58 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\apache-tomcat-8.0.37\webapps\ROOT
二月 20, 2017 3:09:58 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory E:\apache-tomcat-8.0.37\webapps\ROOT has finished in 21 ms
二月 20, 2017 3:09:58 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\apache-tomcat-8.0.37\webapps\teb
二月 20, 2017 3:09:58 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory E:\apache-tomcat-8.0.37\webapps\teb has finished in 18 ms
二月 20, 2017 3:09:58 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-nio-8080"]
二月 20, 2017 3:09:58 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-nio-8009"]
二月 20, 2017 3:09:58 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 10542 ms

解决办法:选中项目-->点击上方project -->点击clean清理下工程-->点击Build project -->debug on server