DispatcherServlet抛出异常

时间:2013-05-27 12:22:49

标签: java spring jsf spring-mvc dispatcher

我已经配置了Spring MVC和Spring Security并且工作正常。当我添加DispatcherServlet

 <servlet>
    <servlet-name>springandbirt</servlet-name>
    <servlet-class>
    org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
    <init-param>
    <param-name>contextClass</param-name>
    <param-value>org.springframework.web.context.support.Anno tationConfigWebApplicationContext</param-value>
    </init-param> 
    <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>org.eclipse.birt.spring.example.BirtWebConfi guration</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>

然后我得到了例外......

javax.servlet.ServletException: null source
javax.faces.webapp.FacesServlet.service(FacesServl et.java:321)
org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel(InternalResourceVi ew.java:238)
org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:264)
org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1208)
org.springframework.web.servlet.DispatcherServlet. processDispatchResult(DispatcherServlet.java:992)
org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:939)
org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:856)
org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:915)
org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:811)
javax.servlet.http.HttpServlet.service(HttpServlet .java:621)
org.springframework.web.servlet.FrameworkServlet.s ervice(FrameworkServlet.java:796)
javax.servlet.http.HttpServlet.service(HttpServlet .java:728)
org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 330)
org.springframework.security.web.access.intercept. FilterSecurityInterceptor.invoke(FilterSecurityInt erceptor.java:118)
org.springframework.security.web.access.intercept. FilterSecurityInterceptor.doFilter(FilterSecurityI nterceptor.java:84)
org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 342)
org.springframework.security.web.access.ExceptionT ranslationFilter.doFilter(ExceptionTranslationFilt er.java:113)
org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 342)
org.springframework.security.web.session.SessionMa nagementFilter.doFilter(SessionManagementFilter.ja va:64)
org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 342)
org.springframework.security.web.session.SessionMa nagementFilter.doFilter(SessionManagementFilter.ja va:103)
org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 342)
org.springframework.security.web.authentication.An onymousAuthenticationFilter.doFilter(AnonymousAuth enticationFilter.java:113)
org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 342)
org.springframework.security.web.servletapi.Securi tyContextHolderAwareRequestFilter.doFilter(Securit yContextHolderAwareRequestFilter.java:54)
org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 342)
org.springframework.security.web.savedrequest.Requ estCacheAwareFilter.doFilter(RequestCacheAwareFilt er.java:45)
org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 342)
org.springframework.security.web.authentication.Ab stractAuthenticationProcessingFilter.doFilter(Abst ractAuthenticationProcessingFilter.java:183)
org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 342)
org.springframework.security.web.authentication.lo gout.LogoutFilter.doFilter(LogoutFilter.java:105)
org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 342)
org.springframework.security.web.context.SecurityC ontextPersistenceFilter.doFilter(SecurityContextPe rsistenceFilter.java:87)
org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 342)
org.springframework.security.web.FilterChainProxy. doFilterInternal(FilterChainProxy.java:192)
org.springframework.security.web.FilterChainProxy. doFilter(FilterChainProxy.java:160)
org.springframework.web.filter.DelegatingFilterPro xy.invokeDelegate(DelegatingFilterProxy.java:346)
org.springframework.web.filter.DelegatingFilterPro xy.doFilter(DelegatingFilterProxy.java:259)
root cause

java.lang.IllegalArgumentException: null source
java.util.EventObject.<init>(Unknown Source)
javax.faces.event.SystemEvent.<init>(SystemEvent.j ava:67)
javax.faces.event.ComponentSystemEvent.<init>(Comp onentSystemEvent.java:69)
javax.faces.event.PostRestoreStateEvent.<init>(Pos tRestoreStateEvent.java:69)
com.sun.faces.lifecycle.RestoreViewPhase.deliverPo stRestoreStateEvent(RestoreViewPhase.java:256)
com.sun.faces.lifecycle.RestoreViewPhase.execute(R estoreViewPhase.java:245)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:9 7)
com.sun.faces.lifecycle.RestoreViewPhase.doPhase(R estoreViewPhase.java:107)
com.sun.faces.lifecycle.LifecycleImpl.execute(Life cycleImpl.java:114)
javax.faces.webapp.FacesServlet.service(FacesServl et.java:308)
org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel(InternalResourceVi ew.java:238)
org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:264)
org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1208)
org.springframework.web.servlet.DispatcherServlet. processDispatchResult(DispatcherServlet.java:992)
org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:939)
org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:856)
org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:915)
org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:811)
javax.servlet.http.HttpServlet.service(HttpServlet .java:621)
org.springframework.web.servlet.FrameworkServlet.s ervice(FrameworkServlet.java:796)
javax.servlet.http.HttpServlet.service(HttpServlet .java:728)

----这里完整的WEB.XML

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>ACRD</display-name>
<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>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/Spring-Module.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
</listener>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFil terProxy</filter-class>
</filter>

<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<session-config>
<session-timeout>100</session-timeout>
</session-config>

<context-param>
<param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>primefaces.DIR</param-name>
<param-value>#{localeBean.direction}</param-value>
</context-param>

<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/springConfiguration/mvc-dispatcher-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/spring/*</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>springandbirt</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextClass</param-name>
<param-value>org.springframework.web.context.support.Anno tationConfigWebApplicationContext</param-value>
</init-param> 
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>org.eclipse.birt.spring.example.BirtWebConfi guration</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>springandbirt</servlet-name>
<url-pattern>/reports</url-pattern>
</servlet-mapping>


</web-app>

任何身体都可以帮助我吗?我将非常感激。

此致 SB

0 个答案:

没有答案