【问题标题】:Springframework : Neither BindingResult nor plain target object for bean nameSpringframework:Bean 名称的 BindingResult 和普通目标对象都不是
【发布时间】:2014-09-25 12:31:00
【问题描述】:

我正在尝试运行下面的项目,事实上我写错了。 在我看来,问题出在successView.jsp 和CarController.java 之间。提前感谢您的帮助。


代码已更新

successView.jsp

<%--
    Document   : successView
    Created on : May 2, 2010, 2:06:51 PM
    Author     : nbuser
--%>

<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Enter Your Name</title>
    </head>
    <body>
        <h1>Enter Your Name!</h1>  
        <form:form commandName="car" method="POST">
                Brand:<br>
                <form:input path="brand.name"/><br>
                    <form:input path="brand.country"/><br>
                Price:<br>
                    <form:input path="price"/><br>
                <input type="submit" value="OK">
            </form:form>

    </body>
</html>

carView.jsp

    <%--
    Document   : carView
    Created on : May 2, 2010, 2:06:25 PM
    Author     : nbuser
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Hello</title>
    </head>
    <body>
        <h2>${name}</h2>
        <h2>${country}</h2>
        <h2>${price}</h2>
    </body>
</html>

applicationContext.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:p="http://www.springframework.org/schema/p"
       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.1.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
    <bean name="carService" class="Service.CarService" />
    <!--bean id="propertyConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
          p:location="/WEB-INF/jdbc.properties" />

<bean id="dataSource"
    class="org.springframework.jdbc.datasource.DriverManagerDataSource"
    p:driverClassName="${jdbc.driverClassName}"
    p:url="${jdbc.url}"
    p:username="${jdbc.username}"
    p:password="${jdbc.password}" /-->

    <!-- ADD PERSISTENCE SUPPORT HERE (jpa, hibernate, etc) -->

</beans>

web.xml

    <?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" 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_3_1.xsd">
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>*.htm</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>faces/index.xhtml</welcome-file>
        <welcome-file>redirect.jsp</welcome-file>
    </welcome-file-list>
</web-app>

CarService.java

package service;

import controller.Car;

/**
 *
 * @author nbuser
 */
public class CarService {

    public String sayName(Car car) {
        return String.format("Name: %s /n", car.getBrand().getName());
    }

    public String sayCountry(Car car) {
        return String.format("Country: %s /n", car.getBrand().getCountry());
    }

    public String sayPrice(Car car) {
        return String.format("Price: %d", car.getPrice());
    }
}

Brand.java

package controller;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author PTOSH
 */
public class Brand {
    private String name;
    private String country;

    public String getCountry() {
        return country;
    }
    public void setCountry(String country) {
        this.country = country;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
}

Car.java

package controller;

import java.math.BigDecimal;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author PTOSH
 */
public class Car {
    private Brand brand;
    private BigDecimal price;

    public Brand getBrand() {
        return brand;
    }
    public void setBrand(Brand brand) {
        this.brand = brand;
    }
    public BigDecimal getPrice() {
        return price;
    }
    public void setPrice(BigDecimal price) {
        this.price = price;
    }
}

CarController.java

    /*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import service.CarService;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;

/**
 *
 * @author PTOSH
 */

//@Controller
//@RequestMapping("car")
public class CarController extends SimpleFormController {
//    @Valid
    private CarService carService;

    public CarController() {
        //Initialize controller properties here or
        //in the Web Application Context
        setCommandClass(Car.class);
        setCommandName("car");
        setSuccessView("successView");
        setFormView("carView");
    }
//    @RequestMapping(method = RequestMethod.GET)
//      public String initForm(ModelMap model){
//      //return form view
//      return "car";
//  }
    public void setCarService(CarService carService) {
        this.carService = carService;
    }

    //Use onSubmit instead of doSubmitAction
    //when you need access to the Request, Response, or BindException objects
    @Override
//    @RequestMapping(method = RequestMethod.POST)
    protected ModelAndView onSubmit(Object command) throws Exception {
        Car car = (Car) command;
        ModelAndView mv = new ModelAndView(getSuccessView());
        mv.addObject("name", carService.sayName(car));
        mv.addObject("country", carService.sayCountry(car));
        mv.addObject("price", carService.sayPrice(car));
        return mv;
    }
}

错误

坟墓:ContainerBase.addChild:开始: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 在 org.apache.catalina.core.StandardContext.start(StandardContext.java:5864) 在 com.sun.enterprise.web.WebModule.start(WebModule.java:691) 在 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041) 在 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024) 在 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747) 在 com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278) 在 com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924) 在 com.sun.enterprise.web.WebApplication.start(WebApplication.java:139) 在 org.glassfish.internal.data.EngineRef.start(EngineRef.java:122) 在 org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291) 在 org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352) 在 com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497) 在 com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219) 在 org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523) 在 java.security.AccessController.doPrivileged(Native Method) 在 javax.security.auth.Subject.doAs(Subject.java:356) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674) 在 com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534) 在 com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224) 在 org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297) 在 com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246) 在 org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) 在 org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) 在 org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) 在 org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) 在 org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) 在 org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) 在 org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) 在 org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) 在 org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) 在 org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) 在 org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) 在 org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) 在 java.lang.Thread.run(Thread.java:744) 引起: java.lang.IllegalArgumentException:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 在 org.apache.catalina.core.StandardContext.addListener(StandardContext.java:3270) 在 org.apache.catalina.core.StandardContext.addApplicationListener(StandardContext.java:2476) 在 com.sun.enterprise.web.TomcatDeploymentConfig.configureApplicationListener(TomcatDeploymentConfig.java:251) 在 com.sun.enterprise.web.TomcatDeploymentConfig.configureWebModule(TomcatDeploymentConfig.java:110) 在 com.sun.enterprise.web.WebModuleContextConfig.start(WebModuleContextConfig.java:266) 在 org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:486) 在 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:163) 在 org.apache.catalina.core.StandardContext.start(StandardContext.java:5861) ... 44 更多原因:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 在 org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1761) 在 org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1611) 在 org.apache.catalina.core.StandardContext.loadListener(StandardContext.java:5414) 在 com.sun.enterprise.web.WebModule.loadListener(WebModule.java:1788) 在 org.apache.catalina.core.StandardContext.addListener(StandardContext.java:3268) ... 51 更多

声明:java.lang.IllegalStateException: ContainerBase.addChild:开始:org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener java.lang.IllegalStateException:ContainerBase.addChild:开始: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 在 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1044) 在 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024) 在 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747) 在 com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278) 在 com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924) 在 com.sun.enterprise.web.WebApplication.start(WebApplication.java:139) 在 org.glassfish.internal.data.EngineRef.start(EngineRef.java:122) 在 org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291) 在 org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352) 在 com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497) 在 com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219) 在 org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523) 在 java.security.AccessController.doPrivileged(Native Method) 在 javax.security.auth.Subject.doAs(Subject.java:356) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674) 在 com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534) 在 com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224) 在 org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297) 在 com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246) 在 org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) 在 org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) 在 org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) 在 org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) 在 org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) 在 org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) 在 org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) 在 org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) 在 org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) 在 org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) 在 org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) 在 org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) 在 java.lang.Thread.run(Thread.java:744)

Grave:调用类时出现异常 com.sun.enterprise.web.WebApplication 启动方法 java.lang.Exception:java.lang.IllegalStateException: ContainerBase.addChild:开始:org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 在 com.sun.enterprise.web.WebApplication.start(WebApplication.java:168) 在 org.glassfish.internal.data.EngineRef.start(EngineRef.java:122) 在 org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291) 在 org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352) 在 com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497) 在 com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219) 在 org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523) 在 java.security.AccessController.doPrivileged(Native Method) 在 javax.security.auth.Subject.doAs(Subject.java:356) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674) 在 com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534) 在 com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224) 在 org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297) 在 com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246) 在 org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) 在 org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) 在 org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) 在 org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) 在 org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) 在 org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) 在 org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) 在 org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) 在 org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) 在 org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) 在 org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) 在 org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) 在 java.lang.Thread.run(Thread.java:744)

严重:生命周期处理期间出现异常 java.lang.Exception: java.lang.IllegalStateException:ContainerBase.addChild:开始: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 在 com.sun.enterprise.web.WebApplication.start(WebApplication.java:168) 在 org.glassfish.internal.data.EngineRef.start(EngineRef.java:122) 在 org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291) 在 org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352) 在 com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497) 在 com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219) 在 org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523) 在 java.security.AccessController.doPrivileged(Native Method) 在 javax.security.auth.Subject.doAs(Subject.java:356) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762) 在 com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674) 在 com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534) 在 com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224) 在 org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297) 在 com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246) 在 org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) 在 org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) 在 org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) 在 org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) 在 org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) 在 org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) 在 org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) 在 org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) 在 org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) 在 org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) 在 org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) 在 org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) 在 org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) 在 java.lang.Thread.run(Thread.java:744)

Grave:加载应用时出现异常 Grave:取消部署失败 对于上下文/myCar Grave:加载应用程序时出现异常: java.lang.IllegalStateException:ContainerBase.addChild:开始: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

【问题讨论】:

    标签: java spring jsp


    【解决方案1】:

    1 查看 Spring 参考文档,您正在使用旧的 Spring 样式(详细)通过 JSP 文件访问对象。

    1. 您有以下内容:

    改变

    <spring:bind path="Brand">
    

    <spring:bind path="brand">
    

    【讨论】:

    • 我更新了代码(我希望我在正确的道路上),但现在我面临这个异常:加载应用程序时出现异常:java.lang.IllegalStateException:ContainerBase.addChild。
    • 更新/编辑您的帖子以包含完整的错误堆栈跟踪。
    • 我在帖子中添加了完整的错误堆栈,请参见上文。谢谢你的时间。
    • About "java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener" 似乎您缺少 pom.xml 文件中的 spring web 依赖项。
    • 我在我的项目中没有看到任何 pom.xml 文件,在我用来构建它的项目中也没有...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-15
    • 1970-01-01
    相关资源
    最近更新 更多