



<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.properties</param-value>
</context-param>
<context-param>
<param-name>log4jRefreshInterval</param-name>
<param-value>60000</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/applicationContext*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 監聽器listener -->
<listener>
<listener-class>com.js.task.listener.ProxoolListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<!-- 過濾器 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>com.js.task.util.StrutsListener</listener-class>
</listener>
<!-- 使用 OpenSessionInViewFilter解決Hibernate懶加載的例外-->
<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<!-- servlet -->
<servlet>
<servlet-name>Log4jInit</servlet-name>
<servlet-class>com.js.task.filter.Log4jInit</servlet-class>
<init-param>
<param-name>log4j</param-name>
<param-value>WEB-INF/log4j.properties</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>proxool</servlet-name>
<servlet-class>org.logicalcobwebs.proxool.admin.servlet.AdminServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>proxool</servlet-name>
<url-pattern>/proxool.xml</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>InvalidateServlet</servlet-name>
<servlet-class>com.js.task.filter.InvalidateServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>InvalidateServlet</servlet-name>
<url-pattern>/invalidloginAction</url-pattern>
</servlet-mapping>
上面是我的配置applicationContext》xml,struts.xml以及useraction以及web.xml;請問是少配置了什么別的嘛?
uj5u.com熱心網友回復:
struts2的配置陳述句好像不對,試試下面的
<!-- 定義Struts2的核心 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<!-- 讓Struts2的核心Filter攔截所有的請求 -->
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
uj5u.com熱心網友回復:
好心人謝謝你的回復,我剛剛按照你的建議改了一下,報了404錯誤,之前沒有改之前是可以打開到首頁的。下面是控制臺報錯的資訊,麻煩您再幫我看一下,我已經因為這個問題折騰了好久,,,資訊: Initializing Spring root WebApplicationContext
2020-09-14 17:30:50,861[main]INFO [org.springframework.web.context.ContextLoader]-Root WebApplicationContext: initialization started
2020-09-14 17:30:51,016[main]DEBUG[org.springframework.web.context.support.StandardServletEnvironment]-Adding [servletConfigInitParams] PropertySource with lowest search precedence
2020-09-14 17:30:51,016[main]DEBUG[org.springframework.web.context.support.StandardServletEnvironment]-Adding [servletContextInitParams] PropertySource with lowest search precedence
2020-09-14 17:30:51,022[main]DEBUG[org.springframework.web.context.support.StandardServletEnvironment]-Adding [jndiProperties] PropertySource with lowest search precedence
2020-09-14 17:30:51,022[main]DEBUG[org.springframework.web.context.support.StandardServletEnvironment]-Adding [systemProperties] PropertySource with lowest search precedence
2020-09-14 17:30:51,024[main]DEBUG[org.springframework.web.context.support.StandardServletEnvironment]-Adding [systemEnvironment] PropertySource with lowest search precedence
2020-09-14 17:30:51,024[main]DEBUG[org.springframework.web.context.support.StandardServletEnvironment]-Initialized StandardServletEnvironment with PropertySources [servletConfigInitParams,servletContextInitParams,jndiProperties,systemProperties,systemEnvironment]
2020-09-14 17:30:51,033[main]DEBUG[org.springframework.web.context.support.StandardServletEnvironment]-Replacing [servletContextInitParams] PropertySource with [servletContextInitParams]
2020-09-14 17:30:51,033[main]INFO [org.springframework.web.context.support.XmlWebApplicationContext]-Refreshing Root WebApplicationContext: startup date [Mon Sep 14 17:30:51 CST 2020]; root of context hierarchy
2020-09-14 17:30:51,095[main]DEBUG[org.springframework.core.env.StandardEnvironment]-Adding [systemProperties] PropertySource with lowest search precedence
2020-09-14 17:30:51,095[main]DEBUG[org.springframework.core.env.StandardEnvironment]-Adding [systemEnvironment] PropertySource with lowest search precedence
2020-09-14 17:30:51,096[main]DEBUG[org.springframework.core.env.StandardEnvironment]-Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
2020-09-14 17:30:51,115[main]DEBUG[org.springframework.core.io.support.PathMatchingResourcePatternResolver]-Resolved location pattern [WEB-INF/applicationContext*.xml] to resources []
2020-09-14 17:30:51,115[main]DEBUG[org.springframework.beans.factory.xml.XmlBeanDefinitionReader]-Loaded 0 bean definitions from location pattern [WEB-INF/applicationContext*.xml]
2020-09-14 17:30:51,115[main]DEBUG[org.springframework.web.context.support.XmlWebApplicationContext]-Bean factory for Root WebApplicationContext: org.springframework.beans.factory.support.DefaultListableBeanFactory@729b1670: defining beans []; root of factory hierarchy
2020-09-14 17:30:51,167[main]DEBUG[org.springframework.web.context.support.XmlWebApplicationContext]-Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@4c538974]
2020-09-14 17:30:51,173[main]DEBUG[org.springframework.web.context.support.XmlWebApplicationContext]-Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@27958cc2]
2020-09-14 17:30:51,176[main]DEBUG[org.springframework.ui.context.support.UiApplicationContextUtils]-Unable to locate ThemeSource with name 'themeSource': using default [org.springframework.ui.context.support.ResourceBundleThemeSource@fc8fb4b]
2020-09-14 17:30:51,177[main]DEBUG[org.springframework.beans.factory.support.DefaultListableBeanFactory]-Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@729b1670: defining beans []; root of factory hierarchy
2020-09-14 17:30:51,179[main]DEBUG[org.springframework.web.context.support.XmlWebApplicationContext]-Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [org.springframework.context.support.DefaultLifecycleProcessor@3d762027]
2020-09-14 17:30:51,179[main]DEBUG[org.springframework.beans.factory.support.DefaultListableBeanFactory]-Returning cached instance of singleton bean 'lifecycleProcessor'
2020-09-14 17:30:51,183[main]DEBUG[org.springframework.core.env.PropertySourcesPropertyResolver]-Searching for key 'spring.liveBeansView.mbeanDomain' in [servletConfigInitParams]
2020-09-14 17:30:51,183[main]DEBUG[org.springframework.core.env.PropertySourcesPropertyResolver]-Searching for key 'spring.liveBeansView.mbeanDomain' in [servletContextInitParams]
2020-09-14 17:30:51,183[main]DEBUG[org.springframework.core.env.PropertySourcesPropertyResolver]-Searching for key 'spring.liveBeansView.mbeanDomain' in [jndiProperties]
2020-09-14 17:30:51,183[main]DEBUG[org.springframework.jndi.JndiTemplate]-Looking up JNDI object with name [java:comp/env/spring.liveBeansView.mbeanDomain]
2020-09-14 17:30:51,184[main]DEBUG[org.springframework.jndi.JndiLocatorDelegate]-Converted JNDI name [java:comp/env/spring.liveBeansView.mbeanDomain] not found - trying original name [spring.liveBeansView.mbeanDomain]. javax.naming.NameNotFoundException: Name spring.liveBeansView.mbeanDomain is not bound in this Context
2020-09-14 17:30:51,184[main]DEBUG[org.springframework.jndi.JndiTemplate]-Looking up JNDI object with name [spring.liveBeansView.mbeanDomain]
2020-09-14 17:30:51,185[main]DEBUG[org.springframework.jndi.JndiPropertySource]-JNDI lookup for name [spring.liveBeansView.mbeanDomain] threw NamingException with message: Name spring.liveBeansView.mbeanDomain is not bound in this Context. Returning null.
2020-09-14 17:30:51,185[main]DEBUG[org.springframework.core.env.PropertySourcesPropertyResolver]-Searching for key 'spring.liveBeansView.mbeanDomain' in [systemProperties]
2020-09-14 17:30:51,185[main]DEBUG[org.springframework.core.env.PropertySourcesPropertyResolver]-Searching for key 'spring.liveBeansView.mbeanDomain' in [systemEnvironment]
2020-09-14 17:30:51,185[main]DEBUG[org.springframework.core.env.PropertySourcesPropertyResolver]-Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null]
2020-09-14 17:30:51,185[main]DEBUG[org.springframework.web.context.ContextLoader]-Published root WebApplicationContext as ServletContext attribute with name [org.springframework.web.context.WebApplicationContext.ROOT]
2020-09-14 17:30:51,185[main]INFO [org.springframework.web.context.ContextLoader]-Root WebApplicationContext: initialization completed in 324 ms
2020-9-14 17:30:51 org.apache.catalina.core.ApplicationContext log
資訊: Set web app root system property: 'webapp.root' = [D:\apache-tomcat-8.5.57-windows-x64\tomcat6.0.45_x64\apache-tomcat-6.0.45\webapps\task\]
2020-9-14 17:30:51 org.apache.catalina.core.ApplicationContext log
資訊: Initializing log4j from [classpath:log4j.properties]
2020-9-14 17:30:51 org.apache.catalina.core.StandardContext filterStart
嚴重: Exception starting filter struts2
java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:272)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:119)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4102)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4760)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:803)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:780)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1080)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1003)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:507)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:325)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1069)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:759)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2020-09-14 17:30:51,258[main]DEBUG[org.springframework.web.context.support.StandardServletEnvironment]-Adding [servletConfigInitParams] PropertySource with lowest search precedence
2020-09-14 17:30:51,258[main]DEBUG[org.springframework.web.context.support.StandardServletEnvironment]-Adding [servletContextInitParams] PropertySource with lowest search precedence
2020-09-14 17:30:51,258[main]DEBUG[org.springframework.web.context.support.StandardServletEnvironment]-Adding [jndiProperties] PropertySource with lowest search precedence
2020-09-14 17:30:51,
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/38244.html
標籤:Java EE
上一篇:求助,Springboot使用jar方式發布程式后,自動掛掉的問題
下一篇:介面呼叫問題
