可能重复:
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
2012-12-12 20:35:34,047 INFO [org.apache.catalina.core.StandardEngine] (main) Starting Servlet Engine: JBoss Web/2.1.10
2012-12-12 20:35:34,094 INFO [org.apache.catalina.startup.Catalina] (main) Server startup in 87 ms
2012-12-12 20:35:34,125 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (main) deploy, ctxPath=/invoker
2012-12-12 20:35:34,640 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/invoker]] (main) Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
at com.sun.faces.config.WebConfiguration.getServletContextName(WebConfiguration.java:250)
at com.sun.faces.config.WebConfiguration.<init>(WebConfiguration.java:100)
at com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:158)
.
.
.
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:662)
2012-12-12 20:35:34,640 ERROR [org.apache.catalina.core.StandardContext] (main) Error listenerStart
2012-12-12 20:35:34,640 ERROR [org.apache.catalina.core.StandardContext] (main) Context [/invoker] startup failed due to previous errors
2012-12-12 20:35:34,718 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=jboss.web.deployment:war=/invoker state=Create mode=Manual requiredState=Installed
org.jboss.deployers.spi.DeploymentException: URL file:/C:/EDM/JBoss-EAP/jboss-eap-5.1/jboss-as/server/default/deploy/http-invoker.sar/invoker.war/ deployment failed
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:342)
.
.
.
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:662)
2012-12-12 20:35:34,749 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (main) deploy, ctxPath=/jbossws
2012-12-12 20:35:34,796 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/jbossws]] (main) Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
at com.sun.faces.config.WebConfiguration.getServletContextName(WebConfiguration.java:250)
at com.sun.faces.config.WebConfiguration.<init>(WebConfiguration.java:100)
at com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:158)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:145)
at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:60)
.
.
.
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:662)
2012-12-12 20:35:34,796 ERROR [org.apache.catalina.core.StandardContext] (main) Error listenerStart
2012-12-12 20:35:34,796 ERROR [org.apache.catalina.core.StandardContext] (main) Context [/jbossws] startup failed due to previous errors
2012-12-12 20:35:34,796 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=jboss.web.deployment:war=/jbossws state=Create mode=Manual requiredState=Installed
org.jboss.deployers.spi.DeploymentException: URL file:/C:/EDM/JBoss-EAP/jboss-eap-5.1/jboss-as/server/default/deploy/jbossws.sar/jbossws-management.war/ deployment failed
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:342)
.
.
.
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:662)
2012-12-12 20:35:34,796 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (main) deploy, ctxPath=/web-console
2012-12-12 20:35:34,827 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/web-console]] (main) Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
at com.sun.faces.config.WebConfiguration.getServletContextName(WebConfiguration.java:250)
.
.
.
2012-12-12 20:35:39,199 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Real: name=vfszip:/C:/EDM/JBoss-EAP/jboss-eap-5.1/jboss-as/server/default/deploy/RDSGUIWeb.war/ state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: URL file:/C:/EDM/JBoss-EAP/jboss-eap-5.1/jboss-as/server/default/tmp/5j2at36-3k5zwg-han7uhp7-1-han7uyj0-9u/RDSGUIWeb.war/ deployment failed
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:342)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:145)
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
at $Proxy38.start(Unknown Source)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:297)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
at org.jboss.system.ServiceController.start(ServiceController.java:460)
at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1454)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1172)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1193)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1113)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:789)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:699)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:778)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:543)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:662)
2012-12-12 20:35:39,699 INFO [org.jboss.system.server.profileservice.ProfileServiceBootstrap] (main) Loading profile: ProfileKey@12b7414[domain=default, server=default, name=default]
2012-12-12 20:35:39,699 ERROR [org.jboss.system.server.profileservice.ProfileServiceBootstrap] (main) Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
DEPLOYMENTS IN ERROR:
Deployment "jboss.web.deployment:war=/web-console" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: URL file:/C:/EDM/JBoss-EAP/jboss-eap-5.1/jboss-as/server/default/deploy/management/console-mgr.sar/web-console.war/ deployment failed
Deployment "jboss.web.deployment:war=/jbossws" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: URL file:/C:/EDM/JBoss-EAP/jboss-eap-5.1/jboss-as/server/default/deploy/jbossws.sar/jbossws-management.war/ deployment failed
Deployment "vfszip:/C:/EDM/JBoss-EAP/jboss-eap-5.1/jboss-as/server/default/deploy/RDSGUIWeb.war/" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: URL file:/C:/EDM/JBoss-EAP/jboss-eap-5.1/jboss-as/server/default/tmp/5j2at36-3k5zwg-han7uhp7-1-han7uyj0-9u/RDSGUIWeb.war/ deployment failed
Deployment "jboss.web.deployment:war=/invoker" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: URL file:/C:/EDM/JBoss-EAP/jboss-eap-5.1/jboss-as/server/default/deploy/http-invoker.sar/invoker.war/ deployment failed
2012-12-12 20:35:39,715 INFO [org.apache.coyote.http11.Http11Protocol] (main) Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
2012-12-12 20:35:39,746 INFO [org.apache.coyote.ajp.AjpProtocol] (main) Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
2012-12-12 20:35:39,746 INFO [org.jboss.bootstrap.microcontainer.ServerImpl] (main) JBoss (Microcontainer) [5.1.0 (build: SVNTag=JBPAPP_5_1_0 date=201009150028)] Started in 25s:322ms
您好, 当我的war文件部署到jboss deploy文件夹中时出现问题,即部署失败,我确信这是与配置和类路径问题有关的一些问题,但我无法找出造成问题的确切部分。
这是我遵循的程序/方法。实际上我正在使用ant build脚本(在eclipse中)构建.WAR文件。最后我的war文件将不包含lib文件夹(这意味着内部没有.jars,这就要求.WAR文件不应该加权)但是每个.jar(包括servlet-api.jar)文件都需要。 WAR在jboss类路径配置中可用,但在部署时我仍然遇到错误和异常。请查看日志以获取更多详细信息(上面粘贴了server.log信息)。
注意:在我的ant构建脚本中,我没有在内部编译/链接任何类。我的意思是:即使对于ant文件,也可以通过ant classpath提供.jars。
这是我的build.xml的摘要:
<target name="compile" depends="clean, init">
<javac destdir="${rds.build}" debug="true" srcdir="${rds.src}">
</javac>
</target>
<target name="war" depends="compile, doTestLevel, doProdLevel">
<war destfile="${rds.dist.bin}/RDSGUIWeb.war" >
<fileset dir="${projectRootDir}/WebContent">
<include name="**/*"/>
<exclude name="/WEB-INF/lib/**" />
</fileset>
<classes dir="${rds.build}" />
</war>
</target>
更新:我试图通过从类路径中删除servlet-api.jar来运行jboss。此时我将获得类com.icesoft.faces.util.event.servlet.ContextEventRepeater类的应用程序监听器之类的东西。实例化。在两种方式中(包括servlet-api.jar或不包括)我都无法成功。这就是我接近stackoverflow的共鸣。
答案 0 :(得分:0)
我将所有jar都复制到 lib 文件夹中,该文件夹位于默认文件夹(即默认的JBOSS实例的库文件夹)中,而不是在JBOSS的classpath / buildpath中使它们可用用户条目。那终于工作了!!!