2013-04-08 123 views
0

我爲我配置了一個tomcat服務器來部署JSP Web應用程序,但每次我將啓動該網站時,它會在Tomcat Web Application Manager中提示FAIL - Application at context path /appNameHere could not be started。現在我很困惑爲什麼會發生這種情況,有人可以解釋和幫助爲什麼會出現這種情況嗎?請看下面的詳細錯誤。無法在Tomcat中啓動JSP

Apr 08, 2013 4:44:30 PM org.apache.catalina.core.StandardContext start 
SEVERE: Error listenerStart 
Apr 08, 2013 4:44:30 PM org.apache.catalina.core.StandardContext start 
SEVERE: Context [/appNameHere] startup failed due to previous errors 
Apr 08, 2013 4:44:30 PM org.apache.catalina.core.ApplicationContext log 
INFO: Closing Spring root WebApplicationContext 
Apr 08, 2013 4:44:33 PM org.apache.catalina.core.ApplicationContext log 
INFO: Initializing Spring root WebApplicationContext 
Apr 08, 2013 4:44:34 PM org.apache.catalina.core.StandardContext listenerStart 
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener 
org.jasypt.exceptions.EncryptionOperationNotPossibleException: Encryption raised an exception. A possible cause is you are using strong encryption algorithms and you have not installed the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files in this Java Virtual Machine 
    at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.handleInvalidKeyException(StandardPBEByteEncryptor.java:819) 
    at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.decrypt(StandardPBEByteEncryptor.java:796) 
    at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:639) 
    at org.jasypt.properties.PropertyValueEncryptionUtils.decrypt(PropertyValueEncryptionUtils.java:72) 
    at org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer.convertPropertyValue(EncryptablePropertyPlaceholderConfigurer.java:107) 
    at org.springframework.beans.factory.config.PropertyResourceConfigurer.convertProperty(PropertyResourceConfigurer.java:112) 
    at org.springframework.beans.factory.config.PropertyResourceConfigurer.convertProperties(PropertyResourceConfigurer.java:95) 
    at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:72) 
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:663) 
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:638) 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407) 
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) 
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) 
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) 
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206) 
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705) 
    at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1276) 
    at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:625) 
    at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:136) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
    at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:194) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) 
    at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879) 
    at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:600) 
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1703) 
    at java.lang.Thread.run(Unknown Source) 

Apr 08, 2013 4:44:34 PM org.apache.catalina.core.StandardContext start 
SEVERE: Error listenerStart 
Apr 08, 2013 4:44:34 PM org.apache.catalina.core.StandardContext start 
SEVERE: Context [/appNameHere] startup failed due to previous errors 
Apr 08, 2013 4:44:34 PM org.apache.catalina.core.ApplicationContext log 
INFO: Closing Spring root WebApplicationContext 

,這裏是我的web.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns="http://java.sun.com/xml/ns/javaee"  
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
     version="3.0"> 
    <session-config> 
     <session-timeout>20</session-timeout> 
     <cookie-config> 
      <http-only>true</http-only> 
      <secure>true</secure> 
     </cookie-config> 
     <tracking-mode>COOKIE</tracking-mode> 
    </session-config> 
    <listener> 
     <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
    </listener> 
    <servlet> 
     <servlet-name>visitorApp</servlet-name> 
     <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
     <load-on-startup>1</load-on-startup> 
    </servlet> 
    <servlet-mapping> 
     <servlet-name>visitorApp</servlet-name> 
     <url-pattern>*.html</url-pattern> 
    </servlet-mapping> 
    <welcome-file-list> 
     <welcome-file> 
      index.jsp 
     </welcome-file> 
    </welcome-file-list> 
    <context-param> 
     <param-name>contextConfigLocation</param-name> 
     <param-value>/WEB-INF/visitorApp-servlet.xml</param-value> 
    </context-param> 
    <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> 

    <!-- Default page to serve --> 
    <error-page> 
     <exception-type>java.lang.Throwable</exception-type> 
     <location>/error.jsp</location> 
    </error-page> 
    <error-page> 
     <error-code>404</error-code> 
     <location>/error.jsp</location> 
    </error-page> 
    <error-page> 
     <error-code>500</error-code> 
     <location>/error.jsp</location> 
    </error-page> 
</web-app> 

這裏的visitorApp-servlet.xml中:

<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:mvc="http://www.springframework.org/schema/mvc" 
     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/mvc 
      http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"> 

    <import resource="classes/applicationContext.xml"/> 

    <!-- JSR-303 support will be detected on classpath and enabled automatically --> 
    <mvc:annotation-driven/> 

    <context:component-scan base-package=myPackageNameHere"/> 

    <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> 
     <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> 
     <property name="prefix" value="/WEB-INF/jsp/"/> 
     <property name="suffix" value=".jsp"/> 
    </bean> 

    <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> 
     <property name="basename" value="classpath:messages"/> 
    </bean> 

</beans> 

是有什麼毛病我的聽衆?提前致謝!

+0

,你能否告訴'visitorApp,servlet.xml'?你的jdk的版本是什麼? – 2013-04-08 08:58:17

+0

使用'visitorApp-servlet.xml'查看更新後的問題。 – lexeRoy 2013-04-08 09:03:52

回答

1

如果要存儲的加密數據到數據庫中,請檢查您所使用的表列來存儲它是足夠大以容納加密數據(始終大於原始數據)。如果您通過HTTP傳輸加密數據,請檢查您是否將BASE64編碼數據作爲URL參數傳輸出現問題(BASE64使用URL參數中禁用的字符,例如「=」)。對於這些用途,請嘗試使用十六進制輸出。

This link would be helpful