1

This question is asked before, I know, but I have a special case which doesn't seem to fall under the other answers.

I already have two web apps who packages and deploys on to my JBoss EAP 7.x as expected. My third attempt, however, will not work. Here are where it is different from the other two:

  1. It was originally created as a standard maven archetype, and not a web app archetype (jar pancaking not war). It is simply an auto-updating tool, which runs scheduled updates on data. It is not meant to host any pages, but I needed to code it as a web application, as it seemed the easiest way to deploy to a web application server, given my current knowledge and coding skills. I converted it using the Project Facets tab in project properties.
  2. The web.xml does not include any servlets, but it does contain a ServletContextListener, which starts the update loop.

When I try to deploy my war-file, I get the following error:

Cannot upload deployment: {"WFLYCTL0080: Failed services" => 
{"jboss.undertow.deployment.default-server.default-host./auto-update-
tool.UndertowDeploymentInfoService" => "org.jboss.msc.service.StartException
in service jboss.undertow.deployment.default-server.default-host./auto-
update-tool.UndertowDeploymentInfoService: java.lang.ClassNotFoundException:
servlet.ServletContextListener from [Module \"deployment.auto-update-
tool.war:main\" from Service Module Loader] Caused by: 
java.lang.ClassNotFoundException: servlet.ServletContextListener from 
[Module \"deployment.auto-update-tool.war:main\" from Service Module 
Loader]"}}

These kind of messages are not new to me, but this time I am struggling to solve it.

Basics first: How do I import the javax.servlet API in my Eclipse project? I have followed this to the point. I do have the JavaEE dependency in my pom file. That goes for all three of my projects. They all have scope provided:

    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>6.0</version>
        <scope>provided</scope>
    </dependency>

If i completely remove this, I get a packaging error in maven command line. If I only remove the provided scope line, I get another, but similar error:

Cannot upload deployment: {"WFLYCTL0080: Failed services" => 
{"jboss.deployment.unit.\"auto-update-tool.war\".POST_MODULE" => 
"org.jboss.msc.service.StartException in service 
jboss.deployment.unit.\"auto-update-tool.war\".POST_MODULE: WFLYSRV0153:
Failed to process phase POST_MODULE of deployment \"auto-update-tool.war\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException:
java.lang.ClassNotFoundException: servlet.ServletContextListener from 
[Module \"deployment.auto-update-tool.war:main\" from Service Module Loader]
Caused by: java.lang.ClassNotFoundException: servlet.ServletContextListener 
from [Module \"deployment.auto-update-tool.war:main\" from Service Module
Loader]"}}

I've also tried to switch out my javax dependency, with what I believe is the same version implemented in JBoss 7.x:

    <dependency>
        <groupId>org.jboss.spec.javax.servlet</groupId>
        <artifactId>jboss-servlet-api_3.1_spec</artifactId>
        <version>1.0.1.Final</version>
        <scope>provided</scope>
    </dependency>

The error message is now gone, but replaced with a simple "Upload failed" with no error message whatsoever. I tried to look in the log files, but nothing there either. And I still find it strange that both my other applications work with the other javax dependency.

I am lost. Any advice on how to proceed from here?

Zub
  • 808
  • 3
  • 12
  • 23
jumps4fun
  • 3,994
  • 10
  • 50
  • 96
  • Possible duplicate: https://stackoverflow.com/questions/7849452/classnotfoundexception-with-servletcontextlistener – K.Nicholas Dec 12 '17 at 15:06

0 Answers0