2

Note: This is followup to the following question for which the solution worked at old JBoss 5.1/6.0: https://developer.jboss.org/thread/160804. It doesn't seem to work anymore at JBoss EAP 7.1.

We've got an application built for multiple app servers. In its web module web.xml it contains 2 resource references to commonj TimerManager and WorkManager (to be used at WebLogic and WebSphere):

<resource-ref>
    <res-ref-name>wm/WM1</res-ref-name>
    <res-type>commonj.work.WorkManager</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref>
    <res-ref-name>tm/TM1</res-ref-name>
    <res-type>commonj.timers.TimerManager</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>

This of course doesn't work at JBoss and leads to

ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.subunit."APP.ear"."mod.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."APP.ear"."mod.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of subdeployment "mod.war" of deployment "APP.ear"
            at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
            at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at java.lang.Thread.run(Thread.java:748)
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0027: Could not load commonj.work.WorkManager referenced in env-entry
            at org.jboss.as.ee.component.deployers.ResourceReferenceProcessor.getResourceRefEntries(ResourceReferenceProcessor.java:153)
            at org.jboss.as.ee.component.deployers.ResourceReferenceProcessor.processDescriptorEntries(ResourceReferenceProcessor.java:74)
            at org.jboss.as.ee.component.deployers.AbstractDeploymentDescriptorBindingsProcessor.deploy(AbstractDeploymentDescriptorBindingsProcessor.java:95)
            at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
            ... 5 more
    Caused by: java.lang.ClassNotFoundException: commonj.work.WorkManager from [Module "deployment.APP.ear.mod.war" from Service Module Loader]
            at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
            at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
            at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
            at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
            at org.jboss.as.ee.component.deployers.ResourceReferenceProcessor.getResourceRefEntries(ResourceReferenceProcessor.java:151)
            ... 8 more

Unfortunately those resource references are required by the CommonJ spec so I can't just remove them and use direct JNDI lookups for those resources for example. Based on the suggestion in the above linked thread https://developer.jboss.org/thread/160804 I thus tried using the following jboss-web.xml, adding some dummy JNDI name to each entry and especially "ignore-dependency":

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_7_2.xsd"
           version="7.2">

    <context-root>mod</context-root>

    <resource-ref>
        <res-ref-name>wm/WM1</res-ref-name>
        <jndi-name>DummyWorkManager</jndi-name>
        <ignore-dependency/>
    </resource-ref>

    <resource-ref>
        <res-ref-name>tm/TM1</res-ref-name>
        <jndi-name>DummyTimerManager</jndi-name>
        <ignore-dependency/>
    </resource-ref>

</jboss-web>

This however changed nothing, the exception on deployment was still the same. I thus tried adding some dummy res-type to jboss-web.xml - just anything which would succeed such as

<res-type>javax.resource.Referenceable</res-type>

I added it to both work manager and timer manager entries, however it seemed to helped only for work manager as the exception changed from

java.lang.ClassNotFoundException: commonj.work.WorkManager

to

java.lang.ClassNotFoundException: commonj.timers.TimerManager

while everything else was the same. In order to get around this at least temporarily I commented out the timer manager entry in web.xml and let things proceed further. This however ended up with:

ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "APP.ear")]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.module.app-name.mod-name.env.DummyWorkManager"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.app-name.mod-name.env.wm.WM1 is missing [jboss.naming.context.java.module.app-name.mod-name.env.DummyWorkManager]"]
}

Meaning that even the ignore-dependency doesn't work.

To summarize:

  • overriding resource-ref in jboss-web.xml doesn't seem to work properly (I could successfully do it only for the work manager resource reference, but not for the timer manager one)
  • ignore-dependency in resource-ref in jboss-web.xml doesn't
    work either

Is this correct behavior at current JBoss EAP/WildFly versions? How to make JBoss/WildFly successfully ignore some irrelevant resource references then?

Note: I'm not going to use these resources at JBoss in any way, that isn't an issue (they're really used only at WebLogic or WebSphere). The issue is just to make the application deploy successfully.

EDIT: Since nobody seems to be able to provide any answer, I created a JIRA issue for this: https://issues.jboss.org/browse/JBEAP-15758

Petr H
  • 452
  • 1
  • 3
  • 10

0 Answers0