imixs / imixs-jsf-example

Imixs JEE Web Example Application
8 stars 9 forks source link

ClassNotFoundException: org.eclipse.microprofile.config.Config #51

Closed ozzi- closed 4 years ago

ozzi- commented 4 years ago

Hi there

I built imixs-jsf-example-5.1.0 with maven as described, and replaced the old 4.0.2 build we had in use. Since microprofile is now used, I had to update WildFly from 13 to the latest stable version 18.0.1. I enabled the microprofile as such alt text

However when deploying the war, I get:

java.lang.ClassNotFoundException: org.eclipse.microprofile.config.Config from [Module \"deployment.imixs-jsf-example.war\" from Service Module Loader

Any ideas what I am missing?

Cheers full log:

2020-03-16 17:23:19,695 WARN  [org.eclipse.persistence] (ServerService Thread Pool -- 66)
2020-03-16 17:23:19,742 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."imixs-jsf-example.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."imixs-jsf-example.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "imixs-jsf-example.war"
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:183)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
        at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class org.imixs.workflow.engine.TextPropertyValueAdapter with ClassLoader ModuleClassLoader for Module "deployment.imixs-jsf-example.war" from Service Module Loader
        at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:78)
        at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)
        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:106)
        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)
        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:176)
        ... 8 more
Caused by: java.lang.NoClassDefFoundError: Lorg/eclipse/microprofile/config/Config;
        at java.lang.Class.getDeclaredFields0(Native Method)
        at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
        at java.lang.Class.getDeclaredFields(Class.java:1916)
        at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:72)
        at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
        ... 13 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.microprofile.config.Config from [Module "deployment.imixs-jsf-example.war" from Service Module Loader]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
        ... 18 more

2020-03-16 17:23:19,747 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "imixs-jsf-example.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"imixs-jsf-example.war\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"imixs-jsf-example.war\"
    Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class org.imixs.workflow.engine.TextPropertyValueAdapter with ClassLoader ModuleClassLoader for Module \"deployment.imixs-jsf-example.war\" from Service Module Loader
    Caused by: java.lang.NoClassDefFoundError: Lorg/eclipse/microprofile/config/Config;
    Caused by: java.lang.ClassNotFoundException: org.eclipse.microprofile.config.Config from [Module \"deployment.imixs-jsf-example.war\" from Service Module Loader]"}}
ozzi- commented 4 years ago

Saw in the releases that you mention wildfly16 support, checked with wildfly16, same error

rsoika commented 4 years ago

The error:

.....NoClassDefFoundError: Lorg/eclipse/microprofile/config/Config

indicates that the Microprofile v 2.2 is missing.

please make sure you are using:

or

Wildfly 16 is definitely to old. I will fix this in documentation too.

rsoika commented 4 years ago

In your installation there should be the following directory:

/wildfly/modules/system/layers/base/org/eclipse/microprofile/config/

This will indicate that microprofile is included.

ozzi- commented 4 years ago

Hi @rsoika
Thank you for your fast response. I am in fact using the Full EE & Web Distribution f 18.0.1. Said path exists on both 16 and 18.0.1: ls module.xml Any idea what I am missing?

rsoika commented 4 years ago

Just to make sure there are no conflicts with stale deployments. Can you undeploy all existing applications and also check the path

/opt/wildfly/standalone/deployments/

This path should be empty before a new deployment.

ozzi- commented 4 years ago

Okay so funny enough, using wildfly-19.0.0.Beta3 it just works. I am slightly confused.

Edit: let me try to undeploy all on 18.0.1 and get back to you

rsoika commented 4 years ago

In deed this is very confusing because microprofile should be available since version 18.0.0 and we are running many productive applications on wildfly 18. very strange......

By the way: do you have a chance to build your application with docker? This makes live much easier.

ozzi- commented 4 years ago

Hi @rsoika
I can confirm that I cannot get it to run using 18.0.1, undeloyed everything, cleaned the folder and did a fresh deploy. However WildFly 19 works just fine out of the box. Very weird indeed. Unfortunately im not able to use docker in this context - ill continue to use WildFly 19, looking forward to when it looses beta though. Feel free to close this issue - if you want to do further investigation we can, but if im the only one experiencing this we can ignore it ;)

Cheers

ozzi- commented 4 years ago

Only difference I can see is that WF 18 uses microprofile-config-api-1.3.jar while WF 19 uses microprofile-config-api-1.4.jar

ozzi- commented 4 years ago

Turns out, it was my error trying to reuse standalone.xml of wildfly 13... diffing it seems that wf13 missed "urn:jboss:domain:distributable-web" which causes this weird side effect. sorry for that ... WF18 runs just fine.

rsoika commented 4 years ago

Ah! ok now this explains the situation. Yes the standalone.xml file changes form version to version. For that reason I collect them in the docker config folder: https://github.com/imixs/imixs-jsf-example/tree/master/src/docker/configuration/wildfly

OpenLiberty Server is much better in this situation as you can add your own configuration details in an extra project file.