SSM整合运行Tomcat报错org.springframework.beans.factory.BeanCreationException

项目列表

图片说明

applicaiontContext.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"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.2.xsd
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">

    <!-- 1.加载db配置文件  -->
    <context:property-placeholder location="classpath:dp.properties"/>

    <!-- 2.配置c3p0数据源 -->
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
        <property name="driverClass" value="${jdbc.driver}"/>
        <property name="jdbcUrl" value="${jdbc.url}"/>
        <property name="user" value="${jdbc.username}"/>
        <property name="password" value="${jdbc.password}"/>
        <property name="maxPoolSize" value="30"/>
        <property name="minPoolSize" value="2"/>
    </bean>

    <!-- 3.让spring管理sqlsessionFactory  -->
    <bean class="org.mybatis.spring.SqlSessionFactoryBean" id="sqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <!-- 指定配置文件位置 -->
        <property name="configLocation" value="classpath:Mybatis.xml"/>
    </bean>

    <!-- 4.自动生成dao,mapper-->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="basePackage" value="com.cwj.backoffice.web.mapper"/>
        <property name="sqlSessionFactoryBeanName" value="sqlSessionFactoryBean"/>
    </bean>
    <!-- 配置扫描注解 -->
    <context:component-scan base-package="com.cwj.backoffice.web"/>
    <!-- 5.配置事务管理器 -->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <!-- 6.开启事务注解-->
    <tx:annotation-driven></tx:annotation-driven>

</beans>

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>
    <!-- 别名配置 -->
    <typeAliases>
        <!-- 批量配置别名:指定批量定义别名的类包,别名为类名(首字母大小写都可) -->
        <package name="com.cwj.backoffice.web"/>
    </typeAliases>
    <mappers>
        <!-- 批量加载映射文件 -->
        <package name="com.cwj.backoffice.web.mapper"/>
    </mappers>
</configuration>

springmvcs.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:mvc="http://www.springframework.org/schema/mvc"
       xmlns:context="http://www.springframework.org/schema/context"
       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-3.2.xsd
      http://www.springframework.org/schema/mvc
      http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context-3.2.xsd
      http://www.springframework.org/schema/aop
      http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
      http://www.springframework.org/schema/tx
      http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">

    <!-- 1.配置注解扫描位置 -->
    <context:component-scan base-package="com.cwj.backoffice.web.controller" />


    <!-- 2.配置注解处理映射-->
    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/>

    <!--3.配置适配器-->
    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">

    </bean>

    <!-- 4.配置springmvc视图解析器 视图解析器解析的视频路径为:前缀 + 后缀 -->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/views" />
        <property name="suffix" value=".jsp" />
    </bean>
</beans>

测试代码片段

/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: CommandController
 * Author:   50427
 * Date:     2019/5/13 11:03
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.cwj.backoffice.web.controller;



import com.cwj.backoffice.web.User.Items;
import com.cwj.backoffice.web.User.User;

import com.cwj.backoffice.web.UserService.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author 50427
 * @create 2019/5/13
 * @since 1.0.0
 */

@Controller
public class CommandControllers {
    @Autowired
    private UserService service;

    @RequestMapping("select")
    public String select(Model model){
        System.out.println(service);
        List<Items> list=service.select();
        for (Items items:list)
        {
            System.out.println(items.getName()+":"+items.getPrice());

        }
        model.addAttribute("list",list);
        return "/select";
    }

    @RequestMapping("command")
    public  String sele(User user){
        System.out.println(user);
        return "/List";
    }


    @RequestMapping("list")
    public String list(Model model) {
        List<User> list = new ArrayList<User>();
        list.add(new User(1,"陈十二","男",18,"2019/10/1"));
        list.add(new User(2,"二狗子","男",18,"2019/10/1"));
        list.add(new User(3,"十二哟","男",18,"2019/10/1"));
        model.addAttribute("list",list);
        return "/userList";
    }
    @RequestMapping("edit")
    public String useradd(int id,Model model){
        User user=new User(1,"陈十二","男",18,"2019/10/1");
        User user1=new User(1,"二狗子","男",18,"2019/10/1");
        User user2=new User(1,"十二哟","男",18,"2019/10/1");
        model.addAttribute("user",user);
        model.addAttribute("user",user1);
        model.addAttribute("user",user2);
        return "/useradd";
    }

}

UserMapper接口片段

package com.cwj.backoffice.web.mapper;

import com.cwj.backoffice.web.User.Items;
import com.cwj.backoffice.web.User.User;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper {
    public void save(User user);
    public List<Items> select();
}

UserMapper.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.cwj.backoffice.web.mapper.UserMapper">
    <insert id="save" parameterType="com.cwj.backoffice.web.User.User">
        INSERT INTO t_user(id,username,password) values(#{id},#{username},#{password})
    </insert>

    <select id="select" resultType="com.cwj.backoffice.web.User.Items">
        SELECT * FROM t_user
    </select>
</mapper>

UserServiceimp实现类的代码

@Service
public class UserServiceImp implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public void save(User user) {
        userMapper.save(user);
    }

    @Override
    public List<Items> select() {

        return userMapper.select();
    }
}

Web.xml代码片段

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">

    <servlet>
        <servlet-name>DispatcherServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <!-- 3.0的springmvc 默认加载WEB-INF下的dispatcher-servlet.xml文件 3.2的springmvc
            加载DispatcherServlet-servlet.xml文件 -->
        <init-param>
            <!-- 修改默认springmvc加载的配置文件路径 -->
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:springmvcs.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>DispatcherServlet</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <!-- spring的配置 -->

    <!--  配置的是 applicaiontContext.xml  -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicaiontContext.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
</web-app>

运行错误

浜旀湀 15, 2019 3:00:06 涓嬪崍 org.apache.catalina.core.ApplicationContext log
淇℃伅: Log4jServletContainerInitializer starting up Log4j in Servlet 3.0+ environment.
浜旀湀 15, 2019 3:00:06 涓嬪崍 org.apache.catalina.core.ApplicationContext log
淇℃伅: No Log4j context configuration provided. This is very unusual.
浜旀湀 15, 2019 3:00:06 涓嬪崍 org.apache.catalina.core.ApplicationContext log
淇℃伅: No Spring WebApplicationInitializer types detected on classpath
浜旀湀 15, 2019 3:00:06 涓嬪崍 org.apache.catalina.core.ApplicationContext log
淇℃伅: Initializing Spring root WebApplicationContext
浜旀湀 15, 2019 3:00:07 涓嬪崍 org.apache.catalina.core.ApplicationContext log
淇℃伅: Log4jServletContextListener ensuring that Log4j starts up properly.
浜旀湀 15, 2019 3:00:07 涓嬪崍 org.apache.catalina.core.ApplicationContext log
淇℃伅: Log4jServletFilter initialized.
浜旀湀 15, 2019 3:00:08 涓嬪崍 org.apache.catalina.core.ApplicationContext log
淇℃伅: Initializing Spring FrameworkServlet 'DispatcherServlet'
浜旀湀 15, 2019 3:00:08 涓嬪崍 org.apache.catalina.core.ApplicationContext log
涓ラ噸: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0' defined in class path resource [springmvcs.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'userController' method 
public java.lang.String com.cwj.backoffice.web.controller.UserController.list()
to {[/list]}: There is already 'commandControllers' bean method
public java.lang.String com.cwj.backoffice.web.controller.CommandControllers.list(org.springframework.ui.Model) mapped.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
    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:775)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
    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:158)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1230)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1174)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1066)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5433)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5731)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1018)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:994)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
    at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1900)
    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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:619)
    at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:566)
    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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
    at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
    at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
    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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
    at sun.rmi.transport.Transport$1.run(Transport.java:200)
    at sun.rmi.transport.Transport$1.run(Transport.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
    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: Ambiguous mapping. Cannot map 'userController' method 
public java.lang.String com.cwj.backoffice.web.controller.UserController.list()
to {[/list]}: There is already 'commandControllers' bean method
public java.lang.String com.cwj.backoffice.web.controller.CommandControllers.list(org.springframework.ui.Model) mapped.
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.assertUniqueMethodMapping(AbstractHandlerMethodMapping.java:570)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.register(AbstractHandlerMethodMapping.java:534)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:258)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:244)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:214)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:184)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:124)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    ... 66 more

浜旀湀 15, 2019 3:00:08 涓嬪崍 org.apache.catalina.core.StandardContext loadOnStartup
涓ラ噸: Servlet [DispatcherServlet] in web application [/untitled9_war_exploded] threw load() exception
java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'userController' method 
public java.lang.String com.cwj.backoffice.web.controller.UserController.list()
to {[/list]}: There is already 'commandControllers' bean method
public java.lang.String com.cwj.backoffice.web.controller.CommandControllers.list(org.springframework.ui.Model) mapped.
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.assertUniqueMethodMapping(AbstractHandlerMethodMapping.java:570)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.register(AbstractHandlerMethodMapping.java:534)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:258)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:244)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:214)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:184)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:124)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
    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:775)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
    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:158)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1230)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1174)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1066)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5433)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5731)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1018)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:994)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
    at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1900)
    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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:619)
    at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:566)
    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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
    at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
    at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
    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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
    at sun.rmi.transport.Transport$1.run(Transport.java:200)
    at sun.rmi.transport.Transport$1.run(Transport.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
    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)

浜旀湀 15, 2019 3:00:14 涓嬪崍 org.apache.catalina.core.ApplicationContext log
淇℃伅: Initializing Spring FrameworkServlet 'DispatcherServlet'
浜旀湀 15, 2019 3:00:15 涓嬪崍 org.apache.catalina.core.ApplicationContext log
涓ラ噸: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0' defined in class path resource [springmvcs.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'userController' method 
public java.lang.String com.cwj.backoffice.web.controller.UserController.list()
to {[/list]}: There is already 'commandControllers' bean method
public java.lang.String com.cwj.backoffice.web.controller.CommandControllers.list(org.springframework.ui.Model) mapped.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
    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:775)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
    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:158)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1230)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1174)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:847)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1137)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2575)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2564)
    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: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'userController' method 
public java.lang.String com.cwj.backoffice.web.controller.UserController.list()
to {[/list]}: There is already 'commandControllers' bean method
public java.lang.String com.cwj.backoffice.web.controller.CommandControllers.list(org.springframework.ui.Model) mapped.
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.assertUniqueMethodMapping(AbstractHandlerMethodMapping.java:570)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.register(AbstractHandlerMethodMapping.java:534)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:258)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:244)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:214)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:184)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:124)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    ... 35 more

浜旀湀 15, 2019 3:00:15 涓嬪崍 org.apache.catalina.core.StandardWrapperValve invoke
涓ラ噸: Allocate exception for servlet DispatcherServlet
java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'userController' method 
public java.lang.String com.cwj.backoffice.web.controller.UserController.list()
to {[/list]}: There is already 'commandControllers' bean method
public java.lang.String com.cwj.backoffice.web.controller.CommandControllers.list(org.springframework.ui.Model) mapped.
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.assertUniqueMethodMapping(AbstractHandlerMethodMapping.java:570)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.register(AbstractHandlerMethodMapping.java:534)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:258)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:244)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:214)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:184)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:124)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
    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:775)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
    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:158)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1230)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1174)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:847)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1137)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2575)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2564)
    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)

浜旀湀 15, 2019 3:02:46 涓嬪崍 org.apache.catalina.core.ApplicationContext log
淇℃伅: Log4jServletFilter destroyed.
浜旀湀 15, 2019 3:02:46 涓嬪崍 org.apache.catalina.core.ApplicationContext log
淇℃伅: Log4jServletContextListener ensuring that Log4j shuts down properly.
浜旀湀 15, 2019 3:02:46 涓嬪崍 org.apache.catalina.core.ApplicationContext log
淇℃伅: Closing Spring root WebApplicationContext

具体问题是什么,找了一早上了。

2个回答

UserController 这个类里面的代码有问题,检查下里面是不是也有一个 RequestMapping(value="list")的。
由于你的Controller类较多,为了避免请求路径映射重复,应该在Controller类上加上前缀就不会冲突了:

@Controller
@RequestMapping("/user")
public class UserController {

CommandControllers 这个类也也是,加上前缀。

com.cwj.backoffice.web.controller.UserController.list()
com.cwj.backoffice.web.controller.CommandControllers.list(org.springframework.ui.Model)
这两个类的方法映射的URI地址是一样的 可以考虑在两个controller类上面给一个不同的@RequestMappingURI区分开来

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
SSM运行Tomcat报错
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init met...
ssh整合org.springframework.beans.factory.BeanCreationException
12:25:04,567 ERROR ContextLoader:215 - Context initialization failedrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lblogDao': Injection of resource methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [beans.xml]: Cannot resolve reference to bean 'sf' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sf' defined in class path resource [beans.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/engine/query/sql/NativeSQLQueryReturnrn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:305)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:998)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn+++++++++++++++++++++++++++++++++++++++++++++++rnrnrn rn rn rnrnrn rn rn com.mysql.jdbc.Driverrn rn rn jdbc:mysql://localhost:3306/weiborn rn rn rootrn rn rn leileirn rn rn 255rn rn rn 2rn rn rn 120000rn rn rnrnrn rn rn rn rn cn.lei.entityrn rn rn rn rn rn org.hibernate.dialect.MySQLDialectrn rn truern truern rn rn rnrnrnrn rn rn rnrnrn rn rn rn rnrn rn rn rn rn rn rnrnrn rn rn rnrnrn[img=http://t3.qpic.cn/mblogpic/4e8a6c0fa80adbc28296/460][/img]rn
运行tomcat报错
每次运行web程序就这样这是怎么回事???
Maven整合SSM运行流程
本文续接之前的一篇https://blog.csdn.net/qq_21294095/article/details/85004954,后续全以上文代替 上文中的resources目录下的配置文件比较晕,故做此篇 一,框架整合的思路 框架的整合有一个总体思路 使用Spring管理其他框架对象的生命周期 也就是所谓的DI。 二,Maven项目的Resources目录发布到哪里去了? 为什么...
struts2+ibats+spring整合启动tomcat报错
严重: Dispatcher initialization failedrnjava.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionrn at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)rn at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)rn at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:507)rn at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:517)rn at com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:548)rn at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)rn at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:546)rn at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:197)rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)rn at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)rn at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)rn at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)rn at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)rn at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)rn at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)rn at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:103)rn at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)rn at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)rn at java.util.concurrent.FutureTask.run(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)rn at java.lang.Thread.run(Unknown Source)rnCaused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionrn at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:495)rn at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)rn at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)rn at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)rn at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)rn at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)rn ... 26 morernCaused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionrn at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:440)rn at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:492)rn ... 31 morernCaused by: java.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)rn at java.lang.reflect.Constructor.newInstance(Unknown Source)rn at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:419)rn ... 32 morernCaused by: java.lang.NoClassDefFoundError: org/apache/commons/lang/xwork/StringUtilsrn at org.apache.struts2.spring.StrutsSpringObjectFactory.(StrutsSpringObjectFactory.java:104)rn ... 37 morernCaused by: java.lang.ClassNotFoundException: org.apache.commons.lang.xwork.StringUtilsrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)rn ... 38 morern2012-11-26 17:32:49 org.apache.catalina.core.StandardContext filterStartrn严重: Exception starting filter struts2rnjava.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerBuilder$4rnFile: ContainerBuilder.javarnMethod: creaternLine: 132 - com/opensymphony/xwork2/inject/ContainerBuilder.java:132:-1rn at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)rn at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)rn at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)rn at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)rn at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)rn at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:103)rn at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)rn at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)rn at java.util.concurrent.FutureTask.run(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)rn at java.lang.Thread.run(Unknown Source)rnCaused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionrn at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)rn at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)rn at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:507)rn at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:517)rn at com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:548)rn at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)rn at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:546)rn at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:197)rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)rn at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)rn at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)rn ... 16 morernCaused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionrn at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:495)rn at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)rn at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)rn at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)rn at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)rn at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)rn ... 26 morernCaused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionrn at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:440)rn at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:492)rn ... 31 morernCaused by: java.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)rn at java.lang.reflect.Constructor.newInstance(Unknown Source)rn at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:419)rn ... 32 morernCaused by: java.lang.NoClassDefFoundError: org/apache/commons/lang/xwork/StringUtilsrn at org.apache.struts2.spring.StrutsSpringObjectFactory.(StrutsSpringObjectFactory.java:104)rn ... 37 morernCaused by: java.lang.ClassNotFoundException: org.apache.commons.lang.xwork.StringUtilsrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)rn ... 38 morern
ssm注解方式实现启动tomcat报错
java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'helloWorldController2' bean method public java.lang.String cn.chapter2.controller.HelloWorldController2.test() to {[/hello2],meth
SSM框架搭建——SSM整合
一、IDEA创建java web项目用到的开发工具是IntelliJ IDEA,项目创建可能和eclipse有所不同,按照自己的需要来创建就好,用什么就按照什么步骤来创建。以下是完整目录结构:二、配置文件(1)db.propertiesjdbc_driver=com.mysql.jdbc.Driver jdbc_url=jdbc:mysql://127.0.0.1:3306/bookdb?useU...
ssm ssm整合包
ssm整合包
求救,运行jsp文件tomcat报错
以下为报错信息,请帮忙解决:rnrnrn2011-3-6 23:07:51 org.apache.catalina.core.AprLifecycleListener initrn信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\Program Files\Common Files\NetSarang;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Common Files\Lenovo;C:\Program Files\Lenovo\Access Connections\;C:\Program Files\Windows Live\Shared;C:\Program Files\Common Files\Thunder Network\KanKan\Codecs;C:\Program Files\MySQL\MySQL Server 5.1\binrn2011-3-6 23:07:52 org.apache.tomcat.util.digester.SetPropertiesRule beginrn警告: [SetPropertiesRule]Server/Service/Engine/Host/Context Setting property 'source' to 'org.eclipse.jst.jee.server:ecs-oa' did not find a matching property.rn2011-3-6 23:07:52 org.apache.tomcat.util.digester.SetPropertiesRule beginrn警告: [SetPropertiesRule]Server/Service/Engine/Host/Context Setting property 'source' to 'org.eclipse.jst.jee.server:tel_table' did not find a matching property.rn2011-3-6 23:07:52 org.apache.tomcat.util.digester.SetPropertiesRule beginrn警告: [SetPropertiesRule]Server/Service/Engine/Host/Context Setting property 'source' to 'org.eclipse.jst.jee.server:ecsoa' did not find a matching property.rn2011-3-6 23:07:52 org.apache.coyote.http11.Http11Protocol initrn信息: Initializing Coyote HTTP/1.1 on http-8080rn2011-3-6 23:07:52 org.apache.coyote.ajp.AjpProtocol initrn信息: Initializing Coyote AJP/1.3 on ajp-8009rn2011-3-6 23:07:52 org.apache.catalina.startup.Catalina loadrn信息: Initialization processed in 513 msrn2011-3-6 23:07:52 org.apache.catalina.core.StandardService startInternalrn信息: Starting service Catalinarn2011-3-6 23:07:52 org.apache.catalina.core.StandardEngine startInternalrn信息: Starting Servlet Engine: Apache Tomcat/7.0.2rn2011-3-6 23:07:52 org.apache.catalina.loader.WebappClassLoader validateJarFilern信息: validateJarFile(C:\Users\james\Workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ecs-oa\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.classrn2011-3-6 23:07:58 org.apache.catalina.loader.WebappClassLoader validateJarFilern信息: validateJarFile(C:\Users\james\Workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ecsoa\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.classrn2011-3-6 23:08:03 org.apache.coyote.http11.Http11Protocol startrn信息: Starting Coyote HTTP/1.1 on http-8080rn2011-3-6 23:08:03 org.apache.coyote.ajp.AjpProtocol startrn信息: Starting Coyote AJP/1.3 on ajp-8009rn2011-3-6 23:08:03 org.apache.catalina.startup.Catalina startrn信息: Server startup in 11197 msrn2011-3-6 23:08:05 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet [jsp] in context with path [/ecsoa] threw exception [java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.runtime.JspApplicationContextImpl] with root causernjava.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.runtime.JspApplicationContextImplrn at org.apache.jasper.runtime.JspFactoryImpl.getJspApplicationContext(JspFactoryImpl.java:216)rn at org.apache.jsp.login_jsp._jspInit(login_jsp.java:22)rn at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:47)rn at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:154)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:163)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:401)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:242)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:267)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:245)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:260)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)rn at java.lang.Thread.run(Unknown Source)
运行mvnforum的时候tomcat报错
信息: Illegal access: this web application instance has been stopped already. Could not load EDU.oswego.cs.dl.util.concurrent.PooledExecutor$DiscardWhenBlocked. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.rnjava.lang.IllegalStateExceptionrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1244)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)rn at EDU.oswego.cs.dl.util.concurrent.PooledExecutor.shutdownAfterProcessingCurrentlyQueuedTasks(Unknown Source)rn at net.myvietnam.mvncore.thirdparty.commonj.util.ThreadPool.shutdown(ThreadPool.java:65)rn at net.myvietnam.mvncore.thirdparty.commonj.timers.FooTimerManager.shutdown(FooTimerManager.java:117)rn at net.myvietnam.mvncore.thirdparty.commonj.timers.FooTimerManager.finalize(FooTimerManager.java:125)rn at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)rn at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)rn at java.lang.ref.Finalizer.access$100(Finalizer.java:14)rn at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)rn2010-12-21 14:14:07 org.apache.catalina.core.StandardContext reloadrn信息: Reloading this Context has started
在myeclipse中运行tomcat报错:
rn在myeclipse中运行tomcat报错:rnjava.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactoryrn at org.apache.catalina.startup.Bootstrap.(Bootstrap.java:56)rnCaused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactoryrn at java.net.URLClassLoader$1.run(URLClassLoader.java:202)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:190)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:307)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:248)rn ... 1 morernException in thread "main"
运行MyEcplise自带的的Tomcat报错
做天就加了一个DWR jar 运行出来就 报了这样一个错误2012-06-14 10:03:36,174 [org.apache.struts2.dispatcher.Dispatcher]-[ERROR] Dispatcher initialization failedrnUnable to load configuration. - [unknown location]rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)rn at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)rn at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)rn at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)rn at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)rn at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)rn at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108)rn at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4340)rn at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1105)rn at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)rn at java.lang.Thread.run(Thread.java:619)rnCaused by: Caught exception while loading file struts-default.xml - [unknown location]rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:913)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:154)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:121)rn at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:179)rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)rn ... 18 morernCaused by: java.lang.ClassCastException: org.apache.xerces.parsers.XML11Configuration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfigurationrn at org.apache.xerces.parsers.DOMParser.(Unknown Source)rn at org.apache.xerces.parsers.DOMParser.(Unknown Source)rn at org.apache.xerces.jaxp.DocumentBuilderImpl.(Unknown Source)rn at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)rn at com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.(SAX2DOM.java:69)rn at com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory.getSerializationHandler(TransletOutputHandlerFactory.java:187)rn at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(TransformerImpl.java:392)rn at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.setResult(TransformerHandlerImpl.java:137)rn at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.setup(DomHelper.java:205)rn at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.(DomHelper.java:190)rn at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.(DomHelper.java:181)rn at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.(DomHelper.java:167)rn at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:107)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:904)rn ... 22 morern2012-6-14 10:03:36 org.apache.catalina.core.StandardContext filterStartrn严重: Exception starting filter struts2rnUnable to load configuration. - [unknown location]rn at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)rn at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)rn at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)rn at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)rn at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108)rn at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4340)rn at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1105)rn at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)rn at java.lang.Thread.run(Thread.java:619)rnCaused by: Unable to load configuration. - [unknown location]rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)rn at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)rn at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)rn ... 16 morernCaused by: Caught exception while loading file struts-default.xml - [unknown location]rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:913)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:154)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:121)rn at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:179)rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)rn ... 18 morernCaused by: java.lang.ClassCastException: org.apache.xerces.parsers.XML11Configuration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfigurationrn at org.apache.xerces.parsers.DOMParser.(Unknown Source)rn at org.apache.xerces.parsers.DOMParser.(Unknown Source)rn at org.apache.xerces.jaxp.DocumentBuilderImpl.(Unknown Source)rn at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)rn at com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.(SAX2DOM.java:69)rn at com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory.getSerializationHandler(TransletOutputHandlerFactory.java:187)rn at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(TransformerImpl.java:392)rn at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.setResult(TransformerHandlerImpl.java:137)rn at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.setup(DomHelper.java:205)rn at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.(DomHelper.java:190)rn at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.(DomHelper.java:181)rn at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.(DomHelper.java:167)rn at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:107)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:904)rn ... 22 morern2012-6-14 10:03:36 org.apache.catalina.core.StandardContext startrn严重: Error filterStartrn2012-6-14 10:03:36 org.apache.catalina.core.StandardContext startrn严重: Context [/Cowain] startup failed due to previous errorsrn2012-6-14 10:03:36 org.apache.catalina.core.ApplicationContext logrn信息: Closing Spring root WebApplicationContextrn2012-06-14 10:03:36,183 [org.springframework.orm.hibernate3.LocalSessionFactoryBean]-[INFO] Closing Hibernate SessionFactoryrn2012-06-14 10:03:36,183 [org.hibernate.impl.SessionFactoryImpl]-[INFO] closing
org.springframework.beans.factory.BeanCreationException:
启动tomcat之后就报错!求大神解决!rnrn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerErrorrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)rn at org.apache.catalina.core.StandardService.start(StandardService.java:525)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:595)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: java.lang.ExceptionInInitializerErrorrn at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:244)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)rn ... 36 morernCaused by: java.lang.IllegalStateException: Expected method not found: java.lang.NoSuchMethodException: org.hibernate.cfg.Configuration.addAnnotatedClass(java.lang.Class)rn at org.springframework.util.ClassUtils.getMethod(ClassUtils.java:626)rn at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.(LocalSessionFactoryBuilder.java:68)rn ... 39 more
org.springframework.beans.factory.BeanCreationException
在开发中遇到的错误。求找大神帮助,谢谢rnrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orgAction' defined in ServletContext resource [/WEB-INF/classes/config/app_action.xml]: Cannot resolve reference to bean 'stationService' while setting bean property 'stationService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stationService' defined in ServletContext resource [/WEB-INF/classes/config/app_service.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'addStationService' of bean class [hqhop.scada.services.res.impl.StationServiceImpl]: Bean property 'addStationService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:605)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)rn at java.util.concurrent.FutureTask.run(FutureTask.java:166)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rn at java.lang.Thread.run(Thread.java:722)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stationService' defined in ServletContext resource [/WEB-INF/classes/config/app_service.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'addStationService' of bean class [hqhop.scada.services.res.impl.StationServiceImpl]: Bean property 'addStationService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1396)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323)rn ... 25 morernCaused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'addStationService' of bean class [hqhop.scada.services.res.impl.StationServiceImpl]: Bean property 'addStationService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?rn at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1064)rn at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:924)rn at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)rn at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393)rn ... 33 more
SSM整合——业务层的整合
由于前几天一直在面试,没有继续总结,今天继续总结SSM整合的第二大步,业务层的整合。 业务层整合的目标:Spring管理service,Service通过spring调用mapper,由spring进行事务控制。 首先开发我们的service接口和实现类: /** * 用户管理 * @author user * */ public interface UserService { ...
ssm整合spring+spring-mvc+mybatis整合
spring+spring-mvc+mybatis整合
Spring4.3.12+mybatis3.4.6+Springmvc4.3.2整合(SSM整合)
Spring4.3.12+mybatis3.4.6+Springmvc4.3.2整合(SSM整合) Spring4.3.12+mybatis3.4.6+Springmvc4.3.2整合(SSM整合) Spring4.3.12+mybatis3.4.6+Springmvc4.3.2整合(SSM整合)
SSH整合后发布到TOMCAT报错。。。
错误如下:rn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Association references unmapped class: com.cx.pojo.TButyrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:578)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnCaused by: org.hibernate.MappingException: Association references unmapped class: com.cx.pojo.TButyrn at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2399)rn at org.hibernate.cfg.HbmBinder$CollectionSecondPass.secondPass(HbmBinder.java:2678)rn at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:66)rn at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1177)rn at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1162)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:717)rn at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1400)rn ... 27 morernrnspring配置文件内容:rnrn rn rn rn rn rn rn org.hibernate.dialect.Oracle9Dialectrn rn truern rn rn rn rn com/cx/pojo/TRole.hbm.xmlrn com/lq/pojo/TNotice.hbm.xmlrn com/lq/pojo/TNoticeFile.hbm.xmlrn com/lq/pojo/TEmail.hbm.xmlrn com/lq/pojo/TEmailFile.hbm.xmlrn com/lq/pojo/TReceiveemail.hbm.xmlrn com/xw/pojo/TUser.hbm.xmlrn com/xw/pojo/TButy.hbm.xmlrn com/xw/pojo/TDept.hbm.xmlrn rn rn rnrn大体报错是说一个class不能解析,可是spring中的映射是没错的。。。求解。。急需!!
SSM整合
web应用的三层为: 1• web层(SpringMVC),它用于web层,相当于controller(等价于传统的servlet和struts的action),用来处理用户请求 •2 service层(spring),spring中用的最多的是IoC和AOP,把对象的创建交给Spring进行管理 3• dao层(MyBatis),MyBatis则是用来操作数据库,进行CRUD •整合步...
ssm整合
通过网上的文章,自己整合了一下spring-springMVC-mybatis web.xml &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSch...
相关热词 c# 去空格去转义符 c#用户登录窗体代码 c# 流 c# linux 可视化 c# mvc 返回图片 c# 像素空间 c# 日期 最后一天 c#字典序排序 c# 截屏取色 c#中的哪些属于托管机制