可能重複:
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: [email protected][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
嗨, 我有一個問題,當我的戰爭文件部署到JBoss的部署文件夾,即部署失敗,我相信這是一些與配置和類路徑相關的問題,但我無法弄清楚導致問題的確切部分。
這是我遵循的程序/方法。其實我通過使用ant build script(在eclipse中)構建.WAR文件。最後,我的war文件將不包含lib文件夾(這意味着它內部沒有.jar,即作爲.WAR文件的需求不應該被加重)但是每個.jar(包括servlet-api.jar)文件都需要。 WAR在jboss類路徑配置中可用,但仍然在部署時收到錯誤和異常。請在上面找到更多詳細信息(server.log信息被粘貼)的日誌。
注意:在我的ant構建腳本中,我沒有在內部編譯/鏈接任何類。我的意思是說:即使對於ant文件.jars也可以通過ant classpath獲得。
這裏是我的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。
完美匹配我相信http://stackoverflow.com/questions/8611777/java-lang-nosuchmethoderror-javax-servlet-servletcontext-getcontextpathljava – Thihara
@Thihara Hi Thihara,謝謝你的迴應。我看了一下鏈接。這與我的Q有關,但我嘗試了兩種方式。即我在jboss類路徑中包含了servlet-api.jar(顯示了服務器日誌)。我試圖通過從類路徑中移除該jar來運行jboss,此時我會得到類com.icesoft.faces.util.event.servlet.ContextEventRepeater的應用程序監聽器沒有實例化的東西。在兩方面我都無法成功。多數民衆贊成我接近stackoverflow。任何快速排除故障將非常感激。 – user1497365
有這個類的icefaces.jar - com.icesoft.faces.util.event.servlet.ContextEventRepeater也可以在jboss類路徑中使用。 – user1497365