gpt4 book ai didi

java - Jboss 为 ServletActionContext 类抛出 ClassNotFoundExpection?

转载 作者:太空宇宙 更新时间:2023-11-04 15:12:03 25 4
gpt4 key购买 nike

我有一个 struts 应用程序,可以在其中获取我正在使用此代码的 servlet 上下文

ServletContext servletContext = ServletActionContext.getServletContext();

这会在 tomcat 中返回我的 servletcontext,但是当我对 jboss AS 7 使用相同的代码时,它会抛出 ClassNotFoundException。但是struts jar文件已经在jboss模块中了。我不知道为什么会出现这个错误。

任何人都可以帮助我,如何在 jboss AS 7 服务器的操作类中获取 servletcontext 。

21:22:00,477 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[default]] (http--127.0.0.1-8080-1) Servlet.service() for servlet default threw exception: java.lang.ClassNotFoundException: org.apache.struts2.ServletActionContext from [Module "servicebase.company:main" from local module loader @7e270dad (roots: D:\Zeno\jboss-as-7.1.1.Final\modules)]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at com.web.action.DBConfigAction.execute(Unknown Source) [webcontroller-action.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0]
at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0]
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150) [xwork-2.0.7.jar:]
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48) [struts2-core-2.0.14.jar:]
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:184) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83) [struts2-core-2.0.14.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207) [struts2-core-2.0.14.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107) [struts2-core-2.0.14.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206) [struts2-core-2.0.14.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170) [struts2-core-2.0.14.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) [xwork-2.0.7.jar:]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) [xwork-2.0.7.jar:]
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50) [struts2-core-2.0.14.jar:]
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504) [struts2-core-2.0.14.jar:]
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:422) [struts2-core-2.0.14.jar:]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]

我的 Module.xml

        <resource-root path="antlr-3.3.jar"/>
<resource-root path="antlr-runtime-3.3.jar"/>
<resource-root path="org.drools.eclipse_5.5.0.Final.jar"/>
<resource-root path="org.eclipse.jdt.core_3.8.2.v20120814-155456.jar"/>
<resource-root path="jdom.jar"/>
<resource-root path="drools-decisiontables-5.5.0.Final.jar"/>
<resource-root path="commons-lang.jar"/>
<resource-root path="batik-ext-1.7.jar"/>
<resource-root path="commons-lang.jar"/>
<resource-root path="commons-lang3-3.1.jar"/>
<resource-root path="htmlunit-2.11.jar"/>
<resource-root path="htmlunit-core-js-2.11.jar"/>
<resource-root path="commons-httpclient-3.1.jar"/>
<resource-root path="cssparser-0.9.9.jar"/>
<resource-root path="javax.jms.jar"/>
<resource-root path="xwork-2.0.7.jar"/>
<resource-root path="jboss-seam.jar"/>
<dependencies>
<module name="javax.servlet.api" slot="main" export="TRUE"/>
<module name="javax.api" slot="main" export="TRUE"/>
<module name="javax.ejb.api" slot="main" export="TRUE"/>
<module name="org.jboss.logging" slot="main" export="TRUE"/>
<module name="org.jboss.as.naming" slot="main" export="TRUE"/>
<module name="org.jboss.as.jsr77" slot="main" export="TRUE"/>
<module name="org.jboss.as.web" slot="main" export="TRUE"/>
<module name="org.jboss.as.ee" slot="main" export="TRUE"/>
<module name="org.jboss.vfs" slot="main" export="TRUE"/>
<module name="javax.mail.api" slot="main" export="TRUE"/>
<module name="org.apache.log4j" slot="main" export="TRUE"/>
<module name="org.jboss.as.host-controller" slot="main" export="TRUE"/>
<module name="org.jboss.ejb-client" slot="main" export="TRUE"/>
<module name="org.apache.commons.lang" slot="main" export="TRUE"/>
<module name="org.apache.commons.beanutils" slot="main" export="TRUE"/>
<module name="org.apache.commons.codec" slot="main" export="TRUE"/>
<module name="org.apache.commons.collections" slot="main" export="TRUE"/>
</dependencies>

最佳答案

尝试重建您的项目或重新配置您的构建路径

关于java - Jboss 为 ServletActionContext 类抛出 ClassNotFoundExpection?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21217724/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com