- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在重启 Tomcat 后将文件 war 部署到 Tomcat 时,韩国的 egovframework 出现问题,它显示如下错误:
2011-12-23 09:16:01,101 ERROR [org.springframework.web.servlet.DispatcherServlet] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'imageRenderer' defined in ServletContext resource [/WEB-INF/config/egovframework/springmvc/egov-com-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:660)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
....................................................
我用过:
[root@localhost bin]# java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.10) (rhel-1.23.1.9.10.el5_7-i386)
OpenJDK Client VM (build 19.0-b09, mixed mode)
这是文件 WEB-INF/web.xml
<display-name>spring security</display-name>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.mdo</url-pattern>
</filter-mapping>
<filter>
<filter-name>HTMLTagFilter</filter-name>
<filter-class>egovframework.com.cmm.filter.HTMLTagFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>HTMLTagFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<!-- 0. 로그인 정책 컴포넌트용 필터 -->
<!--
<filter>
<filter-name>LoginPolicyFilter</filter-name>
<filter-class>egovframework.com.uat.uap.filter.EgovLoginPolicyFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>LoginPolicyFilter</filter-name>
<url-pattern>/uat/uia/actionLogin.do</url-pattern>
</filter-mapping>
-->
<!-- Restoration from HTMLTagFilter's action (certification login) -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:egovframework/spring/com/context-*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/egovframework/springmvc/egov-com-*.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- 1. Spring Security 필터 설정-->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.security.ui.session.HttpSessionEventPublisher</listener-class>
</listener>
<!-- 2. Spring Security 로그아웃 설정을 위한 필터 설정 -->
<filter>
<filter-name>EgovSpringSecurityLogoutFilter</filter-name>
<filter-class>egovframework.com.sec.security.filter.EgovSpringSecurityLogoutFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>EgovSpringSecurityLogoutFilter</filter-name>
<url-pattern>/uat/uia/actionLogout.do</url-pattern>
</filter-mapping>
<!-- 2. Spring Security 로그인 설정을 위한 필터 설정 -->
<filter>
<filter-name>EgovSpringSecurityLoginFilter</filter-name>
<filter-class>egovframework.com.sec.security.filter.EgovSpringSecurityLoginFilter</filter-class>
<init-param>
<description>로그인 실패시 반활 될 URL설정</description>
<param-name>loginURL</param-name>
<param-value>/uat/uia/egovLoginUsr.do</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>EgovSpringSecurityLoginFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<!-- 3. EgovSSO 로그아웃 설정을 위한 필터 설정 -->
<!--
<filter>
<filter-name>EgovSSOLogoutFilter</filter-name>
<filter-class>egovframework.com.uat.sso.filter.EgovSSOLogoutFilter</filter-class>
<init-param>
<description>SSO Global Logout 처리후 반환되는 페이지 설정</description>
<param-name>returnURL</param-name>
<param-value>/j_spring_security_logout</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>EgovSSOLogoutFilter</filter-name>
<url-pattern>/uat/uia/actionLogout.do</url-pattern>
</filter-mapping>
-->
<!-- 3. EgovSSO 로그인 설정을 위한 필터 설정 -->
<!--
<filter>
<filter-name>EgovSSOLoginFilter</filter-name>
<filter-class>egovframework.com.uat.sso.filter.EgovSSOLoginFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>EgovSSOLoginFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
-->
<!-- AjaxTags configuration START-->
<servlet>
<servlet-name>ajaxServlet</servlet-name>
<servlet-class>net.sourceforge.ajaxtags.servlets.SourceLoader</servlet-class>
<init-param>
<param-name>prefix</param-name>
<param-value>/ajaxtags</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>ajaxServlet</servlet-name>
<url-pattern>/ajaxtags/js/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ajaxServlet</servlet-name>
<url-pattern>/ajaxtags/img/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ajaxServlet</servlet-name>
<url-pattern>/ajaxtags/css/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>egovDevIndex.jsp</welcome-file>
</welcome-file-list>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<session-config>
<session-timeout>600</session-timeout>
</session-config>
<error-page>
<error-code>404</error-code>
<location>/code404.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/code500.jsp</location>
</error-page>
</web-app>
这里是/WEB-INF/config/egovframework/springmvc/egov-com-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
수정일 수정자 수정내용
========= ======= =================================================
2011.09.07 서준식 로그인 체크 인터셉터 추가
2011.09.29 이기하 에러페이지 경로수정
-->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<!-- The controllers are autodetected POJOs labeled with the @Controller annotation. -->
<context:component-scan base-package="egovframework, example">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service"/>
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Repository"/>
</context:component-scan>
<!-- For Pagination Tag -->
<bean id="imageRenderer" class="egovframework.com.cmm.ImagePaginationRenderer"/>
<bean id="paginationManager" class="egovframework.rte.ptl.mvc.tags.ui.pagination.DefaultPaginationManager">
<property name="rendererType">
<map>
<entry key="image" value-ref="imageRenderer"/>
</map>
</property>
</bean>
<!--
- The form-based controllers within this application provide @RequestMapping
- annotations at the type level for path mapping URLs and @RequestMapping
- at the method level for request type mappings (e.g., GET and POST).
- In contrast, ClinicController - which is not form-based - provides
- @RequestMapping only at the method level for path mapping URLs.
-
- DefaultAnnotationHandlerMapping is driven by these annotations and is
- enabled by default with Java 5+.
-->
<!--
- This bean processes annotated handler methods, applying Application-specific PropertyEditors
- for request parameter binding. It overrides the default AnnotationMethodHandlerAdapter.
-->
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="webBindingInitializer">
<bean class="egovframework.com.cmm.web.EgovBindingInitializer"/>
</property>
<property name="customArgumentResolvers">
<list>
<bean class="egovframework.rte.ptl.mvc.bind.CommandMapArgumentResolver"/>
</list>
</property>
</bean>
<!-- 로그인 체크가 필요한 URL과 로그인 여부를 체크해줄 인터셉터를 등록한다. -->
<!--
<bean id="selectAnnotaionMapper" class="egovframework.rte.ptl.mvc.handler.SimpleUrlAnnotationHandlerMapping" p:order="1">
<property name="interceptors">
<list>
<ref local="authenticInterceptor" />
</list>
</property>
-->
<!-- 로그인 체크가 필요한 URL 리스트 -->
<!--
<property name="urls">
<set>
<value>/**/*.do</value>
</set>
</property>
</bean>
-->
<!-- 로그인 체크 인터셉터 -->
<!-- <bean id="authenticInterceptor" class="egovframework.com.cmm.interceptor.AuthenticInterceptor"> -->
<!-- 인증 체크가 필요 없는 URL 리스트 -->
<!--
<property name="permittedURL">
<set>
<value>/uat/uia/[a-zA-Z]+\.do</value>
<value>/EgovLeft.do</value>
<value>/uat/uia/actionLogin.do</value>
</set>
</property>
</bean>
-->
<!--
- This bean resolves specific types of exceptions to corresponding logical
- view names for error views. The default behaviour of DispatcherServlet
- is to propagate all exceptions to the servlet container: this will happen
- here with all other types of exceptions.
-->
<bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="defaultErrorView" value="egovframework/com/cmm/error/egovError"/>
<property name="exceptionMappings">
<props>
<prop key="org.springframework.dao.DataAccessException">egovframework/com/cmm/error/dataAccessFailure</prop>
<prop key="org.springframework.transaction.TransactionException">egovframework/com/cmm/error/dataAccessFailure</prop>
<prop key="egovframework.rte.fdl.cmmn.exception.EgovBizException">egovframework/com/cmm/error/egovBizException</prop>
<prop key="org.springframework.web.HttpSessionRequiredException">egovframework/com/uat/uia/EgovLoginUsr</prop>
</props>
</property>
</bean>
<!--
- This bean configures the 'prefix' and 'suffix' properties of
- InternalResourceViewResolver, which resolves logical view names
- returned by Controllers. For example, a logical view name of "vets"
- will be mapped to "/WEB-INF/jsp/vets.jsp".
-->
<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver" p:order="1"
p:viewClass="org.springframework.web.servlet.view.JstlView"
p:prefix="/WEB-INF/jsp/" p:suffix=".jsp"/>
<!--
- Message source for this context, loaded from localized "messages_xx" files.
- Could also reside in the root application context, as it is generic,
- but is currently just used within Application's web tier.
-->
<!-- <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource" p:basename="messages/message-common"/> -->
</beans>
最佳答案
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
该方法已添加到 Servlet 2.5 中.
所以这个问题至少有3个原因:
web.xml
符合 Servlet 2.5 或更新版本。解决它,
web.xml
的根声明符合 Servlet 2.5(或更新版本,至少是目标运行时支持的最高版本)。例如,另请参阅中途某处 our servlets wiki page ./WEB-INF/lib 中没有任何 servlet 容器特定的库,如 servlet-api.jar
或 j2ee.jar
甚至更糟,JRE/lib
或 JRE/lib/ext
。他们不属于那里。这是初学者在尝试规避 IDE 中的编译错误时常犯的错误,另请参见 How do I import the javax.servlet API in my Eclipse project? .关于java.lang.NoSuchMethodError : javax. servlet.ServletContext.getContextPath()Ljava/lang/String;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29134299/
如果您想使用 String.Concat() 连接 5 个或更多字符串,则它会使用 Concat(String[])。 为什么不一直使用 Concat(String[]) 而不再需要 Concat(S
今天在使用 String 时,我遇到了一种我以前不知道的行为。我无法理解内部发生的事情。 public String returnVal(){ return "5";
似乎在我所看到的任何地方,都有一些过时的版本,这些版本不再起作用。 我的问题似乎很简单。我有一个Java类,它映射到derby数据库。我正在使用注释,并且已经成功地在数据库中创建了所有其他表,但是在这
一、string::size_type() 在C++标准库类型 string ,在调用size函数求解string 对象时,返回值为size_type类型,一种类似于unsigned类型的int 数据
我正在尝试将数据保存到我的 plist 文件中,其中包含字符串数组的定义。我的plist - enter image description here 我将数据写入 plist 的代码是 -- let
我有一个带有键/值对的 JavaScript 对象,其中值是字符串数组: var errors = { "Message": ["Error #1", "Error #2"], "Em
例如,为了使用相同的函数迭代 List 和 List> ,我可以编写如下内容: import java.util.*; public class Test{ public static voi
第一个Dictionary就像 Dictionary ParentDict = new Dictionary(); ParentDict.Add("A_1", "1")
这是我的 jsp 文件: 我遇到了错误 The method replace(String, String, String) in the type Functions is not appl
我需要一些帮助。我有一个方法应该输出一个包含列表内容的 txt 文件(每行中的每个项目)。列表项是字符串数组。问题是,当我调用 string.Join 时,它返回文字字符串 "System.Strin
一位同事告诉我,使用以下方法: string url = "SomeURL"; string ext = "SomeExt"; string sub = "SomeSub"; string s
给定类: public class CategoryValuePair { String category; String value; } 还有一个方法: public
我正在尝试合并 Stream>>对象与所有 Streams 中的键一起映射到单个映射中. 例如, final Map someObject; final List>> list = someObjec
在这里使用 IDictionary 的值(value)是什么? 最佳答案 使用接口(interface)的值(value)始终相同:切换到另一个后端实现时,您不必更改客户端代码。 请考虑稍后分析您的代
我可以知道这两个字典声明之间的区别吗? var places = [String: String]() var places = [Dictionary()] 为什么当我尝试以这种方式附加声明时,只有
在 .NET 4.0 及更高版本中存在 string.IsNullOrWhiteSpace(string) 时,在检查字符串时使用 string.IsNullOrEmpty(string) 是否被视为
这个名字背后的原因是什么? SS64在 PowerShell 中解释此处的字符串如下: A here string is a single-quoted or double-quoted string
我打算离开 this 文章,尝试编写一个接受字符串和 &str 的函数,但我遇到了问题。我有以下功能: pub fn new(t_num: S) -> BigNum where S: Into {
我有一个结构为 [String: [String: String]] 的多维数组。我可以使用 for 循环到达 [String: String] 位,但我不知道如何访问主键(这个位 [String:
我正在尝试使用 sarama(管理员模式)创建主题。没有 ConfigEntries 工作正常。但我需要定义一些配置。 我设置了主题配置(这里发生了错误): tConfigs := map[s
我是一名优秀的程序员,十分优秀!