Eclipse中无法显示命名空间Namespace,Spring Config Editor也没显示 1C

找到File Associations,在File types中找到*.xml项,如果没有就点击Add来添加,选中*.xml然后在Associated editors中选中Spring Config Editor。但问题是Spring Config Editor没有显示。我在网上也没找到有关插件,求大神帮忙

1个回答

重新安装Spring Tool Suite,你用的是Eclipse Marketplace安装的sts吧,那就打开它,找到installed选项卡,然后找到你之前安装的sts,会有Update和Uninstall两个选项,任你选咯,可以都试试嘛积累下经验

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
ssm项目的问题 Servlet.init() for servlet [spring-dispatcher] threw exception
跟着网上的ssm项目做,可以说代码基本都是照着敲的。但是还是会有各种各样的bug。这个问题困扰我两天了,网上常见的我都试过,包括spring和jdk版本的适配,jar包的调整等等。请各位大佬帮忙看一下,感激不尽!下面是我警告和错误的代码: ``` WARN org.springframework.web.context.support.XmlWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [D:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\o2o\WEB-INF\classes\spring\spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\o2o\WEB-INF\classes\mapper\AreaDao.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [D:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\o2o\WEB-INF\classes\mapper\AreaDao.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'com.immoc.o2o.entity.Area'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.immoc.o2o.entity.Area 19:32:17.316 [http-nio-8080-exec-3] ERRORorg.springframework.web.servlet.DispatcherServlet - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [D:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\o2o\WEB-INF\classes\spring\spring-dao.xml]: Invocation of init method failed; ``` 下面是错误中提到的AreaDao.xml: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.immoc.o2o.dao.AreaDao"> <select id="queryArea" resultType="com.immoc.o2o.entity.Area"> SELECT area_id,area_name,priority,create_time,last_edit_time FROM tb_area ORDER BY priority DESC </select> </mapper> ``` Controller: ``` package com.immoc.o2o.web.superadmin; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.immoc.o2o.entity.Area; import com.immoc.o2o.service.AreaService; @Controller @RequestMapping("/superadmin") public class AreaController { @Autowired private AreaService areaService ; @RequestMapping(value="/listarea",method=RequestMethod.GET)//涉及前端的全小写 //pose的传值是相对安全的,而get的传值会反馈到URL上面 @ResponseBody private Map <String,Object> listArea(){ Map <String,Object> modelMap= new HashMap<String,Object>();//map's key不能重复 List<Area> list=new ArrayList<Area>(); try { list=areaService.getAreaList(); modelMap.put("rows", list); modelMap.put("total", list.size()); }catch(Exception e) { e.printStackTrace(); modelMap.put("success", false); modelMap.put("errMsg", e.toString()); } return modelMap; } } ``` pom的配置,都是一些基本的配置,spring版本我用的都是最新的5.1.8 ``` <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.immoc</groupId> <artifactId>o2o</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>o2o Maven Webapp</name> <url>http://maven.apache.org</url> <dependencies> <!-- maven-dependency-plugin是来自csdn的博客 --> <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-dependency-plugin --> <dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>3.1.1</version> </dependency> <!-- 原作是junit,这里已经升级 --> <!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api --> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <version>5.5.1</version> <scope>test</scope> </dependency> <!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-classic --> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.2.3</version> </dependency> <!-- 这里用的都是5.1.8,而在原作里是设置了spring version的 --> <!-- https://mvnrepository.com/artifact/org.springframework/spring-core --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>5.1.8.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-beans这个其实就是备注 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>5.1.8.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-context --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>5.1.8.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>5.1.8.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-tx --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>5.1.8.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-web --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>5.1.8.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc 核心--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>5.1.8.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-test --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>5.1.8.RELEASE</version> <scope>test</scope> </dependency> <!-- 除了spring之外还用到其他的架包,比如servlet --> <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>4.0.1</version> <scope>provided</scope> </dependency> <!-- 根据csdn加的jackson-core --> <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core --> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.9.9</version> </dependency> <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind --> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.9.9</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> <!-- commons collection has been moved to commons collections4 --> <version>4.1</version> </dependency> <!-- https://mvnrepository.com/artifact/org.mybatis/mybatis --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.5.2</version> </dependency> <!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>2.0.2</version> </dependency> <!-- 下面适合数据库配合的架包 --> <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.17</version> </dependency> <!-- 连接池 --> <!-- https://mvnrepository.com/artifact/com.mchange/c3p0 --> <dependency> <groupId>com.mchange</groupId> <artifactId>c3p0</artifactId> <version>0.9.5.4</version> </dependency> </dependencies> <build> <finalName>o2o</finalName> <plugins> <plugin> <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin --> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>1.8</source> <target>1.8</target> <encoding>UTF8</encoding> </configuration> </plugin> </plugins> </build> </project> ``` 下面加个springDao吧: ``` <?xml version="1.0" encoding="UTF-8"?> <!-- 引入schema约束 --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation= "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd "> <!-- mvc是新加入的 --> <!-- 加载jdbc.properties配置文件--> <context:property-placeholder location="classpath:jdbc.properties"/> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="driverClass" value="${jdbc.driver}"></property> <property name="jdbcUrl" value="${jdbc.url}"></property> <property name="user" value="${jdbc.username}"></property> <property name="password" value="${jdbc.password}"></property> <!-- c3p0的私有属性 --> <property name="maxPoolSize" value="30"/> <property name="minPoolSize" value="10"/> <!-- 关闭连接后不自动commit --> <property name="autoCommitOnClose" value="false"/> <!-- 获取超时链接的时间--> <property name="checkoutTimeout" value="10000"/> <!-- 连接失败的重试次数 --> <property name="acquireRetryAttempts" value="2"/> </bean> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="configLocation" value="classpath:mybatis-config.xml" /> <property name="typeAliasesPackage" value="com.immoc.entity" /> <!-- 上面一行中原代码没有o2o --> <property name="mapperLocations" value="classpath:mapper/*.xml" /> </bean> <!-- 配置dao接口包,动态实现dao接口 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" /> <property name="basePackage" value="com.immoc.o2o.dao" /> <!-- 上面一行中原代码没有o2o,后来又加上了 --> </bean> </beans> ``` 顺便说一下,debug真的好难呀,随便一下一天就过去了
使用spring3.07时出现Unable to locate Spring NamespaceHandler for XML schema namespace
以下是使用junit测试时的异常代码(注:单独测试Component和Resource没有问题。) org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/aop] Offending resource: class path resource [beans.xml] at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:284) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1335) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1328) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at cn.com.ckx.service.UserServiceTest.testAdd(UserServiceTest.java:11) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) 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) ---------------------------beans.xml文件--------------------------------- <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"> <context:annotation-config /> <context:component-scan base-package="cn.com.ckx" /> <aop:aspectj-autoproxy /> </beans> ------------------------------使用aspect注解代码------------------------------------- package cn.com.ckx.aop; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.springframework.stereotype.Component; @Aspect @Component public class AopAnnotaion { @Before("execution(public void cn.com.ckx.dao.imple.UserDaoImple.save(cn.com.ckx.User))") public void before() { System.out.println("aspect save start!"); } } ------------------------------测试文件代码------------------------------------------- package cn.com.ckx.service; import org.junit.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; import cn.com.ckx.modle.User; public class UserServiceTest { @Test public void testAdd() { ClassPathXmlApplicationContext ctx=new ClassPathXmlApplicationContext("beans.xml"); UserService userService=(UserService)ctx.getBean("userService"); User u=new User(); userService.add(u); } } -------------------------------jar包-------------------------------------------- org.springframework.asm-3.0.7.RELEASE.jar org.springframework.beans-3.0.7.RELEASE.jar org.springframework.context-3.0.7.RELEASE.jar org.springframework.core-3.0.7.RELEASE.jar org.springframework.expression-3.0.7.RELEASE.jar aspectjrt.jar aspectjweaver.jar commons-logging-1.1.1.jar
spring mvc与struts 整合报错
报错如下 求帮忙,谢谢 严重: Exception starting filter struts2 Unable to load configuration. - action - file:/E:/java/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/bishe/WEB-INF/classes/struts.xml:11:74 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:450) at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4001) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4651) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:785) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) 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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: Unable to load configuration. - action - file:/E:/java/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/bishe/WEB-INF/classes/struts.xml:11:74 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437) ... 20 more Caused by: Error building results for action addProduct in namespace / - action - file:/E:/java/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/bishe/WEB-INF/classes/struts.xml:11:74 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:389) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:495) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:286) at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:234) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66) ... 22 more Caused by: There is no result type defined for type 'erro' mapped with name 'success'. Did you mean 'erro'? - result - file:/E:/java/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/bishe/WEB-INF/classes/struts.xml:13:23 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildResults(XmlConfigurationProvider.java:653) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:387) ... 27 more 四月 22, 2015 9:53:12 下午 org.apache.catalina.core.StandardContext start 严重: Error filterStart web.xml配置 <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <!-- springMVC配置 --> <servlet> <servlet-name>springMVC</servlet-name> <!-- 拦截器类 --> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <!-- 加载配置文件 --> <param-name>contextConfigLocation</param-name> <param-value>classpath*:/springMVC-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springMVC</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> struts2.xml配置 <struts> <constant name="struts.enable.DynamicMethodInvocation" value="true" /> <constant name="struts.devMode" value="false" /> <!--前台 /actionName localhost:8888/struts_1809/basic1 --> <package name="basic" namespace="/" extends="struts-default"> <action name="addProduct" class="com.fcz.action.product.ProductAction" > <result name="success">/jsp/admin/adminIndex.jsp</result> <result type="erro">/jsp/404.jsp</result> </action> </package> </struts> applicationContext.xml配置 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> <bean id="productDao" class="com.fcz.dao.product.ProductDaoImpl"></bean> <bean id="addProduct" class="com.fcz.action.product.ProductAction" scope="prototype"> <property name="productDao" ref="productDao"></property> </bean> </beans>
为什么我配置Spring的事务后不能得到BEAN
我配置Spring的事务后不能得到BEAN 如果把事务的部分去掉的话就能够得到 下面这是applicationContext.xml [code="xml"] <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd "> <bean id="myDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver"></property> <property name="url" value="jdbc:jtds:sqlserver://localhost:1433/soft2005"></property> <property name="username" value="sa"></property> <property name="password" value=""></property> </bean> <bean id="SessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="myDataSource"></property> <property name="mappingResources"> <list> <value>com/yhwj/secsms/po/Cgnx.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.SybaseDialect </prop> </props> </property> </bean> <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="SessionFactory"></property> </bean> <tx:advice id="myadvice" transaction-manager="txManager"> <tx:attributes> <tx:method name="*" /> </tx:attributes> </tx:advice> <aop:config> <!-- <aop:pointcut id="myPoin" expression="execution(* com.yhwj.secsms.dao.CgnxDAO.*(..))"/> <aop:advisor id="myAdvi" advice-ref="myadvice" pointcut-ref="myPoin"/> --> <aop:advisor pointcut="execution(* com.yhwj.secsms.dao.CgnxDAO.*(..))" advice-ref="myadvice"/> </aop:config> <bean id="CgnxDAO" class="com.yhwj.secsms.dao.CgnxDAO"> <property name="sessionFactory"> <ref bean="SessionFactory" /> </property> </bean></beans> [/code] 下面是测试类cgnxTest.java [code="java"] package com.yhwj.secsms.bo; import java.util.Iterator; import java.util.List; import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; import com.yhwj.secsms.dao.CgnxDAO; import com.yhwj.secsms.po.Cgnx; import junit.framework.TestCase; public class cgnxTest extends TestCase { ApplicationContext ac=new FileSystemXmlApplicationContext("src/applicationContext.xml"); public void testCgnxAddFind() { CgnxDAO cdao=(CgnxDAO) ac.getBean("CgnxDAO"); com.yhwj.secsms.vo.Cgnx cg=new com.yhwj.secsms.vo.Cgnx(); cg.setCgnx("12年"); Cgnx cg1=(Cgnx) cg.getPO(); cdao.save(cg1); List l=cdao.findAll(); assertTrue(l.size()>0); } } [/code] 下面的是运行后LOG4J抓的东西 INFO - Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@8f4fb3: display name [org.springframework.context.support.FileSystemXmlApplicationContext@8f4fb3]; startup date [Wed Jul 02 09:09:49 CST 2008]; root of context hierarchy DEBUG - Class [org.apache.commons.collections.map.LinkedMap] or one of its dependencies is not present: java.lang.ClassNotFoundException: org.apache.commons.collections.map.LinkedMap DEBUG - Creating [java.util.concurrent.ConcurrentHashMap] DEBUG - Creating [java.util.LinkedHashSet] DEBUG - Creating [java.util.LinkedHashMap] DEBUG - Creating [java.util.LinkedHashSet] DEBUG - Creating [java.util.concurrent.ConcurrentHashMap] DEBUG - Creating [java.util.concurrent.ConcurrentHashMap] DEBUG - Loading schema mappings from [META-INF/spring.schemas] DEBUG - Loaded schema mappings: {http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd, http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd, http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd, http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd, http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd, http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd, http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-2.0.xsd, http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd, http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd, http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd, http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd} DEBUG - Loading schema mappings from [META-INF/spring.schemas] DEBUG - Loaded schema mappings: {http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd, http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd, http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd, http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd, http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd, http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd, http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-2.0.xsd, http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd, http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd, http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd, http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd} INFO - Loading XML bean definitions from file [F:\自助设备客户服务管理系统\工程\src\applicationContext.xml] DEBUG - Using JAXP provider [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl] DEBUG - Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/beans/spring-beans-2.0.xsd] DEBUG - Found XML schema [http://www.springframework.org/schema/beans/spring-beans-2.0.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-2.0.xsd DEBUG - Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/tx/spring-tx-2.0.xsd] DEBUG - Found XML schema [http://www.springframework.org/schema/tx/spring-tx-2.0.xsd] in classpath: org/springframework/transaction/config/spring-tx-2.0.xsd DEBUG - Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/aop/spring-aop-2.0.xsd] DEBUG - Found XML schema [http://www.springframework.org/schema/aop/spring-aop-2.0.xsd] in classpath: org/springframework/aop/config/spring-aop-2.0.xsd DEBUG - Loaded mappings [{http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler, http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler, http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler, http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler, http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler, http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler}] DEBUG - Loading bean definitions DEBUG - Creating [java.util.LinkedHashMap] DEBUG - Loaded 8 bean definitions from location pattern [src/applicationContext.xml] INFO - Bean factory for application context [org.springframework.context.support.FileSystemXmlApplicationContext@8f4fb3]: org.springframework.beans.factory.support.DefaultListableBeanFactory@16c9867 DEBUG - 8 beans defined in org.springframework.context.support.FileSystemXmlApplicationContext@8f4fb3: display name [org.springframework.context.support.FileSystemXmlApplicationContext@8f4fb3]; startup date [Wed Jul 02 09:09:49 CST 2008]; root of context hierarchy DEBUG - Creating shared instance of singleton bean 'org.springframework.aop.config.internalAutoProxyCreator' DEBUG - Creating instance of bean 'org.springframework.aop.config.internalAutoProxyCreator' with merged definition [Root bean: class [org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] DEBUG - Getting BeanInfo for class [org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator] DEBUG - Caching PropertyDescriptors for class [org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator] DEBUG - Found bean property 'advisorAdapterRegistry' of type [org.springframework.aop.framework.adapter.AdvisorAdapterRegistry] DEBUG - Found bean property 'applyCommonInterceptorsFirst' of type [boolean] DEBUG - Found bean property 'beanClassLoader' of type [java.lang.ClassLoader] DEBUG - Found bean property 'beanFactory' of type [org.springframework.beans.factory.BeanFactory] DEBUG - Found bean property 'class' of type [java.lang.Class] DEBUG - Found bean property 'customTargetSourceCreators' of type [[Lorg.springframework.aop.framework.autoproxy.TargetSourceCreator;] DEBUG - Found bean property 'exposeProxy' of type [boolean] DEBUG - Found bean property 'frozen' of type [boolean] DEBUG - Found bean property 'interceptorNames' of type [[Ljava.lang.String;] DEBUG - Found bean property 'opaque' of type [boolean] DEBUG - Found bean property 'optimize' of type [boolean] DEBUG - Found bean property 'order' of type [int] DEBUG - Found bean property 'proxyTargetClass' of type [boolean] DEBUG - Creating [java.util.LinkedHashMap] DEBUG - Eagerly caching bean 'org.springframework.aop.config.internalAutoProxyCreator' to allow for resolving potential circular references INFO - Bean 'org.springframework.aop.config.internalAutoProxyCreator' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) DEBUG - Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@148662] DEBUG - Creating [java.util.LinkedHashSet] DEBUG - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@178460d] DEBUG - Creating [java.util.LinkedHashMap] INFO - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@16c9867: defining beans [myDataSource,SessionFactory,txManager,myadvice,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.aop.aspectj.AspectJExpressionPointcut,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor,CgnxDAO]; root of factory hierarchy DEBUG - Creating shared instance of singleton bean 'myDataSource' DEBUG - Creating instance of bean 'myDataSource' with merged definition [Root bean: class [org.springframework.jdbc.datasource.DriverManagerDataSource]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [F:\自助设备客户服务管理系统\工程\src\applicationContext.xml]] DEBUG - Getting BeanInfo for class [org.springframework.jdbc.datasource.DriverManagerDataSource] DEBUG - Caching PropertyDescriptors for class [org.springframework.jdbc.datasource.DriverManagerDataSource] DEBUG - Found bean property 'class' of type [java.lang.Class] DEBUG - Found bean property 'connection' of type [java.sql.Connection] DEBUG - Found bean property 'connectionProperties' of type [java.util.Properties] DEBUG - Found bean property 'driverClassName' of type [java.lang.String] DEBUG - Found bean property 'logWriter' of type [java.io.PrintWriter] DEBUG - Found bean property 'loginTimeout' of type [int] DEBUG - Found bean property 'password' of type [java.lang.String] DEBUG - Found bean property 'url' of type [java.lang.String] DEBUG - Found bean property 'username' of type [java.lang.String] DEBUG - Creating [java.util.LinkedHashMap] DEBUG - Eagerly caching bean 'myDataSource' to allow for resolving potential circular references INFO - Loaded JDBC driver: net.sourceforge.jtds.jdbc.Driver DEBUG - Creating shared instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor' DEBUG - Creating instance of bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor' with merged definition [Root bean: class [org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] DEBUG - Did not attempt to auto-proxy infrastructure class [org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] DEBUG - Getting BeanInfo for class [org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] DEBUG - Caching PropertyDescriptors for class [org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] DEBUG - Found bean property 'advice' of type [org.aopalliance.aop.Advice] DEBUG - Found bean property 'adviceBeanName' of type [java.lang.String] DEBUG - Found bean property 'beanFactory' of type [org.springframework.beans.factory.BeanFactory] DEBUG - Found bean property 'class' of type [java.lang.Class] DEBUG - Found bean property 'order' of type [int] DEBUG - Found bean property 'perInstance' of type [boolean] DEBUG - Found bean property 'pointcut' of type [org.springframework.aop.Pointcut] DEBUG - Creating [java.util.LinkedHashMap] DEBUG - Eagerly caching bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor' to allow for resolving potential circular references DEBUG - Creating instance of bean 'org.springframework.aop.aspectj.AspectJExpressionPointcut' with merged definition [Root bean: class [org.springframework.aop.aspectj.AspectJExpressionPointcut]; scope=prototype; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] DEBUG - Getting BeanInfo for class [org.springframework.aop.aspectj.AspectJExpressionPointcut] DEBUG - Caching PropertyDescriptors for class [org.springframework.aop.aspectj.AspectJExpressionPointcut] DEBUG - Found bean property 'class' of type [java.lang.Class] DEBUG - Found bean property 'classFilter' of type [org.springframework.aop.ClassFilter] DEBUG - Found bean property 'expression' of type [java.lang.String] DEBUG - Found bean property 'location' of type [java.lang.String] DEBUG - Found bean property 'methodMatcher' of type [org.springframework.aop.MethodMatcher] DEBUG - Found bean property 'parameterNames' of type [[Ljava.lang.String;] DEBUG - Found bean property 'parameterTypes' of type [[Ljava.lang.Class;] DEBUG - Found bean property 'pointcutDeclarationScope' of type [java.lang.Class] DEBUG - Found bean property 'pointcutExpression' of type [org.aspectj.weaver.tools.PointcutExpression] DEBUG - Found bean property 'runtime' of type [boolean] DEBUG - Creating [java.util.LinkedHashMap] DEBUG - Creating [java.util.LinkedHashSet] DEBUG - Creating shared instance of singleton bean 'SessionFactory' DEBUG - Creating instance of bean 'SessionFactory' with merged definition [Root bean: class [org.springframework.orm.hibernate3.LocalSessionFactoryBean]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [F:\自助设备客户服务管理系统\工程\src\applicationContext.xml]] DEBUG - Getting BeanInfo for class [org.springframework.orm.hibernate3.LocalSessionFactoryBean] DEBUG - Caching PropertyDescriptors for class [org.springframework.orm.hibernate3.LocalSessionFactoryBean] DEBUG - Found bean property 'cacheableMappingLocations' of type [[Lorg.springframework.core.io.Resource;] DEBUG - Found bean property 'class' of type [java.lang.Class] DEBUG - Found bean property 'collectionCacheStrategies' of type [java.util.Properties] DEBUG - Found bean property 'configLocation' of type [org.springframework.core.io.Resource] DEBUG - Found bean property 'configLocations' of type [[Lorg.springframework.core.io.Resource;] DEBUG - Found bean property 'configuration' of type [org.hibernate.cfg.Configuration] DEBUG - Found bean property 'configurationClass' of type [java.lang.Class] DEBUG - Found bean property 'dataSource' of type [javax.sql.DataSource] DEBUG - Found bean property 'entityCacheStrategies' of type [java.util.Properties] DEBUG - Found bean property 'entityInterceptor' of type [org.hibernate.Interceptor] DEBUG - Found bean property 'eventListeners' of type [java.util.Map] DEBUG - Found bean property 'exposeTransactionAwareSessionFactory' of type [boolean] DEBUG - Found bean property 'filterDefinitions' of type [[Lorg.hibernate.engine.FilterDefinition;] DEBUG - Found bean property 'hibernateProperties' of type [java.util.Properties] DEBUG - Found bean property 'jdbcExceptionTranslator' of type [org.springframework.jdbc.support.SQLExceptionTranslator] DEBUG - Found bean property 'jtaTransactionManager' of type [javax.transaction.TransactionManager] DEBUG - Found bean property 'lobHandler' of type [org.springframework.jdbc.support.lob.LobHandler] DEBUG - Found bean property 'mappingDirectoryLocations' of type [[Lorg.springframework.core.io.Resource;] DEBUG - Found bean property 'mappingJarLocations' of type [[Lorg.springframework.core.io.Resource;] DEBUG - Found bean property 'mappingLocations' of type [[Lorg.springframework.core.io.Resource;] DEBUG - Found bean property 'mappingResources' of type [[Ljava.lang.String;] DEBUG - Found bean property 'namingStrategy' of type [org.hibernate.cfg.NamingStrategy] DEBUG - Found bean property 'object' of type [java.lang.Object] DEBUG - Found bean property 'objectType' of type [java.lang.Class] DEBUG - Found bean property 'schemaUpdate' of type [boolean] DEBUG - Found bean property 'singleton' of type [boolean] DEBUG - Found bean property 'typeDefinitions' of type [[Lorg.springframework.orm.hibernate3.TypeDefinitionBean;] DEBUG - Found bean property 'useTransactionAwareDataSource' of type [boolean] DEBUG - Creating [java.util.LinkedHashMap] DEBUG - Eagerly caching bean 'SessionFactory' to allow for resolving potential circular references DEBUG - Returning cached instance of singleton bean 'myDataSource' DEBUG - Creating [java.util.LinkedHashSet] DEBUG - Creating [java.util.LinkedHashMap] INFO - Hibernate 3.1.3 INFO - hibernate.properties not found INFO - using CGLIB reflection optimizer INFO - using JDK 1.4 java.sql.Timestamp handling DEBUG - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] DEBUG - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/ DEBUG - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath INFO - Mapping class: com.yhwj.secsms.po.Cgnx -> cgnx DEBUG - Mapped property: cgnxId -> cgnxID DEBUG - Mapped property: cgnx -> cgnx INFO - Building new Hibernate SessionFactory DEBUG - Preparing to build session factory with filters : {} DEBUG - processing extends queue DEBUG - processing collection mappings DEBUG - processing native query and ResultSetMapping mappings DEBUG - processing association property references DEBUG - processing foreign key constraints INFO - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider DEBUG - Creating new JDBC Connection to [jdbc:jtds:sqlserver://localhost:1433/soft2005] INFO - RDBMS: Microsoft SQL Server, version: 08.00.2039 INFO - JDBC driver: jTDS Type 4 JDBC Driver for MS SQL Server and Sybase, version: 1.2.2 INFO - Using dialect: org.hibernate.dialect.SybaseDialect INFO - Using default transaction strategy (direct JDBC transactions) INFO - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) INFO - Automatic flush during beforeCompletion(): disabled INFO - Automatic session close at end of transaction: disabled INFO - Scrollable result sets: enabled DEBUG - Wrap result sets: disabled INFO - JDBC3 getGeneratedKeys(): enabled INFO - Connection release mode: on_close INFO - Default batch fetch size: 1 INFO - Generate SQL with comments: disabled INFO - Order SQL updates by primary key: disabled INFO - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory INFO - Using ASTQueryTranslatorFactory INFO - Query language substitutions: {} INFO - Second-level cache: enabled INFO - Query cache: disabled INFO - Cache provider: org.hibernate.cache.EhCacheProvider INFO - Optimize cache for minimal puts: disabled INFO - Structured second-level cache entries: disabled DEBUG - Using dialect defined converter INFO - Statistics: disabled INFO - Deleted entity synthetic identifier rollback: disabled INFO - Default entity-mode: pojo INFO - building session factory DEBUG - Session factory constructed with filter configurations : {} DEBUG - instantiating session factory with properties: {java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=D:\Program Files\MyEclipse 5.5 GA\jre\bin, java.vm.version=1.5.0_11-b03, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=CN, sun.java.launcher=SUN_STANDARD, sun.os.patch.level=Service Pack 3, java.vm.specification.name=Java Virtual Machine Specification, user.dir=F:\自助设备客户服务管理系统\工程, java.runtime.version=1.5.0_11-b03, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=D:\Program Files\MyEclipse 5.5 GA\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\, line.separator= , java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows XP, sun.jnu.encoding=GBK, java.library.path=D:\Program Files\MyEclipse 5.5 GA\jre\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.5.0_07\\bin;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\StormII\Codec;C:\Program Files\StormII, java.specification.name=Java Platform API Specification, java.class.version=49.0, sun.management.compiler=HotSpot Client Compiler, os.version=5.1, user.home=C:\Documents and Settings\Administrator, user.timezone=Asia/Shanghai, hibernate.connection.release_mode=on_close, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=GBK, java.specification.version=1.5, java.class.path=F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\classes;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jstl.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\standard.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\antlr-2.7.6rc1.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\asm-attrs.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\asm.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\c3p0-0.9.0.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\cglib-2.1.3.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\commons-collections-2.1.1.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\commons-logging-1.0.4.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\concurrent-1.3.2.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\connector.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\dom4j-1.6.1.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\ehcache-1.1.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\hibernate3.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jaas.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jacc-1_0-fr.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jaxen-1.1-beta-7.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jboss-cache.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jboss-common.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jboss-jmx.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jboss-system.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jdbc2_0-stdext.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jgroups-2.2.8.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jta.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jtds-1.2.2.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\log4j-1.2.11.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\oscache-2.1.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\proxool-0.8.3.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\swarmcache-1.0rc2.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\xerces-2.6.2.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\xml-apis.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\aopalliance.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\asm-2.2.3.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\asm-commons-2.2.3.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\asm-util-2.2.3.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\aspectjrt.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\aspectjweaver.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\backport-util-concurrent.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\bsh-2.0b4.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\c3p0-0.9.1.1.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\cglib-nodep-2.1_3.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\commonj-twm.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\commons-attributes-api.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\commons-attributes-compiler.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\commons-dbcp.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\commons-lang.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\commons-logging.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\ehcache-1.2.4.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\groovy-1.0.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\hessian-3.0.20.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\hibernate-annotations.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\hibernate-commons-annotations.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\hibernate-entitymanager.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\ibatis-2.3.0.677.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jakarta-oro-2.0.8.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jamon-2.4.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jboss-archive-browsing.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jdo2-api.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jmxremote.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jmxremote_optional.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jmxri.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jotm.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\jruby.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\log4j-1.2.14.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\openjpa-0.9.7-incubating.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\persistence.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\quartz-all-1.6.0.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\serp-1.12.1.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-agent.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-aop.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-beans.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-context.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-core.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-dao.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-hibernate3.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-ibatis.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-jdbc.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-jdo.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-jmx.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-jpa.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-remoting.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-support.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-tomcat-weaver.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\spring-toplink.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\toplink-api.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\toplink-essentials.jar;F:\自助设备客户服务管理系统\工程\WebRoot\WEB-INF\lib\xapool.jar;D:\Program Files\MyEclipse 5.5 GA\eclipse\plugins\org.junit_3.8.1\junit.jar;/D:/Program Files/MyEclipse 5.5 GA/eclipse/plugins/org.eclipse.jdt.junit_3.2.1.r321_v20060810/junitsupport.jar;/D:/Program Files/MyEclipse 5.5 GA/eclipse/plugins/org.eclipse.jdt.junit.runtime_3.2.1.r321_v20060721/junitruntime.jar, user.name=Administrator, java.vm.specification.version=1.0, sun.arch.data.model=32, java.home=D:\Program Files\MyEclipse 5.5 GA\jre, hibernate.dialect=org.hibernate.dialect.SybaseDialect, java.specification.vendor=Sun Microsystems Inc., user.language=zh, awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, hibernate.cglib.use_reflection_optimizer=true, java.version=1.5.0_11, java.ext.dirs=D:\Program Files\MyEclipse 5.5 GA\jre\lib\ext, sun.boot.class.path=D:\Program Files\MyEclipse 5.5 GA\jre\lib\rt.jar;D:\Program Files\MyEclipse 5.5 GA\jre\lib\i18n.jar;D:\Program Files\MyEclipse 5.5 GA\jre\lib\sunrsasign.jar;D:\Program Files\MyEclipse 5.5 GA\jre\lib\jsse.jar;D:\Program Files\MyEclipse 5.5 GA\jre\lib\jce.jar;D:\Program Files\MyEclipse 5.5 GA\jre\lib\charsets.jar;D:\Program Files\MyEclipse 5.5 GA\jre\classes;D:\Program Files\MyEclipse 5.5 GA\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_5.5.0\data\libraryset\1.4\activation.jar;D:\Program Files\MyEclipse 5.5 GA\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_5.5.0\data\libraryset\1.4\javax.servlet.jar;D:\Program Files\MyEclipse 5.5 GA\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_5.5.0\data\libraryset\1.4\javax.servlet.jsp.jar;D:\Program Files\MyEclipse 5.5 GA\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_5.5.0\data\libraryset\1.4\jboss-j2ee.jar;D:\Program Files\MyEclipse 5.5 GA\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_5.5.0\data\libraryset\1.4\jboss-jaxrpc.jar;D:\Program Files\MyEclipse 5.5 GA\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_5.5.0\data\libraryset\1.4\jboss-jsr77.jar;D:\Program Files\MyEclipse 5.5 GA\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_5.5.0\data\libraryset\1.4\jboss-saaj.jar;D:\Program Files\MyEclipse 5.5 GA\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_5.5.0\data\libraryset\1.4\mail.jar;D:\Program Files\MyEclipse 5.5 GA\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_5.5.0\data\libraryset\1.4\namespace.jar;D:\Program Files\MyEclipse 5.5 GA\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_5.5.0\data\libraryset\1.4\xml-apis.jar, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, hibernate.connection.provider_class=org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider, sun.cpu.endian=little, sun.io.unicode.encoding=UnicodeLittle, sun.desktop=windows, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86} DEBUG - Creating new CacheManager with default config DEBUG - Configuring ehcache from classpath. WARN - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/F:/%e8%87%aa%e5%8a%a9%e8%ae%be%e5%a4%87%e5%ae%a2%e6%88%b7%e6%9c%8d%e5%8a%a1%e7%ae%a1%e7%90%86%e7%b3%bb%e7%bb%9f/%e5%b7%a5%e7%a8%8b/WebRoot/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml DEBUG - Disk Store Path: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ DEBUG - Static SQL for entity: com.yhwj.secsms.po.Cgnx DEBUG - Version select: select cgnxID from secsms.dbo.cgnx where cgnxID =? DEBUG - Snapshot select: select cgnx_.cgnxID, cgnx_.cgnx as cgnx0_ from secsms.dbo.cgnx cgnx_ where cgnx_.cgnxID=? DEBUG - Insert 0: insert into secsms.dbo.cgnx (cgnx, cgnxID) values (?, ?) DEBUG - Update 0: update secsms.dbo.cgnx set cgnx=? where cgnxID=? DEBUG - Delete 0: delete from secsms.dbo.cgnx where cgnxID=? DEBUG - Identity insert: insert into secsms.dbo.cgnx (cgnx) values (?) DEBUG - Static select for entity com.yhwj.secsms.po.Cgnx: select cgnx0_.cgnxID as cgnxID0_0_, cgnx0_.cgnx as cgnx0_0_ from secsms.dbo.cgnx cgnx0_ where cgnx0_.cgnxID=? DEBUG - Static select for entity com.yhwj.secsms.po.Cgnx: select cgnx0_.cgnxID as cgnxID0_0_, cgnx0_.cgnx as cgnx0_0_ from secsms.dbo.cgnx cgnx0_ where cgnx0_.cgnxID=? DEBUG - Static select for entity com.yhwj.secsms.po.Cgnx: select cgnx0_.cgnxID as cgnxID0_0_, cgnx0_.cgnx as cgnx0_0_ from secsms.dbo.cgnx cgnx0_ where cgnx0_.cgnxID=? DEBUG - Static select for entity com.yhwj.secsms.po.Cgnx: select cgnx0_.cgnxID as cgnxID0_0_, cgnx0_.cgnx as cgnx0_0_ from secsms.dbo.cgnx cgnx0_ where cgnx0_.cgnxID=? DEBUG - Static select for action ACTION_MERGE on entity com.yhwj.secsms.po.Cgnx: select cgnx0_.cgnxID as cgnxID0_0_, cgnx0_.cgnx as cgnx0_0_ from secsms.dbo.cgnx cgnx0_ where cgnx0_.cgnxID=? DEBUG - Static select for action ACTION_REFRESH on entity com.yhwj.secsms.po.Cgnx: select cgnx0_.cgnxID as cgnxID0_0_, cgnx0_.cgnx as cgnx0_0_ from secsms.dbo.cgnx cgnx0_ where cgnx0_.cgnxID=? DEBUG - initializing class SessionFactoryObjectFactory DEBUG - registered: 4028808b1ae151ae011ae151b9410000 (unnamed) INFO - Not binding factory to JNDI, no JNDI name configured DEBUG - instantiated session factory DEBUG - Checking 0 named HQL queries DEBUG - Checking 0 named SQL queries DEBUG - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor' DEBUG - Creating shared instance of singleton bean 'txManager' DEBUG - Creating instance of bean 'txManager' with merged definition [Root bean: class [org.springframework.orm.hibernate3.HibernateTransactionManager]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [F:\自助设备客户服务管理系统\工程\src\applicationContext.xml]] DEBUG - Getting BeanInfo for class [org.springframework.orm.hibernate3.HibernateTransactionManager] DEBUG - Caching PropertyDescriptors for class [org.springframework.orm.hibernate3.HibernateTransactionManager] DEBUG - Found bean property 'autodetectDataSource' of type [boolean] DEBUG - Found bean property 'beanFactory' of type [org.springframework.beans.factory.BeanFactory] DEBUG - Found bean property 'class' of type [java.lang.Class] DEBUG - Found bean property 'dataSource' of type [javax.sql.DataSource] DEBUG - Found bean property 'defaultTimeout' of type [int] DEBUG - Found bean property 'entityInterceptor' of type [org.hibernate.Interceptor] DEBUG - Found bean property 'entityInterceptorBeanName' of type [java.lang.String] DEBUG - Found bean property 'failEarlyOnGlobalRollbackOnly' of type [boolean] DEBUG - Found bean property 'globalRollbackOnParticipationFailure' of type [boolean] DEBUG - Found bean property 'jdbcExceptionTranslator' of type [org.springframework.jdbc.support.SQLExceptionTranslator] DEBUG - Found bean property 'nestedTransactionAllowed' of type [boolean] DEBUG - Found bean property 'prepareConnection' of type [boolean] DEBUG - Found bean property 'resourceFactory' of type [java.lang.Object] DEBUG - Found bean property 'rollbackOnCommitFailure' of type [boolean] DEBUG - Found bean property 'sessionFactory' of type [org.hibernate.SessionFactory] DEBUG - Found bean property 'transactionSynchronization' of type [int] DEBUG - Found bean property 'transactionSynchronizationName' of type [java.lang.String] DEBUG - Creating [java.util.LinkedHashMap] DEBUG - Eagerly caching bean 'txManager' to allow for resolving potential circular references DEBUG - Returning cached instance of singleton bean 'SessionFactory' DEBUG - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor' DEBUG - Creating [java.util.LinkedHashSet] INFO - Using DataSource [org.springframework.jdbc.datasource.DriverManagerDataSource@76db09] of Hibernate SessionFactory for HibernateTransactionManager DEBUG - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor' DEBUG - Creating shared instance of singleton bean 'myadvice' DEBUG - Creating instance of bean 'myadvice' with merged definition [Root bean: class [org.springframework.transaction.interceptor.TransactionInterceptor]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] DEBUG - Did not attempt to auto-proxy infrastructure class [org.springframework.transaction.interceptor.TransactionInterceptor] DEBUG - Getting BeanInfo for class [org.springframework.transaction.interceptor.TransactionInterceptor] DEBUG - Caching PropertyDescriptors for class [org.springframework.transaction.interceptor.TransactionInterceptor] DEBUG - Found bean property 'class' of type [java.lang.Class] DEBUG - Found bean property 'transactionAttributeSource' of type [org.springframework.transaction.interceptor.TransactionAttributeSource] DEBUG - Found bean property 'transactionAttributeSources' of type [[Lorg.springframework.transaction.interceptor.TransactionAttributeSource;] DEBUG - Found bean property 'transactionAttributes' of type [java.util.Properties] DEBUG - Found bean property 'transactionManager' of type [org.springframework.transaction.PlatformTransactionManager] DEBUG - Creating [java.util.LinkedHashMap] DEBUG - Eagerly caching bean 'myadvice' to allow for resolving potential circular references DEBUG - Returning cached instance of singleton bean 'txManager' DEBUG - Creating [java.util.LinkedHashSet] DEBUG - Creating instance of bean '(inner bean)' with merged definition [Root bean: class [org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] DEBUG - Getting BeanInfo for class [org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource] DEBUG - Caching PropertyDescriptors for class [org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource] DEBUG - Found bean property 'class' of type [java.lang.Class] DEBUG - Found bean property 'nameMap' of type [java.util.Map] DEBUG - Found bean property 'properties' of type [java.util.Properties] DEBUG - Creating [java.util.LinkedHashMap] DEBUG - Creating [java.util.LinkedHashMap] DEBUG - Adding transactional method [*] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT] DEBUG - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor' DEBUG - Creating [java.util.LinkedHashSet] DEBUG - Creating shared instance of singleton bean 'CgnxDAO' DEBUG - Creating instance of bean 'CgnxDAO' with merged definition [Root bean: class [com.yhwj.secsms.dao.CgnxDAO]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [F:\自助设备客户服务管理系统\工程\src\applicationContext.xml]] DEBUG - Getting BeanInfo for class [com.yhwj.secsms.dao.CgnxDAO] DEBUG - Caching PropertyDescriptors for class [com.yhwj.secsms.dao.CgnxDAO] DEBUG - Found bean property 'class' of type [java.lang.Class] DEBUG - Found bean property 'hibernateTemplate' of type [org.springframework.orm.hibernate3.HibernateTemplate] DEBUG - Found bean property 'sessionFactory' of type [org.hibernate.SessionFactory] DEBUG - Creating [java.util.LinkedHashMap] DEBUG - Eagerly caching bean 'CgnxDAO' to allow for resolving potential circular references DEBUG - Returning cached instance of singleton bean 'SessionFactory' DEBUG - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor' DEBUG - Returning cached instance of singleton bean 'myadvice' DEBUG - Creating [java.util.IdentityHashMap] DEBUG - Creating implicit proxy for bean 'CgnxDAO' with 0 common interceptors and 1 specific interceptors DEBUG - Creating JDK dynamic proxy: target source is SingletonTargetSource for target object [com.yhwj.secsms.dao.CgnxDAO@19855ed] DEBUG - Publishing event in context [org.springframework.context.support.FileSystemXmlApplicationContext@8f4fb3]: org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.context.support.FileSystemXmlApplicationContext@8f4fb3: display name [org.springframework.context.support.FileSystemXmlApplicationContext@8f4fb3]; startup date [Wed Jul 02 09:09:49 CST 2008]; root of context hierarchy] DEBUG - Returning cached instance of singleton bean 'CgnxDAO'
Springboot启动报错 一个是找不到url 一个是找不到dao
## 之前一直启动都没有问题,今天突然发现启动不了 ![图片说明](https://img-ask.csdn.net/upload/201910/10/1570671612_490949.jpg) ## 然后我把启动的位置改成@SpringBootApplication(exclude = DataSourceAutoConfiguration.class) ``` package com.mall.shopping.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; /*@SpringBootApplication*/ @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } } ``` ## 然后会报新的错: ![图片说明](https://img-ask.csdn.net/upload/201910/10/1570671806_766601.jpg) # 到现在没找到新错误的原因 还是在报找不到dao的错误。 ## 实体类代码: ![图片说明](https://img-ask.csdn.net/upload/201910/10/1570672651_585106.jpg) ## controller代码: ``` package com.mall.shopping.demo.controller; import com.mall.shopping.demo.services.UserService; import com.mall.shopping.demo.vo.Huser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Iterator; import java.util.List; @Controller public class UserController { @Autowired private UserService userService; @RequestMapping("/tiao") public ModelAndView zhuan() { ModelAndView modelAndView = new ModelAndView("loginindex"); return modelAndView; } @RequestMapping("/tiao1") public ModelAndView zhuan1() { ModelAndView modelAndView = new ModelAndView("adminindex"); return modelAndView; } @RequestMapping("/Userlogin") public String userlogin(HttpServletRequest request, HttpServletResponse response) { String username = (String) request.getParameter("username"); String userpwd = (String)request.getParameter("userpwd"); List<Huser> huser = userService.userlogin(); Iterator iter = huser.iterator(); while(iter.hasNext()){ Huser ha = (Huser) iter.next(); if(username.equals(ha.getHuser())) { if(userpwd.equals(ha.getHpwd())) { return "redirect:/tiao1"; } else { return "redirect:/tiao"; } } } return "redirect:/tiao"; } } ``` ## services代码: ``` package com.mall.shopping.demo.services; import com.mall.shopping.demo.dao.UserDao; import com.mall.shopping.demo.vo.Huser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class UserService { @Autowired private UserDao userDao; public List<Huser> userlogin(){ return userDao.userlogin();} } ``` ## daoceng代码: ``` package com.mall.shopping.demo.dao; import com.mall.shopping.demo.vo.Huser; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; import java.util.List; @Repository @Mapper public interface UserDao { List<Huser>userlogin(); } ``` ## mybatitsconfig: ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <!-- 开启驼蜂标识:last_name lastName --> <settings> <setting name="mapUnderscoreToCamelCase" value="true"/> </settings> <!-- 实体Bean别名 --> <typeAliases> <package name="com.mall.shopping.demo.vo.Huser"/> <package name="com.mall.shopping.demo.vo.Hdaohang"/> </typeAliases> <mappers> <mapper resource="mapper/select-login.xml"/> <mapper resource="mapper/select-hdaohang.xml"/> </mappers> </configuration> ``` ## xml代码: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.mall.shopping.demo.dao.UserDao"> <resultMap id="SelectLogin" type="com.mall.shopping.demo.vo.Huser"> <id property="hid" column="HID"></id> <result property="huser" column="HUSER"></result> <result property="hpwd" column="HPWD"></result> </resultMap> <select id="userlogin" resultMap="SelectLogin"> select * from huser </select> </mapper> ``` ## application.properties ``` server.port=8083 server.address=127.0.0.1 #server.session-timeout=60 spring.datasource.url=jdbc:oracle:thin:@127.0.0.1:1521:orcl spring.datasource.username=scott spring.datasource.password=tiger spring.datasource.driver-class-name=oracle.jdbc.OracleDriver mybatis.mapperLocations=classpath:mapper/*.xml mybatis.config-locations=classpath:mybatis/mybatis-config.xml spring.mvc.view.prefix=/WEB-INF/views/ spring.mvc.view.suffix=.jsp ``` ## pom文件: ``` <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.7.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.mall.shopping</groupId> <artifactId>demo</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name>demo</name> <description>Demo project for Spring Boot</description> <properties> <java.version>1.8</java.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> <spring.version>5.1.5.RELEASE</spring.version> <!-- mybatis版本号 --> <mybatis.version>3.4.5</mybatis.version> <!-- oracle驱动版本号 --> <oracle-driver.version>11.2.0</oracle-driver.version> <!-- log4j日志包版本号 --> <slf4j.version>1.7.18</slf4j.version> <log4j.version>1.2.17</log4j.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1.0</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>io.projectreactor</groupId> <artifactId>reactor-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> <!-- 添加spring核心库 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-oxm</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${spring.version}</version> </dependency> <!-- 添加mybatis依赖 --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>${mybatis.version}</version> </dependency> <!-- mybatis/spring包 --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.3.0</version> </dependency> <!-- oracle驱动依赖 --> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>${oracle-driver.version}</version> </dependency> <!-- dbcp,用来在spring-mybatis.xml中配置数据库 --> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.2.2</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-core</artifactId> <version>1.3.5</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>1.9.12</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-core-asl</artifactId> <version>1.9.12</version> </dependency> <dependency> <groupId>org.xmlunit</groupId> <artifactId>xmlunit-core</artifactId> </dependency> <!-- <dependency> <groupId>com.mchange</groupId> <artifactId>c3p0</artifactId> <version>0.9.5.2</version> </dependency>--> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> </dependency> <!--用于编译jsp --> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> <scope>provided</scope> </dependency> <!--添加热部署--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> <scope>true</scope> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>runtime</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <artifactId>maven-clean-plugin</artifactId> <version>3.1.0</version> </plugin> <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging --> <plugin> <artifactId>maven-resources-plugin</artifactId> <version>3.0.2</version> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.1</version> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>3.2.2</version> </plugin> <plugin> <artifactId>maven-install-plugin</artifactId> <version>2.5.2</version> </plugin> <plugin> <artifactId>maven-deploy-plugin</artifactId> <version>2.8.2</version> </plugin> <!--热部署配置--> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!--fork:如果没有该项配置,整个devtools不会起作用--> <fork>true</fork> </configuration> </plugin> <!-- <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <versionRange>[1.2,)</versionRange> <goals> <goal>enforce</goal> </goals> </pluginExecutionFilter> <action> <ignore /> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin>--> <!--mybatis 逆向工程插件--> <plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId> <version>1.3.5</version> <configuration> <configurationFile>src/main/resources/mybatis-generator/generatorConfig.xml</configurationFile> <verbose>true</verbose> <overwrite>true</overwrite> </configuration> <executions> <execution> <id>Generate MyBatis Artifacts</id> <goals> <goal>generate</goal> </goals> </execution> </executions> <dependencies> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>${oracle-driver.version}</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-core</artifactId> <version>1.3.5</version> </dependency> </dependencies> </plugin> </plugins> <!-- <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> <resource> <directory>src/main/resources</directory> </resource> </resources>--> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> </resources> </build> </project> ``` ## 目录结构: ![图片说明](https://img-ask.csdn.net/upload/201910/10/1570672730_102043.jpg)
Spring boot controller类加入@Autowired注解启动报错
![图片说明](https://img-ask.csdn.net/upload/201904/11/1554974904_886024.png) 工程结构 ``` //下面是全部的代码,最下面时错误日志。第一次提问,不知道插入代码片的格式是不是这样的,跪求大神指导,已经看了很多解决方案,但都无法解决我的问题,注释掉Autowired或者@注释掉Autowired(required=false)虽然可以启动项目,但是程序执行时又会发生错误,问题是逃避不了的。再次跪求大神指导。 //controller package controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import bean.AppMessage; import service.AppMessageService; @RestController @RequestMapping("/appmessage") public class AppMessageController { @Autowired/*(required=false)*/ private AppMessageService service; @RequestMapping("/getThree") public List<AppMessage> getThreeForMessage(){ List<AppMessage> list = service.getMessage(); return list; } @RequestMapping("/getAll") public List<AppMessage> getAllMessage(){ List<AppMessage> list = service.getAllMessage(); int num = list.size(); if(null!=list && num>3){ for (int i = 0; i < num-3; i++) { list.remove(0); } } return list; } @RequestMapping("/getByID") public List<AppMessage> getMessageById(@RequestParam("id") String id){ List<AppMessage> list = service.getMessageById(id); int num = list.size(); if(null!=list && num>5){ for (int i = 0; i < num-5; i++) { list.remove(0); } } return list; } @RequestMapping(value = "/add",method = RequestMethod.POST) public int addMessage(@RequestBody AppMessage appMessage){ return service.addMessage(appMessage); } @RequestMapping(value="/delMessageById",method=RequestMethod.POST) public int delMessageById(@RequestParam("id") String id){ return service.delMessage(id); } } ``` ``` //Service package service; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import bean.AppMessage; import mapper.AppMessageMapper; @Transactional @Service("appMessageService") public class AppMessageService { @Autowired private AppMessageMapper mapper; public List<AppMessage> getMessage(){ List<AppMessage> list = new ArrayList<AppMessage>(); list.add(mapper.selectByPrimaryKey("xtt")); //list = mapper.selectAll(); return list; } public List<AppMessage> getAllMessage(){ List<AppMessage> list = new ArrayList<AppMessage>(); list = mapper.selectAll(); return list; } public int addMessage(AppMessage appMessage) { return mapper.insert(appMessage); } public List<AppMessage> getMessageById(String id) { return mapper.getMessById(id); } public int delMessage(String id) { return mapper.deleteByPrimaryKey(id); } } ``` ``` //Mapper 接口,映射到mapper.xml package mapper; import java.util.List; import bean.AppMessage; public interface AppMessageMapper { int deleteByPrimaryKey(String id); int insert(AppMessage record); int insertSelective(AppMessage record); AppMessage selectByPrimaryKey(String id); int updateByPrimaryKeySelective(AppMessage record); int updateByPrimaryKey(AppMessage record); List<AppMessage> selectAll(); List<AppMessage> getMessById(String id); } ``` ``` <!-- Mapper.xml文件 --> <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <mapper namespace="mapper.AppMessageMapper" > <!-- 对应mapper接口的位置 --> <resultMap id="BaseResultMap" type="bean.AppMessage" > <id column="id" property="id" jdbcType="VARCHAR" /> <result column="message" property="message" jdbcType="VARCHAR" /> <result column="senddate" property="senddate" jdbcType="TIMESTAMP" /> </resultMap> <sql id="Base_Column_List" > id, message, senddate </sql> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > select <include refid="Base_Column_List" /> from appuser_message where id = #{id,jdbcType=VARCHAR} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > delete from appuser_message where id = #{id,jdbcType=VARCHAR} </delete> <insert id="insert" parameterType="bean.AppMessage" > insert into appuser_message (id, message, senddate ) values (#{id,jdbcType=VARCHAR}, #{message,jdbcType=VARCHAR}, #{senddate,jdbcType=TIMESTAMP} ) </insert> <insert id="insertSelective" parameterType="bean.AppMessage" > insert into appuser_message <trim prefix="(" suffix=")" suffixOverrides="," > <if test="id != null" > id, </if> <if test="message != null" > message, </if> <if test="senddate != null" > senddate, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides="," > <if test="id != null" > #{id,jdbcType=VARCHAR}, </if> <if test="message != null" > #{message,jdbcType=VARCHAR}, </if> <if test="senddate != null" > #{senddate,jdbcType=TIMESTAMP}, </if> </trim> </insert> <update id="updateByPrimaryKeySelective" parameterType="bean.AppMessage" > update appuser_message <set > <if test="message != null" > message = #{message,jdbcType=VARCHAR}, </if> <if test="senddate != null" > senddate = #{senddate,jdbcType=TIMESTAMP}, </if> </set> where id = #{id,jdbcType=VARCHAR} </update> <update id="updateByPrimaryKey" parameterType="bean.AppMessage" > update appuser_message set message = #{message,jdbcType=VARCHAR}, senddate = #{senddate,jdbcType=TIMESTAMP} where id = #{id,jdbcType=VARCHAR} </update> <select id="selectAll" resultMap="BaseResultMap"> select id, message, senddate from appuser_message order by senddate </select> <select id="getMessById" resultMap="BaseResultMap" parameterType="java.lang.String"> select id, message, senddate from appuser_message where id = #{id,jdbcType=VARCHAR} order by senddate asc </select> </mapper> ``` ``` //实体类 package bean; import java.util.Date; public class AppMessage { private String id; private String message; private Date senddate; public String getId() { return id; } public void setId(String id) { this.id = id == null ? null : id.trim(); } public String getMessage() { return message; } public void setMessage(String message) { this.message = message == null ? null : message.trim(); } public Date getSenddate() { return senddate; } public void setSenddate(Date senddate) { this.senddate = senddate; } } ``` ``` //启动类 package com.shuai.spring_boot_1; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; /** * Hello world! * */ @ComponentScan(basePackages="controller") @SpringBootApplication public class App { public static void main(String[] args) { SpringApplication.run(App.class, args); } } ``` ``` pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.3.5.RELEASE</version> </parent> <groupId>com.shuai</groupId> <artifactId>spring-boot-1</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>spring-boot-1</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency> <!--web应用基本环境配置 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.jayway.jsonpath</groupId> <artifactId>json-path</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <version>1.3.5.RELEASE</version> </dependency> --> </dependencies> <build> <plugins> <!-- spring-boot-maven-plugin插件就是打包spring boot应用的 --> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project> ``` ``` #properties文件 spring.datasource.url=jdbc:mysql://localhost:3306/world spring.datasource.username=root spring.datasource.password=000000 spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.max-idle=10 spring.datasource.max-wait=10000 spring.datasource.min-idle=5 spring.datasource.initial-size=5 server.port=8012 server.session.timeout=10 server.tomcat.uri-encoding=UTF-8 # mybatis.config= classpath:mybatis-config.xml mybatis.mapperLocations=classpath:mappers/*.xml # domain object's package #mybatis.typeAliasesPackage=com.lgp.SpringBoot.bean mybatis.typeAliasesPackage=bean # handler's package # mybatis.typeHandlersPackage= # check the mybatis configuration exists # mybatis.check-config-location= # mode of execution. Default is SIMPLE # mybatis.executorType= ``` ![图片说明](https://img-ask.csdn.net/upload/201904/11/1554976465_217387.png) 错误日志
Tomcat启动报错 显示404页面
五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server version: Apache Tomcat/8.0.47 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server built: Sep 29 2017 13:46:41 UTC 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server number: 8.0.47.0 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Name: Windows 7 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Version: 6.1 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Architecture: x86 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java Home: C:\Program Files (x86)\Java\jdk1.8.0_144\jre 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Version: 1.8.0_144-b01 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Vendor: Oracle Corporation 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: D:\work\git\shixi\.metadata\.plugins\org.eclipse.wst.server.core\tmp1 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: E:\shixi\download\tomcat8 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.base=D:\work\git\shixi\.metadata\.plugins\org.eclipse.wst.server.core\tmp1 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.home=E:\shixi\download\tomcat8 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dwtp.deploy=D:\work\git\shixi\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.endorsed.dirs=E:\shixi\download\tomcat8\endorsed 五月 06, 2019 9:08:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dfile.encoding=GBK 五月 06, 2019 9:08:54 下午 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 (x86)\Java\jdk1.8.0_144\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files (x86)/Java/jdk1.8.0_144/bin/../jre/bin/client;C:/Program Files (x86)/Java/jdk1.8.0_144/bin/../jre/bin;C:/Program Files (x86)/Java/jdk1.8.0_144/bin/../jre/lib/i386;E:\Rational\Common;C:\Program Files (x86)\Rational\common;C:\Windows\system32;C:\Windows;C:\Windows\system32\wbem;C:\Program Files (x86)\Java\jdk1.8.0_144\bin;C:\Program Files\Java\jre1.7.0_80\bin;E:\shixi\download\eclipse\eclipse;;. 五月 06, 2019 9:08:55 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-nio-8080"] 五月 06, 2019 9:08:55 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 五月 06, 2019 9:08:55 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-nio-8009"] 五月 06, 2019 9:08:55 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 五月 06, 2019 9:08:55 下午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 2045 ms 五月 06, 2019 9:08:55 下午 org.apache.catalina.core.StandardService startInternal 信息: Starting service Catalina 五月 06, 2019 9:08:55 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/8.0.47 五月 06, 2019 9:09:01 下午 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. 五月 06, 2019 9:09:01 下午 org.apache.catalina.startup.HostConfig deployDescriptor 信息: Deploying configuration descriptor D:\work\git\shixi\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\conf\Catalina\localhost\Research.xml 五月 06, 2019 9:09:01 下午 org.apache.catalina.startup.SetContextPropertiesRule begin 警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Research' did not find a matching property. 五月 06, 2019 9:09:09 下午 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. 五月 06, 2019 9:09:09 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 五月 06, 2019 9:09:09 下午 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.BeanDefinitionStoreException: Unexpected exception parsing XML document from file [D:\work\git\shixi\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\Research\WEB-INF\classes\applicationContext.xml]; nested exception is java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) 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:753) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:621) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1835) 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:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher at org.springframework.context.config.ContextNamespaceHandler$1.parse(ContextNamespaceHandler.java:65) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1297) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398) ... 26 more 五月 06, 2019 9:09:09 下午 org.apache.catalina.core.StandardContext startInternal 严重: One or more listeners failed to start. Full details will be found in the appropriate container log file 五月 06, 2019 9:09:09 下午 org.apache.catalina.core.StandardContext startInternal 严重: Context [/Research] startup failed due to previous errors 五月 06, 2019 9:09:09 下午 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 21:09:09,816 ERROR ContextLoader:215 - Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from file [D:\work\git\shixi\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\Research\WEB-INF\classes\applicationContext.xml]; nested exception is java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) 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:753) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:621) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1835) 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:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher at org.springframework.context.config.ContextNamespaceHandler$1.parse(ContextNamespaceHandler.java:65) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1297) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398) ... 26 more 五月 06, 2019 9:09:09 下午 org.apache.catalina.startup.HostConfig deployDescriptor 信息: Deployment of configuration descriptor D:\work\git\shixi\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\conf\Catalina\localhost\Research.xml has finished in 8,130 ms 五月 06, 2019 9:09:09 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-nio-8080"] 五月 06, 2019 9:09:09 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-nio-8009"] 五月 06, 2019 9:09:09 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in 14071 ms
spring整合mybatis时自动扫描 出错,求助各位大神
项目使用maven管理,分成四个子模块,jslj-controller是war包,其余三个是jar包 依赖关系 controller-->service-->mapper-->pojo ![目录](https://img-ask.csdn.net/upload/201704/14/1492135747_455177.png) spring和mybaits配置文件放在jslj-controller下 ![配置文件](https://img-ask.csdn.net/upload/201704/14/1492135990_333781.png) 配置文件 ``` <!-- 扫描包 --> <context:component-scan base-package="cn.jscoin" /> <!-- 数据源 druid --> <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"> <property name="driverClassName" value="${driverClassName}" /> <property name="url" value="${url}" /> <property name="username" value="${username}" /> <property name="password" value="${password}" /> </bean> <!-- 读取Property --> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <set> <value>classpath:jdbc.properties</value> </set> </property> </bean> <!-- Mybatis工厂 --> <bean class="org.mybatis.spring.SqlSessionFactoryBean"> <!-- 数据源 --> <property name="dataSource" ref="dataSource" /> <!-- 配置Mybati的核心配置文件 --> <property name="configLocation" value="classpath:mybatis-config.xml" /> </bean> <!-- 扫描基本包 Mapper 接口 Mapper文件 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="cn.jscoin.jslj.mapper" /> </bean> <!-- 事务 @Transactional --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <!-- 开启注解的事务 --> <tx:annotation-driven transaction-manager="transactionManager" /> ``` ![mapper](https://img-ask.csdn.net/upload/201704/14/1492136123_540871.png) mapper.xml代码 ``` <mapper namespace="cn.jscoin.jslj.mapper.UserMapper"> <!-- 添加 --> <insert id="add" parameterType="User"> insert into user_t (id,user_name,password,age) values (#{id},#{user_name},#{password},#{age}) </insert> </mapper> ``` ![测试](https://img-ask.csdn.net/upload/201704/14/1492136145_642144.png) @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations="classpath*:applicationContext.xml") public class UserTest { @Autowired private UserMapper userMapper; @Test public void testAdd(){ User user = new User(); user.setAge(123); userMapper.add(user); } }``` 错误提示 ``` org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cn.jscoin.jslj.UserTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.jscoin.jslj.mapper.UserMapper cn.jscoin.jslj.UserTest.userMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.jscoin.jslj.mapper.UserMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:385) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:252) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:254) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:217) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.jscoin.jslj.mapper.UserMapper cn.jscoin.jslj.UserTest.userMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.jscoin.jslj.mapper.UserMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:558) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) ... 26 more Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.jscoin.jslj.mapper.UserMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1308) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1054) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:530) ... 28 more ```
There is no Action mapped for namespace
使用的是J2EE+SHH框架, 具体代码如下: --- **struts.xml** ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <constant name="struts.custom.i18n.resources" value="message" /> <constant name="struts.i18n.encoding" value="UTF-8" /> <!-- 指定Struts 2默认的ObjectFactory Bean - 交给Spring管理 --> <constant name="struts.objectFactory" value="spring" /> <!-- 开发者模式 --> <!-- <constant name="struts.devMode" value="true" /> --> <!-- 指定每次配置文件更改后,自动重新加载 --> <constant name="struts.configuration.xml.reload" value="false" /> </struts> ``` --- **applicationContext.xml** ``` **<?xml version="1.0" encoding="UTF-8"?> <!-- context是自动扫描和使用注解的上下文前缀;aop,tx是事物管理的前缀 -->** <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd" default-autowire="byName"> <!-- 采用自动扫描的方式查找bean(DAO,Service等等),多个用逗号隔开 --> <context:component-scan base-package="com.cheer.bookshop" /> <!-- 定时器任务 --> <task:annotation-driven /> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <description>配置数据源</description> <property name="driverClassName" value="com.mysql.jdbc.Driver"></property> <property name="url" value="jdbc:mysql://localhost:3306/bookstore?useUnicode=true&amp;characterEncoding=UTF-8"></property> <property name="username" value="root"></property> <property name="password" value="123456"></property> <!-- 初始化连接数量 --> <property name="initialSize" value="1"/> <!-- 最大活动连接数量,一般等于数据库的最大并发数 --> <property name="maxActive" value="100"/> <!-- 最大空闲(等待)连接数量 --> <property name="maxIdle" value="-1"/> <!-- 最小空闲(等待)连接数量 --> <property name="minIdle" value="0"/> <!-- 获取连接时等待时间,超出将抛异常,单位毫秒 --> <property name="maxWait" value="10000"/> </bean> <!-- 配置hibernate session工厂 --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <description>将数据源注入到sessionFactory,使用注解方式</description> <property name="dataSource" ref="dataSource"></property> <!-- 配置hibernate的一些属性 --> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.format_sql">true</prop> <prop key="hibernate.current_session_context_class">thread</prop> <prop key="hibernate.connection.release_mode">after_transaction</prop><!-- 释放session --> </props> </property> <!-- 自动扫描注解方式配置的hibernate映射文件(实体类) --> <property name="packagesToScan"> <list> <value>com.cheer.bookshop.Model</value> </list> </property> </bean> <!-- 定义事务管理器 --> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <description> 增加事务管理</description> <property name="sessionFactory" ref="sessionFactory" /> </bean> <!-- 拦截器方式配置事务特性 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="delete*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> </tx:attributes> </tx:advice> <!-- 给business配置事务管理 --> <aop:config proxy-target-class="true"> <aop:pointcut id="allManagerMethod" expression="execution (* com.cheer.bookshop.*.*(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="allManagerMethod" /> </aop:config> </beans> ``` --- **JSP页面登陆Form表单** ``` <s:form action="userlogin.action" method="post"> <p><font color="red">&nbsp;&nbsp;&nbsp;${msg}</font></p> <div class="form_row"> <label class="contact"><strong>Username:</strong></label> <input type="text" class="contact_input" name="user.username" value="${user.username}"/> </div> <div class="form_row"> <label class="contact"><strong>Password:</strong></label> <input type="password" class="contact_input" name="user.password" value="${user.password}"/> </div> <div class="form_row"> <div class="terms"> <input type="checkbox" name="terms" /> Remember me </div> </div> <div class="form_row"> <input type="submit" class="register" value="login" /> </div> </s:form> ``` --- **Action类** ``` package com.cheer.bookshop.action; import java.io.IOException; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts2.ServletActionContext; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.Namespace; import org.apache.struts2.convention.annotation.Result; import com.cheer.bookshop.Model.User; import com.cheer.bookshop.service.impl.UserServiceImpl; import com.opensymphony.xwork2.ActionSupport; @Namespace("/") public class UserAction extends ActionSupport { @Resource private UserServiceImpl userServiceImpl; private User user; private String msg; //用户登录 @Action(value = "userlogin", results = {@Result(name = "success", location = "/index.jsp"), @Result(name = "input", location = "/jsp/user/myaccount.jsp", type = "redirect") }) public String login(){ User userdb = userServiceImpl.login(user.getUsername()); if(userdb != null){ String password = user.getPassword(); if(password.equals(userdb.getPassword())){ user=userdb; return SUCCESS; }else{ msg="密码错误,请重新输入!"; return INPUT; } }else{ msg="用户名不存在,请注册!"; return INPUT; } } //用户注册 @Action(value = "userregister", results = {@Result(name = "success", location = "/jsp/user/myaccount.jsp", type = "redirect") }) public String register(){ userServiceImpl.register(user); return SUCCESS; } //验证用户名是否已经被使用 @Action(value = "validateUsername") public String validateUsername() throws IOException{ HttpServletRequest request = ServletActionContext.getRequest(); HttpServletResponse response = ServletActionContext.getResponse(); response.setContentType("text/html;charset=UTF-8"); String username = request.getParameter("username"); boolean flag = userServiceImpl.validateUsername(username); if(flag){ response.getWriter().println("<p><font color='red'>用户名已经存在</font></p>"); }else{ response.getWriter().println("<p><font color='green'>用户名可以使用</font></p>"); } return NONE; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } } ``` --- 如上,Action有配置userlogin,登陆页form表单提交路径也是一样,单就是无法调整至aciton里,eclipse也没有报错,该如何解决? There is no Action mapped for namespace / and action name userlogin.
关于Spring开启组件扫描异常信息!求大佬!
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext-annotation.xml]; nested exception is java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at com.qn.test.TestHibernate.test5(TestHibernate.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher at org.springframework.context.config.ContextNamespaceHandler$1.parse(ContextNamespaceHandler.java:65) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1297) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398) ... 37 more 是JDK版本还是Spring版本低,求大佬给个解决方案!新人没分求好心人
org.springframework.context.config.AbstractSpecificationBeanDefinition 在哪个包呀?
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [config/spring/spring.xml]; nested exception is org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [org.springframework.transaction.config.TxNamespaceHandler] for namespace [http://www.springframework.org/schema/tx]: problem with handler class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/context/config/AbstractSpecificationBeanDefinitionParser at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:527) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:441) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at com.test.TestPjo.test(TestPjo.java:36) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) 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.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [org.springframework.transaction.config.TxNamespaceHandler] for namespace [http://www.springframework.org/schema/tx]: problem with handler class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/context/config/AbstractSpecificationBeanDefinitionParser at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:139) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1426) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1421) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) ... 37 more Caused by: java.lang.NoClassDefFoundError: org/springframework/context/config/AbstractSpecificationBeanDefinitionParser at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:791) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at org.springframework.transaction.config.TxNamespaceHandler.init(TxNamespaceHandler.java:44) at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:130) ... 44 more Caused by: java.lang.ClassNotFoundException: org.springframework.context.config.AbstractSpecificationBeanDefinitionParser at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 58 more ------ 我使用的spring是3.2.0版本的。
请教一下,到底我的mapper.xml哪里出错了,弄不明白为什么找不到我写的log类
## update一下经大佬提点后如何解决的 可能因为我曾用粗暴的方法改动过Log.java的类名,导致Log类编译出问题了,编译后类文件夹内根本没有Log.class文件。于是我又粗暴地delete了Log类重写了一次,果然没问题了。 顺便百度了一下如何修改类名 https://zhidao.baidu.com/question/340215163.html ## 原问题如下 小白入门程序媛,这个是一个mybatis的关于银行转账的小练习 在写log部分之前,我写的account部分测试过是没有问题的,转账的业务也成功了的。现在是想增加一个记录日志的操作,在数据库log表格添加转账记录,并且利用log4j在硬盘生成log file中记录转账信息。 可是按照同样的套路写了了log实体类后再写logmapper.xml,却出现了以下的错误,后来干脆连mybatis中的别名的部分都去掉了,直接在mapper.xml中使用完整的类名,还是说找不到我写的log类。实在搞不懂是namespace出错了还是怎么滴。。。。 ## 错误信息如下: ``` 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server version: Apache Tomcat/8.5.42 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server built: Jun 4 2019 20:29:04 UTC 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server number: 8.5.42.0 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Name: Windows 10 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Version: 10.0 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Architecture: amd64 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java Home: C:\Program Files\Java\jdk1.8.0_201\jre 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Version: 1.8.0_201-b09 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Vendor: Oracle Corporation 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: D:\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: D:\apache-tomcat-8.5.42 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.base=D:\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.home=D:\apache-tomcat-8.5.42 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dwtp.deploy=D:\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.endorsed.dirs=D:\apache-tomcat-8.5.42\endorsed 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dfile.encoding=UTF-8 七月 13, 2019 8:47:00 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: Loaded APR based Apache Tomcat Native library [1.2.21] using APR version [1.6.5]. 七月 13, 2019 8:47:00 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 七月 13, 2019 8:47:00 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 七月 13, 2019 8:47:00 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL 信息: OpenSSL successfully initialized [OpenSSL 1.1.1a 20 Nov 2018] 七月 13, 2019 8:47:00 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-nio-8080"] 七月 13, 2019 8:47:00 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 七月 13, 2019 8:47:00 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-nio-8009"] 七月 13, 2019 8:47:00 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 七月 13, 2019 8:47:00 下午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 828 ms 七月 13, 2019 8:47:00 下午 org.apache.catalina.core.StandardService startInternal 信息: Starting service [Catalina] 七月 13, 2019 8:47:00 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/8.5.42 七月 13, 2019 8:47:01 下午 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. 七月 13, 2019 8:47:02 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-nio-8080"] 七月 13, 2019 8:47:02 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-nio-8009"] 七月 13, 2019 8:47:02 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in 1377 ms 七月 13, 2019 8:47:32 下午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [yan.ibbie.servlet.TransferServlet] in context with path [/bank] threw exception org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### The error may exist in yan/ibbie/mapper/logmapper.xml ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'yan/ibbie/mapper/logmapper.xml'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'yan.ibbie.pojo.Log'. Cause: java.lang.ClassNotFoundException: Cannot find class: yan.ibbie.pojo.Log at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:80) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:64) at yan.ibbie.service.Impl.AccountServiceImpl.transfer(AccountServiceImpl.java:23) at yan.ibbie.servlet.TransferServlet.service(TransferServlet.java:36) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'yan/ibbie/mapper/logmapper.xml'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'yan.ibbie.pojo.Log'. Cause: java.lang.ClassNotFoundException: Cannot find class: yan.ibbie.pojo.Log at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:121) at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:99) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:78) ... 26 more Caused by: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'yan/ibbie/mapper/logmapper.xml'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'yan.ibbie.pojo.Log'. Cause: java.lang.ClassNotFoundException: Cannot find class: yan.ibbie.pojo.Log at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:120) at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:92) at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:373) at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:119) ... 28 more Caused by: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'yan.ibbie.pojo.Log'. Cause: java.lang.ClassNotFoundException: Cannot find class: yan.ibbie.pojo.Log at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:118) at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:68) at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:135) at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:128) at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:118) ... 31 more Caused by: org.apache.ibatis.type.TypeException: Could not resolve type alias 'yan.ibbie.pojo.Log'. Cause: java.lang.ClassNotFoundException: Cannot find class: yan.ibbie.pojo.Log at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:120) at org.apache.ibatis.builder.BaseBuilder.resolveAlias(BaseBuilder.java:149) at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:116) ... 35 more Caused by: java.lang.ClassNotFoundException: Cannot find class: yan.ibbie.pojo.Log at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:200) at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:89) at org.apache.ibatis.io.Resources.classForName(Resources.java:261) at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:116) ... 37 more ``` ## mybatis.xml如下: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <settings> <setting name="logImpl" value="LOG4J"/> </settings> <!-- default填默认使用的environment的id --> <environments default="default"> <!-- environment标签声明一个环境 --> <environment id="default"> <!-- type="JDBC"表示使用原生JDBC事务 --> <transactionManager type="JDBC"></transactionManager> <dataSource type="POOLED"> <property name="driver" value="com.mysql.cj.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/ssm?serverTimezone=GMT%2B8"/> <property name="username" value="root"/> <property name="password" value="1233210"/> </dataSource> </environment> </environments> <mappers> <mapper resource="yan/ibbie/mapper/accountmapper.xml"/> <mapper resource="yan/ibbie/mapper/logmapper.xml"/> </mappers> </configuration> ``` ## accountmapper.xml如下: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="yan.ibbie.mapper.accountmapper"> <!-- 根据账号和密码查询账户信息 --> <select id="selByAccnoPassword" resultType="yan.ibbie.pojo.Account" parameterType="yan.ibbie.pojo.Account"> select * from account where accno=#{accNo} and password=#{password} </select> <!-- 根据账号和姓名查询账户信息 --> <select id="selByAccnoName" resultType="yan.ibbie.pojo.Account" parameterType="yan.ibbie.pojo.Account"> select * from account where accno=#{accNo} and name=#{name} </select> <!-- 根据账号修改账户余额 --> <update id="updBalanceByAccno" parameterType="yan.ibbie.pojo.Account"> update account set balance=balance+#{balance} where accno=#{accNo} </update> </mapper> ``` ## logmapper.xml如下: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="yan.ibbie.mapper.logmapper"> <insert id="insLog" parameterType="yan.ibbie.pojo.Log"> insert into log values(default,#{accOut},#{accIn},#{money}) </insert> </mapper> ``` ## yan.ibbie.pojo.log如下 ``` package yan.ibbie.pojo; public class Log { private int id; private String accOut; private String accIn; private double money; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getAccOut() { return accOut; } public void setAccOut(String accOut) { this.accOut = accOut; } public String getAccIn() { return accIn; } public void setAccIn(String accIn) { this.accIn = accIn; } public double getMoney() { return money; } public void setMoney(double money) { this.money = money; } } ``` ## AccountServiceImpl如下: ``` package yan.ibbie.service.Impl; import java.io.IOException; import java.io.InputStream; import java.util.Date; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; import com.sun.istack.internal.logging.Logger; import yan.ibbie.pojo.Account; import yan.ibbie.pojo.Log; import yan.ibbie.service.AccountService; public class AccountServiceImpl implements AccountService { @Override public int transfer(Account accIn, Account accOut) throws IOException { InputStream is = Resources.getResourceAsStream("mybatis.xml"); SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(is); SqlSession session = factory.openSession(); Account accOutSelect = session.selectOne("yan.ibbie.mapper.accountmapper.selByAccnoPassword",accOut); if (accOutSelect!=null) { if(accOutSelect.getBalance()>=accOut.getBalance()) { Account accInSelect = session.selectOne("yan.ibbie.mapper.accountmapper.selByAccnoName",accIn); if (accInSelect!=null) { accIn.setBalance(accOut.getBalance()); accOut.setBalance(-accOut.getBalance()); int index=session.update("yan.ibbie.mapper.accountmapper.updBalanceByAccno", accOut); index += session.update("yan.ibbie.mapper.accountmapper.updBalanceByAccno",accIn); if (index==2) { Log log = new Log(); log.setAccOut(accOut.getAccNo()); log.setAccIn(accIn.getAccNo()); log.setMoney(accIn.getBalance()); session.update("yan.ibbie.mapper.logmapper.insLog", log); Logger logger = Logger.getLogger(AccountServiceImpl.class); logger.info(log.getAccOut()+"给"+log.getAccIn()+ "在"+new Date().toLocaleString()+"转了"+log.getMoney()); session.commit(); session.close(); return SUCCESS; }else { session.rollback(); session.close(); return ERROR; } }else { return ACCOUNT_NAME_NOT_MATCH; } }else { return ACCOUNT_BALANCE_NOT_ENOUGHT; } }else { return ACCOUNT_PASSWORD_NOT_MATCH; } } } ```
springboot 整合mybatis 报错提示包扫描不进去
![图片说明](https://img-ask.csdn.net/upload/201908/14/1565777159_224084.png) ``` package com.liupeng; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import tk.mybatis.spring.annotation.MapperScan; @SpringBootApplication() @MapperScan(basePackages = "com.liupeng.mapper") public class Application { public static void main(String[] args) { SpringApplication.run(Application.class,args); } } ``` ``` package com.liupeng.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.liupeng.mapper.UserMapper; import com.liupeng.pojo.User; @Service(value = "Userservice") public class UserServiceImpl implements Userservice { @Autowired private UserMapper userMapper; @Override public User getNamePassword(User user) { // TODO Auto-generated method stub return userMapper.selectgetNamePassword(user); } @Override public void saveUser(User user) { // TODO Auto-generated method stub } } ``` mapper.xml ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.liupeng.mapper.UserMapper"> ``` ``` #------------------配置虚拟文件路径--start------------------------------ spring.http.multipart.location=E:\Java\java代码\Chaoyang\src\main\resources #-----------------------------------------数据库--start---------------------- spring.datasource.driver-class-name=com.mysql.cj.jdbc.Drive spring.datasource.url=jdbc:mysql://localhost:3306/ssm_mybatis?serverTimezone=GMT spring.datasource.username=root spring.datasource.password=liupeng.123 spring.datasource.druid.stat-view-servlet.allow=true #获取连接等待超时时间 spring.datasource.dbcp2.max-wait-millis=60000 #mybatis配置 mybatis.type-aliases-package=com.liupeng.pojo mybatis.mapper-locations=classpath:mapper/*.xml #通用Mapper配置 #mapper.mappers=com.liupeng.utils.MyMapper #mapper.not-empty=false #mapper.identity=MYSQL #分页插件配置 pagehelper.helperDialect=mysq1 pagehelper.reasonable=true pagehelper.supportMethodsArguments=true pagehelper.params=count=countSql #文件上传配置 spring.http.multipart.maxFileSize=100Mb spring.http.multipart.maxRequestSize=1000Mb #配置api端口号 server.port=8080 #tomcat的URI编码 server.tomcat.uri-encoding=UTF-8 ``` ``` ERROR [main] - Application startup failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'registLoginController': Unsatisfied dependency expressed through field 'userservice'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'Userservice': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [E:\Java\java代码\Chaoyang\target\classes\com\liupeng\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:586) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:364) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1268) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:756) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:123) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:666) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:353) at org.springframework.boot.SpringApplication.run(SpringApplication.java:300) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1082) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1071) at com.liupeng.Application.main(Application.java:13) Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'Userservice': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [E:\Java\java代码\Chaoyang\target\classes\com\liupeng\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:586) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:364) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1268) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:211) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1131) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:583) ... 19 more Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [E:\Java\java代码\Chaoyang\target\classes\com\liupeng\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1361) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1253) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:211) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1131) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:583) ... 32 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1177) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1072) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:211) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1131) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1346) ... 43 more Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ... 55 more Caused by: org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:523) at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:380) at org.mybatis.spring.SqlSessionFactoryBean.getObject(SqlSessionFactoryBean.java:547) at tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration.sqlSessionFactory(MapperAutoConfiguration.java:155) at tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration$$EnhancerBySpringCGLIB$$90d064bb.CGLIB$sqlSessionFactory$1(<generated>) at tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration$$EnhancerBySpringCGLIB$$90d064bb$$FastClassBySpringCGLIB$$b0514ca6.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358) at tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration$$EnhancerBySpringCGLIB$$90d064bb.sqlSessionFactory(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ... 56 more Caused by: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:120) at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:92) at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:521) ... 69 more Caused by: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:872) at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:844) at org.apache.ibatis.session.Configuration.addResultMap(Configuration.java:626) at org.apache.ibatis.builder.MapperBuilderAssistant.addResultMap(MapperBuilderAssistant.java:214) at org.apache.ibatis.builder.ResultMapResolver.resolve(ResultMapResolver.java:47) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:285) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:252) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:244) at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:116) ... 71 more ```
各位大神,跪求解答啊 springMVC+spring+mybatis
2016-7-27 11:13:00 org.apache.catalina.core.AprLifecycleListener init 信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\myeclipse8.5\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;D:\myeclipse8.5\Common\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_8.5.0.me201003121946\tomcat\bin 2016-7-27 11:13:00 org.apache.coyote.http11.Http11Protocol init 信息: Initializing Coyote HTTP/1.1 on http-80 2016-7-27 11:13:00 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 478 ms 2016-7-27 11:13:00 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 2016-7-27 11:13:00 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/6.0.13 2016-7-27 11:13:01 org.apache.catalina.core.ApplicationContext log 信息: Set web app root system property: 'webapp.root' = [C:\Users\Administrator\Workspaces\MyEclipse 8.5\.metadata\.me_tcat\webapps\smm\] 2016-7-27 11:13:01 org.apache.catalina.core.ApplicationContext log 信息: Initializing log4j from [C:\Users\Administrator\Workspaces\MyEclipse 8.5\.metadata\.me_tcat\webapps\smm\WEB-INF\conf\log4j.properties] 2016-7-27 11:13:01 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext [INFO][2016-07-27 11:13:01] org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:186) Root WebApplicationContext: initialization started [INFO][2016-07-27 11:13:01] org.springframework.context.support.AbstractApplicationContext.prepareRefresh(AbstractApplicationContext.java:454) Refreshing Root WebApplicationContext: startup date [Wed Jul 27 11:13:01 CST 2016]; root of context hierarchy [INFO][2016-07-27 11:13:01] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:315) Loading XML bean definitions from ServletContext resource [/WEB-INF/conf/applicationContext.xml] [INFO][2016-07-27 11:13:02] org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:537) Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1ca4955: defining beans [userService,userController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.mybatis.spring.mapper.MapperScannerConfigurer#0,transactionManager,sqlSessionFactory,dataSource,userMapper]; root of factory hierarchy [INFO][2016-07-27 11:13:03] org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:213) Root WebApplicationContext: initialization completed in 2467 ms 2016-7-27 11:13:04 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'spring' [INFO][2016-07-27 11:13:04] org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:302) FrameworkServlet 'spring': initialization started [INFO][2016-07-27 11:13:04] org.springframework.context.support.AbstractApplicationContext.prepareRefresh(AbstractApplicationContext.java:454) Refreshing WebApplicationContext for namespace 'spring-servlet': startup date [Wed Jul 27 11:13:04 CST 2016]; parent: Root WebApplicationContext [INFO][2016-07-27 11:13:04] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:315) Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-servlet.xml] [INFO][2016-07-27 11:13:04] org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:537) Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@15830c4: defining beans [viewResolver,userController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@1ca4955 [INFO][2016-07-27 11:13:04] org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:397) Mapped URL path [/user//findUserList] onto handler [com.qm.smm.web.UserController@194092c] [INFO][2016-07-27 11:13:04] org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:397) Mapped URL path [/user//findUserList.*] onto handler [com.qm.smm.web.UserController@194092c] [INFO][2016-07-27 11:13:04] org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:397) Mapped URL path [/user//findUserList/] onto handler [com.qm.smm.web.UserController@194092c] [INFO][2016-07-27 11:13:04] org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:321) FrameworkServlet 'spring': initialization completed in 639 ms 2016-7-27 11:13:04 org.apache.coyote.http11.Http11Protocol start 信息: Starting Coyote HTTP/1.1 on http-80 2016-7-27 11:13:04 org.apache.jk.common.ChannelSocket init 信息: JK: ajp13 listening on /0.0.0.0:8009 2016-7-27 11:13:04 org.apache.jk.server.JkMain start 信息: Jk running ID=0 time=0/32 config=null 2016-7-27 11:13:04 org.apache.catalina.startup.Catalina start 信息: Server startup in 4709 ms
springmvc出现了服务器启动报错。有大佬能帮忙解释一下嘛
``` D:\elpel\eclipse\apache-tomcat-7.0.93\bin\catalina.bat run [2019-05-12 08:18:18,569] Artifact untitled4:war exploded: Waiting for server connection to start artifact deployment... Using CATALINA_BASE: "C:\Users\50427\.IntelliJIdea2019.1\system\tomcat\Tomcat_7_0_933_untitled4" Using CATALINA_HOME: "D:\elpel\eclipse\apache-tomcat-7.0.93" Using CATALINA_TMPDIR: "D:\elpel\eclipse\apache-tomcat-7.0.93\temp" Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_191" Using CLASSPATH: "D:\elpel\eclipse\apache-tomcat-7.0.93\bin\bootstrap.jar;D:\elpel\eclipse\apache-tomcat-7.0.93\bin\tomcat-juli.jar" 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Server version: Apache Tomcat/7.0.93 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Server built: Feb 16 2019 17:13:17 UTC 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Server number: 7.0.93.0 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: OS Name: Windows 10 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: OS Version: 10.0 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Architecture: amd64 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Java Home: C:\Program Files\Java\jdk1.8.0_191\jre 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: JVM Version: 1.8.0_191-b12 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: JVM Vendor: Oracle Corporation 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: CATALINA_BASE: C:\Users\50427\.IntelliJIdea2019.1\system\tomcat\Tomcat_7_0_933_untitled4 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: CATALINA_HOME: D:\elpel\eclipse\apache-tomcat-7.0.93 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Command line argument: -Djava.util.logging.config.file=C:\Users\50427\.IntelliJIdea2019.1\system\tomcat\Tomcat_7_0_933_untitled4\conf\logging.properties 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Command line argument: -Dcom.sun.management.jmxremote= 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Command line argument: -Dcom.sun.management.jmxremote.port=1099 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Command line argument: -Dcom.sun.management.jmxremote.ssl=false 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Command line argument: -Dcom.sun.management.jmxremote.password.file=C:\Users\50427\.IntelliJIdea2019.1\system\tomcat\Tomcat_7_0_933_untitled4\jmxremote.password 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Command line argument: -Dcom.sun.management.jmxremote.access.file=C:\Users\50427\.IntelliJIdea2019.1\system\tomcat\Tomcat_7_0_933_untitled4\jmxremote.access 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Command line argument: -Djava.rmi.server.hostname=127.0.0.1 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Command line argument: -Dignore.endorsed.dirs= 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Command line argument: -Dcatalina.base=C:\Users\50427\.IntelliJIdea2019.1\system\tomcat\Tomcat_7_0_933_untitled4 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Command line argument: -Dcatalina.home=D:\elpel\eclipse\apache-tomcat-7.0.93 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.startup.VersionLoggerListener log 淇℃伅: Command line argument: -Djava.io.tmpdir=D:\elpel\eclipse\apache-tomcat-7.0.93\temp 浜旀湀 12, 2019 8:18:19 涓嬪崍 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 淇℃伅: Loaded APR based Apache Tomcat Native library 1.2.21 using APR version 1.6.5. 浜旀湀 12, 2019 8:18:20 涓嬪崍 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 淇℃伅: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 浜旀湀 12, 2019 8:18:20 涓嬪崍 org.apache.catalina.core.AprLifecycleListener initializeSSL 淇℃伅: OpenSSL successfully initialized (OpenSSL 1.1.1a 20 Nov 2018) 浜旀湀 12, 2019 8:18:20 涓嬪崍 org.apache.coyote.AbstractProtocol init 淇℃伅: Initializing ProtocolHandler ["http-apr-8080"] 浜旀湀 12, 2019 8:18:20 涓嬪崍 org.apache.coyote.AbstractProtocol init 淇℃伅: Initializing ProtocolHandler ["ajp-apr-8009"] 浜旀湀 12, 2019 8:18:20 涓嬪崍 org.apache.catalina.startup.Catalina load 淇℃伅: Initialization processed in 1023 ms 浜旀湀 12, 2019 8:18:20 涓嬪崍 org.apache.catalina.core.StandardService startInternal 淇℃伅: Starting service Catalina 浜旀湀 12, 2019 8:18:20 涓嬪崍 org.apache.catalina.core.StandardEngine startInternal 淇℃伅: Starting Servlet Engine: Apache Tomcat/7.0.93 浜旀湀 12, 2019 8:18:20 涓嬪崍 org.apache.coyote.AbstractProtocol start 淇℃伅: Starting ProtocolHandler ["http-apr-8080"] 浜旀湀 12, 2019 8:18:20 涓嬪崍 org.apache.coyote.AbstractProtocol start 淇℃伅: Starting ProtocolHandler ["ajp-apr-8009"] 浜旀湀 12, 2019 8:18:20 涓嬪崍 org.apache.catalina.startup.Catalina start 淇℃伅: Server startup in 106 ms Connected to server [2019-05-12 08:18:20,751] Artifact untitled4:war exploded: Artifact is being deployed, please wait... 浜旀湀 12, 2019 8:18:21 涓嬪崍 org.apache.catalina.deploy.WebXml setVersion 璀﹀憡: Unknown version string [4.0]. Default version will be used. 浜旀湀 12, 2019 8:18:22 涓嬪崍 org.apache.catalina.startup.TldConfig execute 淇℃伅: 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. 2019-05-12 20:18:22,657 INFO [org.springframework.web.servlet.DispatcherServlet] - FrameworkServlet 'DispatcherServlet': initialization started 2019-05-12 20:18:22,691 INFO [org.springframework.web.context.support.XmlWebApplicationContext] - Refreshing WebApplicationContext for namespace 'DispatcherServlet-servlet': startup date [Sun May 12 20:18:22 CST 2019]; root of context hierarchy 2019-05-12 20:18:22,734 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from ServletContext resource [/WEB-INF/DispatcherServlet-servlet.xml] 2019-05-12 20:18:23,016 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@643a7005: defining beans [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping #0,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter #0,/user.do,org.springframework.web.servlet.view.InternalResourceViewResolver#0]; root of factory hierarchy 2019-05-12 20:18:23,029 INFO [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping] - Mapped URL path [/user.do] onto handler '/user.do' 2019-05-12 20:18:23,123 INFO [org.springframework.web.servlet.DispatcherServlet] - FrameworkServlet 'DispatcherServlet': initialization completed in 462 ms [2019-05-12 08:18:23,146] Artifact untitled4:war exploded: Artifact is deployed successfully [2019-05-12 08:18:23,147] Artifact untitled4:war exploded: Deploy took 2,395 milliseconds 浜旀湀 12, 2019 8:18:30 涓嬪崍 org.apache.catalina.startup.HostConfig deployDirectory 淇℃伅: Deploying web application directory D:\elpel\eclipse\apache-tomcat-7.0.93\webapps\manager 浜旀湀 12, 2019 8:18:30 涓嬪崍 org.apache.catalina.startup.HostConfig deployDirectory 淇℃伅: Deployment of web application directory D:\elpel\eclipse\apache-tomcat-7.0.93\webapps\manager has finished in 74 ms ```
spring基于注释的mvc的问题,求教高手
初学spring基于注释的mvc 测试http://www.evget.com/zh-CN/Info/ReadInfo.aspx?id=9079 的一个例子 报 [code="java"] 2010-7-5 8:24:15 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:first' did not find a matching property. 2010-7-5 8:24:15 org.apache.catalina.core.AprLifecycleListener init 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Program Files\Java\jdk1.6.0_17\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\Program Files\Java\jdk1.6.0_17\jre\bin;D:/Program Files/Java/jre6/bin/client;D:/Program Files/Java/jre6/bin;d:\oracle\product\10.2.0\db_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\Program Files\TortoiseSVN\bin;C:\Program Files\Common Files\Thunder Network\KanKan\Codecs;D:\Program Files\QuickTime\QTSystem\ 2010-7-5 8:24:15 org.apache.coyote.http11.Http11Protocol init 信息: Initializing Coyote HTTP/1.1 on http-4444 2010-7-5 8:24:15 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 439 ms 2010-7-5 8:24:15 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 2010-7-5 8:24:15 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/6.0.18 2010-7-5 8:24:15 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 2010-7-5 8:24:15 org.springframework.web.context.ContextLoader initWebApplicationContext 信息: Root WebApplicationContext: initialization started 2010-7-5 8:24:15 org.springframework.context.support.AbstractApplicationContext prepareRefresh 信息: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@287811: display name [Root WebApplicationContext]; startup date [Mon Jul 05 08:24:15 GMT 2010]; root of context hierarchy 2010-7-5 8:24:15 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from file [D:\workspace35\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\first\WEB-INF\classes\source\applicationContext.xml] 2010-7-5 8:24:15 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory 信息: Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@287811]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1930c3a 2010-7-5 8:24:16 org.springframework.core.io.support.PropertiesLoaderSupport loadProperties 信息: Loading properties file from class path resource [source/db/db.properties] 2010-7-5 8:24:16 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons 信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1930c3a: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,testController,testService,testServiceImpl,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,dataSource,sqlMapClient,sqlMapClientTemplate,transactionManager]; root of factory hierarchy 2010-7-5 8:24:16 org.springframework.web.context.ContextLoader initWebApplicationContext 信息: Root WebApplicationContext: initialization completed in 922 ms 2010-7-5 8:24:16 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'annomvc' 2010-7-5 8:24:16 org.springframework.web.servlet.FrameworkServlet initServletBean 信息: FrameworkServlet 'annomvc': initialization started 2010-7-5 8:24:16 org.springframework.context.support.AbstractApplicationContext prepareRefresh 信息: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@d95bc3: display name [WebApplicationContext for namespace 'annomvc-servlet']; startup date [Mon Jul 05 08:24:16 GMT 2010]; parent: org.springframework.web.context.support.XmlWebApplicationContext@287811 2010-7-5 8:24:16 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from ServletContext resource [/WEB-INF/annomvc-servlet.xml] 2010-7-5 8:24:16 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory 信息: Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@d95bc3]: org.springframework.beans.factory.support.DefaultListableBeanFactory@174be7 2010-7-5 8:24:16 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons 信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@174be7: defining beans [org.springframework.web.servlet.mvc.annotation. AnnotationMethodHandlerAdapter#0,org.springframework.web.servlet.view.InternalResourceViewResolver#0]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@1930c3a 2010-7-5 8:24:16 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons 信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@174be7: defining beans [org.springframework.web.servlet.mvc.annotation. AnnotationMethodHandlerAdapter#0,org.springframework.web.servlet.view.InternalResourceViewResolver#0]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@1930c3a 2010-7-5 8:24:16 org.springframework.web.servlet.FrameworkServlet initServletBean 严重: Context initialization failed org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.web.servlet.mvc.annotation. AnnotationMethodHandlerAdapter] for bean with name 'org.springframework.web.servlet.mvc.annotation. AnnotationMethodHandlerAdapter#0' defined in ServletContext resource [/WEB-INF/annomvc-servlet.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.web.servlet.mvc.annotation. AnnotationMethodHandlerAdapter at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1141) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1177) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:758) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:422) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.mvc.annotation. AnnotationMethodHandlerAdapter at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at org.springframework.util.ClassUtils.forName(ClassUtils.java:211) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:385) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1138) ... 28 more 2010-7-5 8:24:16 org.apache.catalina.core.ApplicationContext log 严重: StandardWrapper.Throwable org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.web.servlet.mvc.annotation. AnnotationMethodHandlerAdapter] for bean with name 'org.springframework.web.servlet.mvc.annotation. AnnotationMethodHandlerAdapter#0' defined in ServletContext resource [/WEB-INF/annomvc-servlet.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.web.servlet.mvc.annotation. AnnotationMethodHandlerAdapter at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1141) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1177) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:758) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:422) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.mvc.annotation. AnnotationMethodHandlerAdapter at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at org.springframework.util.ClassUtils.forName(ClassUtils.java:211) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:385) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1138) ... 28 more 2010-7-5 8:24:16 org.apache.catalina.core.StandardContext loadOnStartup 严重: Servlet /first threw load() exception java.lang.ClassNotFoundException: org.springframework.web.servlet.mvc.annotation. AnnotationMethodHandlerAdapter at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at org.springframework.util.ClassUtils.forName(ClassUtils.java:211) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:385) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1138) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1177) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:758) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:422) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 2010-7-5 8:24:16 org.apache.coyote.http11.Http11Protocol start 信息: Starting Coyote HTTP/1.1 on http-4444 2010-7-5 8:24:16 org.apache.jk.common.ChannelSocket init 信息: JK: ajp13 listening on /0.0.0.0:8009 2010-7-5 8:24:16 org.apache.jk.server.JkMain start 信息: Jk running ID=0 time=0/47 config=null 2010-7-5 8:24:16 org.apache.catalina.startup.Catalina start 信息: Server startup in 1645 ms [/code] 错 不能加载 但是有spring-webmvc.jar
org.apache.ibatis.exceptions.PersistenceException怎么解决?
调试一个开源项目出现报错,项目所有sql都会报空指针异常 ``` 严重: Servlet.service() for servlet [springMvc] in context with path [/mallapp] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.NullPointerException ### The error may exist in file [H:\WorksSpace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps\mallapp\WEB-INF\classes\mybatis\category\CategoryMapper.xml] ### The error may involve CategoryMapper.listAll-Inline ### The error occurred while setting parameters ### SQL: select category_name, category_img, sort, category_id, super_id from shop_category where super_id =? order by sort ### Cause: java.lang.NullPointerException] with root cause java.lang.NullPointerException at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:43) at org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:81) at org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java:80) at org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java:61) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62) at com.sun.proxy.$Proxy84.parameterize(Unknown Source) at org.apache.ibatis.executor.ReuseExecutor.prepareStatement(ReuseExecutor.java:79) at org.apache.ibatis.executor.ReuseExecutor.doQuery(ReuseExecutor.java:56) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:137) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:96) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:77) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:108) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358) at com.sun.proxy.$Proxy74.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:198) at com.yq.dao.DaoSupport.findForList(DaoSupport.java:118) at com.yq.service.category.impl.CategoryService.listAll(CategoryService.java:62) at com.yq.service.category.impl.CategoryService$$FastClassBySpringCGLIB$$51d95cd7.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:711) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) at com.yq.service.category.impl.CategoryService$$EnhancerBySpringCGLIB$$c2253a36.listAll(<generated>) at com.yq.controller.category.CategoryController.list(CategoryController.java:80) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:690) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) at javax.servlet.http.HttpServlet.service(HttpServlet.java:624) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) ``` CategoryMapper.xml ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="CategoryMapper"> <!--表名 --> <sql id="tableName"> shop_category </sql> <!-- 字段 --> <sql id="Field"> category_name, category_img, sort, category_id, super_id </sql> <!-- 字段值 --> <sql id="FieldValue"> #{category_name}, #{category_img}, #{sort}, #{category_id}, #{super_id} </sql> <!-- 新增--> <insert id="save" parameterType="pd"> insert into <include refid="tableName"></include> ( <include refid="Field"></include> ) values ( <include refid="FieldValue"></include> ) </insert> <!-- 删除--> <delete id="delete" parameterType="pd"> delete from <include refid="tableName"></include> where category_id = #{category_id} </delete> <!-- 修改 --> <update id="edit" parameterType="pd"> update <include refid="tableName"></include> set category_name = #{category_name}, category_img = #{category_img}, sort = #{sort} where category_id = #{category_id} </update> <!-- 通过ID获取数据 --> <select id="findById" parameterType="pd" resultType="pd"> select <include refid="Field"></include> from <include refid="tableName"></include> where category_id = #{category_id} </select> <!-- 列表 --> <select id="datalistPage" parameterType="page" resultType="pd"> select <include refid="Field"></include> from <include refid="tableName"></include> where 1=1 and super_id =#{pd.super_id} order by sort </select> <!-- 列表(全部) --> <select id="listAll" parameterType="pd" resultType="pd"> select <include refid="Field"></include> from <include refid="tableName"></include> where super_id =#{super_id} order by sort </select> <!-- 批量删除 --> <delete id="deleteAll" parameterType="String"> delete from <include refid="tableName"></include> where category_id in <foreach item="item" index="index" collection="array" open="(" separator="," close=")"> #{item} </foreach> </delete> </mapper> ``` mybatis-config.xml ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD SQL Map Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <settings> <setting name="cacheEnabled" value="true" /><!-- 全局映射器启用缓存 --> <setting name="useGeneratedKeys" value="true" /> <setting name="defaultExecutorType" value="REUSE" /> <!-- 打印查询语句 --> <setting name="logImpl" value="LOG4J" /> </settings> <typeAliases> <typeAlias type="org.change.entity.system.User" alias="User"/> <typeAlias type="org.change.entity.system.Role" alias="Role"/> <typeAlias type="org.change.entity.system.Menu" alias="Menu"/> <typeAlias type="org.change.entity.system.Dictionaries" alias="Dictionaries"/> <typeAlias type="org.change.entity.system.Department" alias="Department"/> <typeAlias type="org.change.util.PageData" alias="pd"/> <!-- 分页 --> <typeAlias type="org.change.entity.Page" alias="Page"/> </typeAliases> <plugins> <plugin interceptor="org.change.plugin.PagePlugin"> <property name="dialect" value="mysql"/> <property name="pageSqlId" value=".*listPage.*"/> </plugin> </plugins> </configuration> ``` DAO.java ``` public interface DAO { /** * 保存对象 * @param str * @param obj * @return * @throws Exception */ public Object save(String str, Object obj) throws Exception; /** * 修改对象 * @param str * @param obj * @return * @throws Exception */ public Object update(String str, Object obj) throws Exception; /** * 删除对象 * @param str * @param obj * @return * @throws Exception */ public Object delete(String str, Object obj) throws Exception; /** * 查找对象 * @param str * @param obj * @return * @throws Exception */ public Object findForObject(String str, Object obj) throws Exception; /** * 查找对象 * @param str * @param obj * @return * @throws Exception */ public Object findForList(String str, Object obj) throws Exception; /** * 查找对象封装成Map * @param s * @param obj * @return * @throws Exception */ public Object findForMap(String sql, Object obj, String key , String value) throws Exception; } ``` DaoSupport.java ``` @Repository("daoSupport") public class DaoSupport implements DAO { @Resource(name = "sqlSessionTemplate") private SqlSessionTemplate sqlSessionTemplate; /** * 保存对象 * @param str * @param obj * @return * @throws Exception */ public Object save(String str, Object obj) throws Exception { return sqlSessionTemplate.insert(str, obj); } /** * 批量更新 * @param str * @param obj * @return * @throws Exception */ public Object batchSave(String str, List objs )throws Exception{ return sqlSessionTemplate.insert(str, objs); } /** * 修改对象 * @param str * @param obj * @return * @throws Exception */ public Object update(String str, Object obj) throws Exception { return sqlSessionTemplate.update(str, obj); } /** * 批量更新 * @param str * @param obj * @return * @throws Exception */ public void batchUpdate(String str, List objs )throws Exception{ SqlSessionFactory sqlSessionFactory = sqlSessionTemplate.getSqlSessionFactory(); //批量执行器 SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH,false); try{ if(objs!=null){ for(int i=0,size=objs.size();i<size;i++){ sqlSession.update(str, objs.get(i)); } sqlSession.flushStatements(); sqlSession.commit(); sqlSession.clearCache(); } }finally{ sqlSession.close(); } } /** * 批量更新 * @param str * @param obj * @return * @throws Exception */ public Object batchDelete(String str, List objs )throws Exception{ return sqlSessionTemplate.delete(str, objs); } /** * 删除对象 * @param str * @param obj * @return * @throws Exception */ public Object delete(String str, Object obj) throws Exception { return sqlSessionTemplate.delete(str, obj); } /** * 查找对象 * @param str * @param obj * @return * @throws Exception */ public Object findForObject(String str, Object obj) throws Exception { return sqlSessionTemplate.selectOne(str, obj); } /** * 查找对象 * @param str * @param obj * @return * @throws Exception */ public Object findForList(String str, Object obj) throws Exception { return sqlSessionTemplate.selectList(str, obj); } public Object findForMap(String str, Object obj, String key, String value) throws Exception { return sqlSessionTemplate.selectMap(str, obj, key); } } ``` spring.xml ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd "> <!-- 配置事务管理器 --> <bean name="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource"></property> </bean> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="classpath:jdbc.properties"/> </bean> <!-- 阿里 druid数据库连接池 --> <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close"> <!-- 数据库基本信息配置 --> <property name="driverClassName" value="${driverClassName}" /> <property name="url" value="${url}" /> <property name="username" value="${username}" /> <property name="password" value="${password}" /> <property name="filters" value="${filters}" /> <!-- 最大并发连接数 --> <property name="maxActive" value="${maxActive}" /> <!-- 初始化连接数量 --> <property name="initialSize" value="${initialSize}" /> <!-- 配置获取连接等待超时的时间 --> <property name="maxWait" value="${maxWait}" /> <!-- 最小空闲连接数 --> <property name="minIdle" value="${minIdle}" /> <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 --> <property name="timeBetweenEvictionRunsMillis" value="${timeBetweenEvictionRunsMillis}" /> <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 --> <property name="minEvictableIdleTimeMillis" value="${minEvictableIdleTimeMillis}" /> <property name="validationQuery" value="${validationQuery}" /> <property name="testWhileIdle" value="${testWhileIdle}" /> <property name="testOnBorrow" value="${testOnBorrow}" /> <property name="testOnReturn" value="${testOnReturn}" /> <property name="maxOpenPreparedStatements" value="${maxOpenPreparedStatements}" /> <!-- 打开removeAbandoned功能 --> <property name="removeAbandoned" value="${removeAbandoned}" /> <!-- 1800秒,也就是30分钟 --> <property name="removeAbandonedTimeout" value="${removeAbandonedTimeout}" /> <!-- 关闭abanded连接时输出错误日志 --> <property name="logAbandoned" value="${logAbandoned}" /> </bean> <!-- 启用注解 --> <context:annotation-config /> <!-- 启动组件扫描,排除@Controller组件,该组件由SpringMVC配置文件扫描 --> <context:component-scan base-package="com"> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" /> </context:component-scan> <!-- 注解方式配置事务--> <!-- <tx:annotation-driven transaction-manager="transactionManager" /> --> <!-- 拦截器方式配置事务 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="delete*" propagation="REQUIRED" read-only="false" rollback-for="java.lang.Exception"/> <tx:method name="insert*" propagation="REQUIRED" read-only="false" rollback-for="java.lang.Exception" /> <tx:method name="update*" propagation="REQUIRED" read-only="false" rollback-for="java.lang.Exception" /> <tx:method name="save*" propagation="REQUIRED" read-only="false" rollback-for="java.lang.Exception" /> <tx:method name="*" propagation="SUPPORTS"/> </tx:attributes> </tx:advice> <aop:aspectj-autoproxy proxy-target-class="true"/> <!-- 事物处理 --> <aop:config> <aop:pointcut id="pc" expression="execution(* com.*.service..*(..))" /> <aop:advisor pointcut-ref="pc" advice-ref="txAdvice" /> </aop:config> <!-- 配置mybatis --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="configLocation" value="classpath:mybatis-config.xml"></property> <!-- mapper扫描 --> <property name="mapperLocations" value="classpath:mybatis/*/*.xml"></property> </bean> <bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate"> <constructor-arg ref="sqlSessionFactory" /> </bean> </beans> ```
有没有写taotao项目的大佬,帮我看看这个错误问题
``` [INFO] Scanning for projects... [INFO] [INFO] -------------------< com.taotao:taotao-manager-web >-------------------- [INFO] Building taotao-manager-web 0.0.1-SNAPSHOT [INFO] --------------------------------[ war ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ taotao-manager-web --- [INFO] Deleting D:\EclipiseWork\taotao-manager-web\target [INFO] [INFO] >>> tomcat7-maven-plugin:2.2:run (default-cli) > process-classes @ taotao-manager-web >>> [INFO] [INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ taotao-manager-web --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ taotao-manager-web --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to D:\EclipiseWork\taotao-manager-web\target\classes [INFO] [INFO] <<< tomcat7-maven-plugin:2.2:run (default-cli) < process-classes @ taotao-manager-web <<< [INFO] [INFO] [INFO] --- tomcat7-maven-plugin:2.2:run (default-cli) @ taotao-manager-web --- [INFO] Running war on http://localhost:8081/ [INFO] Creating Tomcat server configuration at D:\EclipiseWork\taotao-manager-web\target\tomcat [INFO] create webapp with contextPath: 五月 19, 2019 8:01:51 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-bio-8081"] 五月 19, 2019 8:01:51 下午 org.apache.catalina.core.StandardService startInternal 信息: Starting service Tomcat 五月 19, 2019 8:01:51 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/7.0.47 五月 19, 2019 8:01:54 下午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 五月 19, 2019 8:01:54 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'taotao-manager-web' 2019-05-19 20:01:54,832 INFO [org.springframework.web.servlet.DispatcherServlet] - FrameworkServlet 'taotao-manager-web': initialization started 2019-05-19 20:01:54,849 INFO [org.springframework.web.context.support.XmlWebApplicationContext] - Refreshing WebApplicationContext for namespace 'taotao-manager-web-servlet': startup date [Sun May 19 20:01:54 CST 2019]; root of context hierarchy 2019-05-19 20:01:54,874 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [spring/springmvc.xml] 2019-05-19 20:01:55,132 INFO [com.alibaba.dubbo.common.logger.LoggerFactory] - using logger: com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter 2019-05-19 20:01:55,220 INFO [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 2019-05-19 20:01:55,451 WARN [org.springframework.beans.factory.support.DefaultListableBeanFactory] - FactoryBean threw exception from getObjectType, despite the contract saying that it should return null if the type of its object cannot be determined yet java.lang.IllegalStateException: com.taotao.service.TestService at com.alibaba.dubbo.config.ReferenceConfig.getInterfaceClass(ReferenceConfig.java:450) at com.alibaba.dubbo.config.spring.ReferenceBean.getObjectType(ReferenceBean.java:69) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getTypeForFactoryBean(FactoryBeanRegistrySupport.java:66) at org.springframework.beans.factory.support.AbstractBeanFactory.getTypeForFactoryBean(AbstractBeanFactory.java:1470) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:808) at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:544) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:447) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:423) at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:220) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1177) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) at javax.servlet.GenericServlet.init(GenericServlet.java:160) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ClassNotFoundException: com.taotao.service.TestService at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:278) at com.alibaba.dubbo.config.ReferenceConfig.getInterfaceClass(ReferenceConfig.java:446) ... 43 more 2019-05-19 20:01:55,464 WARN [org.springframework.web.context.support.XmlWebApplicationContext] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'text': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taotao.service.TextService com.taotao.controller.Text.service; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.taotao.service.TextService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 2019-05-19 20:01:55,467 ERROR [org.springframework.web.servlet.DispatcherServlet] - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'text': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taotao.service.TextService com.taotao.controller.Text.service; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.taotao.service.TextService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) at javax.servlet.GenericServlet.init(GenericServlet.java:160) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taotao.service.TextService com.taotao.controller.Text.service; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.taotao.service.TextService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) ... 29 more Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.taotao.service.TextService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545) ... 31 more 五月 19, 2019 8:01:55 下午 org.apache.catalina.core.ApplicationContext log 严重: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'text': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taotao.service.TextService com.taotao.controller.Text.service; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.taotao.service.TextService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) at javax.servlet.GenericServlet.init(GenericServlet.java:160) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taotao.service.TextService com.taotao.controller.Text.service; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.taotao.service.TextService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) ... 29 more Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.taotao.service.TextService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545) ... 31 more 五月 19, 2019 8:01:55 下午 org.apache.catalina.core.StandardContext loadOnStartup 严重: Servlet threw load() exception org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.taotao.service.TextService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) at javax.servlet.GenericServlet.init(GenericServlet.java:160) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 五月 19, 2019 8:01:55 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-8081"] ```
org.apache.catalina.core.StandardContext filterStart
2014-3-28 21:20:53 org.apache.catalina.core.AprLifecycleListener init 信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Study\Myeclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\bin;D:\Study\Myeclipse\Common\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_9.0.0.me201211011550\tomcat\bin 2014-3-28 21:20:53 org.apache.coyote.http11.Http11Protocol init 信息: Initializing Coyote HTTP/1.1 on http-8080 2014-3-28 21:20:53 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 323 ms 2014-3-28 21:20:53 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 2014-3-28 21:20:53 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/6.0.13 2014-3-28 21:20:54 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system properly. 2014-3-28 21:21:01 org.apache.catalina.core.StandardContext filterStart 严重: Exception starting filter struts2 Unable to load configuration. - action - file:/C:/Users/Administrator/Workspaces/MyEclipse%2010/.metadata/.me_tcat/webapps/SCM/WEB-INF/classes/struts-ll.xml:5:76 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:428) at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4340) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: Unable to load configuration. - action - file:/C:/Users/Administrator/Workspaces/MyEclipse%2010/.metadata/.me_tcat/webapps/SCM/WEB-INF/classes/struts-ll.xml:5:76 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415) ... 29 more Caused by: Error building results for action procurementManagerAction in namespace / - action - file:/C:/Users/Administrator/Workspaces/MyEclipse%2010/.metadata/.me_tcat/webapps/SCM/WEB-INF/classes/struts-ll.xml:5:76 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:378) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:479) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:275) at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66) ... 31 more Caused by: There is no result type defined for type 'redirect-action' mapped with name 'savePruchasePlanResolve'. Did you mean 'redirectAction'? - result - file:/C:/Users/Administrator/Workspaces/MyEclipse%2010/.metadata/.me_tcat/webapps/SCM/WEB-INF/classes/struts-ll.xml:10:66 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildResults(XmlConfigurationProvider.java:632) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:376) ... 36 more 2014-3-28 21:21:01 org.apache.catalina.core.StandardContext start 严重: Error filterStart 2014-3-28 21:21:01 org.apache.catalina.core.StandardContext start 严重: Context [/SCM] startup failed due to previous errors 2014-3-28 21:21:01 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository. 2014-3-28 21:21:02 org.apache.coyote.http11.Http11Protocol start 信息: Starting Coyote HTTP/1.1 on http-8080 2014-3-28 21:21:02 org.apache.jk.common.ChannelSocket init 信息: JK: ajp13 listening on /0.0.0.0:8009 2014-3-28 21:21:02 org.apache.jk.server.JkMain start 信息: Jk running ID=0 time=0/17 config=null 2014-3-28 21:21:02 org.apache.catalina.startup.Catalina start 信息: Server startup in 8936 ms
相见恨晚的超实用网站
搞学习 知乎:www.zhihu.com 简答题:http://www.jiandati.com/ 网易公开课:https://open.163.com/ted/ 网易云课堂:https://study.163.com/ 中国大学MOOC:www.icourse163.org 网易云课堂:study.163.com 哔哩哔哩弹幕网:www.bilibili.com 我要自学网:www.51zxw
花了20分钟,给女朋友们写了一个web版群聊程序
参考博客 [1]https://www.byteslounge.com/tutorials/java-ee-html5-websocket-example
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
字节跳动视频编解码面经
引言 本文主要是记录一下面试字节跳动的经历。 三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时
开源一个功能完整的SpringBoot项目框架
福利来了,给大家带来一个福利。 最近想了解一下有关Spring Boot的开源项目,看了很多开源的框架,大多是一些demo或者是一个未成形的项目,基本功能都不完整,尤其是用户权限和菜单方面几乎没有完整的。 想到我之前做的框架,里面通用模块有:用户模块,权限模块,菜单模块,功能模块也齐全了,每一个功能都是完整的。 打算把这个框架分享出来,供大家使用和学习。 为什么用框架? 框架可以学习整体
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
Python——画一棵漂亮的樱花树(不同种樱花+玫瑰+圣诞树喔)
最近翻到一篇知乎,上面有不少用Python(大多是turtle库)绘制的树图,感觉很漂亮,我整理了一下,挑了一些我觉得不错的代码分享给大家(这些我都测试过,确实可以生成喔~) one 樱花树 动态生成樱花 效果图(这个是动态的): 实现代码 import turtle as T import random import time # 画樱花的躯干(60,t) def Tree(branch
深深的码丨Java HashMap 透析
HashMap 相关概念 HashTab、HashMap、TreeMap 均以键值对像是存储或操作数据元素。HashTab继承自Dictionary,HashMap、TreeMap继承自AbstractMap,三者均实现Map接口 **HashTab:**同步哈希表,不支持null键或值,因为同步导致性能影响,很少被使用 **HashMap:**应用较多的非同步哈希表,支持null键或值,是键值对...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Python 基础(一):入门必备知识
目录1 标识符2 关键字3 引号4 编码5 输入输出6 缩进7 多行8 注释9 数据类型10 运算符10.1 常用运算符10.2 运算符优先级 1 标识符 标识符是编程时使用的名字,用于给变量、函数、语句块等命名,Python 中标识符由字母、数字、下划线组成,不能以数字开头,区分大小写。 以下划线开头的标识符有特殊含义,单下划线开头的标识符,如:_xxx ,表示不能直接访问的类属性,需通过类提供
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
JDK12 Collectors.teeing 你真的需要了解一下
前言 在 Java 12 里面有个非常好用但在官方 JEP 没有公布的功能,因为它只是 Collector 中的一个小改动,它的作用是 merge 两个 collector 的结果,这句话显得很抽象,老规矩,我们先来看个图(这真是一个不和谐的图????): 管道改造经常会用这个小东西,通常我们叫它「三通」,它的主要作用就是将 downstream1 和 downstre...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
相关热词 c# 输入ip c# 乱码 报表 c#选择结构应用基本算法 c# 收到udp包后回包 c#oracle 头文件 c# 序列化对象 自定义 c# tcp 心跳 c# ice连接服务端 c# md5 解密 c# 文字导航控件
立即提问