Search code examples
jboss6.xjboss-eap-6

How to identify the missing JBoss EAP module


I have a module that lists as dependencies,

--dependencies=javax.servlet.api,javax.security.jacc.api,org.jboss.logging,org.picketbox,org.picketlink.federation,org.picketlink.federation.bindings,org.jboss.as.web

but eap complains about a missing class,

Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletResponse from [Module "com.td.cbaw.oauthlogin:main" from local module loader @16f65612 (finder: local module finder @311d617d (roots: /opt/jboss/EAP-6.4.0/modules,/opt/jboss/EAP-6.4.0/modules/system/layers/base))]

The javax.servlet.api module contains the class in question

 ...
 81 javax/servlet/http/HttpServlet.class
 82 javax/servlet/http/LocalStrings_es.properties
 83 javax/servlet/http/HttpSessionContext.class
 84 javax/servlet/http/NoBodyOutputStream.class
 85 javax/servlet/http/HttpServletResponse.class   <====
 86 javax/servlet/http/HttpUtils.class
 87 javax/servlet/http/HttpSessionListener.class
 88 javax/servlet/http/HttpSessionActivationListener.class
 ....

How does one root cause this kind of problem?

This is the sum total of information I have found on the subject, Find_the_JBoss_Module_Dependency, essentially useless docs.

Thanks.


Solution

  • Looking at logs seems you are missing jboss-servlet-api_3.0 JBoss module. To fix that, follow below steps:

    Step 1: Create directory javax/servlet/api/main, as EAP-6.4.0/modules/system/layers/base/javax/servlet/api/main

    Step 2: Create module.xml inside the directory created with below content:

    EAP-6.4.0/modules/system/layers/base/javax/servlet/api/main/module.xml

    <?xml version="1.0" encoding="UTF-8"?>
    
    <module xmlns="urn:jboss:module:1.1" name="javax.servlet.api">
        <resources>
            <resource-root path="jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2.jar"/>
            <!-- Insert resources here -->
        </resources>
    </module>
    

    Step 3: Download jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2 from https://mvnrepository.com/artifact/org.jboss.spec.javax.servlet/jboss-servlet-api_3.0_spec and put it inside EAP-6.4.0/modules/system/layers/base/javax/servlet/api/main directory and restart the server.