1

Possible Duplicate:
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

Hi, I have a problem when my war file is deployed into the jboss deploy folder i.e. deployment is failing, I am sure that this is some what related to configuration and classpath issues but I am unable to figure out the exact piece which is causing the problem.

Here is the procedure/method I followed. Actually I'm building the .WAR file by using ant build script (In eclipse). Finally my war file will not contain lib folder (which means no .jars in it internally, thats the requirement as .WAR file shall not be heavy weighted) But every .jar (including servlet-api.jar) file that is needed to .WAR is made available in the jboss classpath configurations but still I'm getting the Errors and Exceptions while deploying. Please find the log for more details (server.log info is pasted) above.

NOTE:In my ant build script I'm not compiling/linking any classes anything internally. What I mean to say is: Even for ant file .jars are made available through ant classpath.

Here is an abstract of my 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>

UPDATE: I tried to run the jboss by removing servlet-api.jar from its classpath, At this time I'll be getting something like application listener of class com.icesoft.faces.util.event.servlet.ContextEventRepeater not instantiated. In both ways (either including servlet-api.jar or not) I'm unable to succeed. Thats the reson I approached stackoverflow.

Community
  • 1
  • 1
  • 2
    Perfect match I believe http://stackoverflow.com/questions/8611777/java-lang-nosuchmethoderror-javax-servlet-servletcontext-getcontextpathljava – Thihara Dec 13 '12 at 02:54
  • @Thihara Hi Thihara, Thanks for your response. I had a glance at the link. It is related to my Q but I tried both ways. i.e. I included servlet-api.jar in the jboss classpath (server log is shown). I tried to run the jboss by removing that jar from its classpath, At this time I'll be getting something like application listener of class com.icesoft.faces.util.event.servlet.ContextEventRepeater not instantiated. In both ways I'm unable to succeed. Thats the reson I approached stackoverflow. Any quick troubleshooting of this would be really appreciated. – Haneesh Pepala Dec 13 '12 at 03:27
  • icefaces.jar which has this class - com.icesoft.faces.util.event.servlet.ContextEventRepeater is also made avaialable in the jboss classpath. – Haneesh Pepala Dec 13 '12 at 03:28
  • You don't need add servlet-api since it are already available in JBoss .Are you runnig in JBOSS EAP 5.1? Can you put your web.xml? – Ernesto Campohermoso Dec 13 '12 at 03:30
  • 1
    Read all of the answers. It's about the version of the servlet-api.... – Thihara Dec 13 '12 at 03:34
  • @ErnestoCampohermoso Yes. Its 5.x. – Haneesh Pepala Dec 13 '12 at 03:38
  • So check your web.xml definition. – Ernesto Campohermoso Dec 13 '12 at 03:39
  • @ErnestoCampohermoso Sorry for late response. I checked web.xml of my web app. Everything was Ok. – Haneesh Pepala Dec 13 '12 at 04:00
  • For the above script i.e. WAR file will have all jars packaged in the lib folder is deploying well without any errors. – Haneesh Pepala Dec 13 '12 at 04:02
  • But the same WAR file without lib folder in it should be deployed to the JBOSS? – Haneesh Pepala Dec 13 '12 at 04:03
  • I added all lib folder jars to the JBOSS classpath. It didn't worked. Y? Thats my concern. If there is another way to achieve the same thing i.e. I should be able to deploy my web app WAR (without lib) into JBOSS, without any errors while deployment, that would be really good to know. I may need someone to help in this please, so that I can move and your help is really appreciated. – Haneesh Pepala Dec 13 '12 at 04:06
  • The definition oy wour web.xml 2.4 or 2.5? – Ernesto Campohermoso Dec 13 '12 at 22:39
  • Thanks for your time guys. I appreciate it. @ErnestoCampohermoso Thank you for your valuable suggestions. – Haneesh Pepala Dec 14 '12 at 02:53

1 Answers1

0

I copied all the jars to the lib folder which is in default folder (i.e. default JBOSS instance's library folder) instead of making them available in the JBOSS's classpath/buildpath user entries. That worked finally!!!

  • Finally, I got the answer after two days of struggling. Ans. is really simple but only thing is figuring out the exact piece took time. I'm not an expert in how the jboss loads the jars when a particular .WAR needs any class i.e. I have no idea about the sequence that it follows to load the jars which made me to bang my head (still I'm not clear about that, If any one has some idea or good documentation that would be great). I'm more interested in the sequence of jars that are being loaded from $CATALINA_HOME's common/lib, client/lib, lib and server/default/lib [when any .WAR file is deployed] – Haneesh Pepala Dec 14 '12 at 02:52