ClassNotFoundException when using the Mule Amazon SQS connector - mule

I'm using the Amazon SQS connector in my Mule project. When I updated it from the 2.5.5 to the 3.0.0 version according to the user guide and set the DEBUG logging level for the com.amazonaws package I noticed the following error right after project starts:
DEBUG 2015-07-20 15:15:56,927 [Receiving Thread] com.amazonaws.1.9.39.shade.jmx.spi.SdkMBeanRegistry: Failed to load the JMX implementation module - JMX is disabled
java.lang.ClassNotFoundException: com.amazonaws.1.9.39.shade.jmx.SdkMBeanRegistrySupport
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at org.mule.module.launcher.FineGrainedControlClassLoader.findClass(FineGrainedControlClassLoader.java:175)
at org.mule.module.launcher.MuleApplicationClassLoader.findClass(MuleApplicationClassLoader.java:134)
at org.mule.module.launcher.FineGrainedControlClassLoader.loadClass(FineGrainedControlClassLoader.java:119)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.amazonaws.1.9.39.shade.jmx.spi.SdkMBeanRegistry$Factory.<clinit>(SdkMBeanRegistry.java:46)
at com.amazonaws.1.9.39.shade.metrics.AwsSdkMetrics.registerMetricAdminMBean(AwsSdkMetrics.java:351)
at com.amazonaws.1.9.39.shade.metrics.AwsSdkMetrics.<clinit>(AwsSdkMetrics.java:316)
at com.amazonaws.1.9.39.shade.AmazonWebServiceClient.requestMetricCollector(AmazonWebServiceClient.java:629)
at com.amazonaws.1.9.39.shade.AmazonWebServiceClient.isRMCEnabledAtClientOrSdkLevel(AmazonWebServiceClient.java:570)
at com.amazonaws.1.9.39.shade.AmazonWebServiceClient.isRequestMetricsEnabled(AmazonWebServiceClient.java:562)
at com.amazonaws.1.9.39.shade.AmazonWebServiceClient.createExecutionContext(AmazonWebServiceClient.java:523)
at com.amazonaws.1.9.39.shade.services.sqs.AmazonSQSClient.listQueues(AmazonSQSClient.java:1163)
at com.amazonaws.1.9.39.shade.services.sqs.AmazonSQSClient.listQueues(AmazonSQSClient.java:1501)
at org.mule.modules.sqs.connection.strategy.SQSConnectionManagement.connect(SQSConnectionManagement.java:173)
at org.mule.modules.sqs.connectivity.SQSConnectionManagementSQSConnectorAdapter.connect(SQSConnectionManagementSQSConnectorAdapter.java:21)
at org.mule.modules.sqs.connectivity.SQSConnectionManagementSQSConnectorAdapter.connect(SQSConnectionManagementSQSConnectorAdapter.java:9)
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementConnectorFactory.makeObject(ConnectionManagementConnectorFactory.java:47)
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementConnectorFactory.makeObject(ConnectionManagementConnectorFactory.java:15)
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
at org.mule.modules.sqs.connectivity.SQSConnectorConfigConnectionManagementConnectionManager.acquireConnection(SQSConnectorConfigConnectionManagementConnectionManager.java:407)
at org.mule.modules.sqs.connectivity.SQSConnectorConfigConnectionManagementConnectionManager.acquireConnection(SQSConnectorConfigConnectionManagementConnectionManager.java:55)
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementProcessInterceptor.execute(ConnectionManagementProcessInterceptor.java:47)
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementProcessInterceptor.execute(ConnectionManagementProcessInterceptor.java:19)
at org.mule.security.oauth.process.RetryProcessInterceptor.execute(RetryProcessInterceptor.java:84)
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementProcessTemplate.execute(ConnectionManagementProcessTemplate.java:33)
at org.mule.modules.sqs.sources.ReceiveMessagesMessageSource.run(ReceiveMessagesMessageSource.java:134)
at java.lang.Thread.run(Thread.java:662)
It's true, the mule-module-sqs-3.0.0.jar downloaded by Maven doesn't contain such class. I rebuild the Amazon SQS connector's source code with little changes in the pom.xml: set <minimizeJar>false</minimizeJar> for the maven-shade-plugin. Then the missing class appeared in the jar and I managed to run the project without errors.
Not sure is it a bug or not but don't like the idea to build the connector manually. Will really appreciate if you help me to sort it out. Thanks.

Related

Jrebel is not working with weblogic 12.X

Issue Description:
Unable to bounce the weblogic server with JRebel
Error:
I am getting the follwoing error when i try to bounce the server
JRebel: ERROR Class 'java.lang.ClassLoader' could not be processed by com.zeroturnaround.javarebel.bv#null: org.zeroturnaround.bundled.javassist.bytecode.DuplicateMemberException: duplicate method: _jr$defineClass in java.lang.ClassLoader
at org.zeroturnaround.bundled.javassist.bytecode.ClassFile.testExistingMethod(SourceFile:721)
at org.zeroturnaround.bundled.javassist.bytecode.ClassFile.addMethod(SourceFile:696)
at org.zeroturnaround.bundled.javassist.CtClassType.addMethod(SourceFile:1411)
at com.zeroturnaround.javarebel.bv.process(SourceFile:40)
at org.zeroturnaround.javarebel.integration.support.JavassistClassBytecodeProcessor.process(SourceFile:79)
at com.zeroturnaround.javarebel.vu.a(SourceFile:376)
at com.zeroturnaround.javarebel.vu.a(SourceFile:365)
at com.zeroturnaround.javarebel.vu.a(SourceFile:350)
at com.zeroturnaround.javarebel.f.runBootClassProcessors(SourceFile:245)
at com.zeroturnaround.javarebel.bl.a(SourceFile:115)
at com.zeroturnaround.javarebel.gib.a(SourceFile:63)
at com.zeroturnaround.javarebel.gfc.a(SourceFile:59)
at com.zeroturnaround.javarebel.gfc.doTransform(SourceFile:39)
at com.zeroturnaround.jrebelbase.reorder.a.transform(SourceFile:182)
at com.zeroturnaround.jrebelbase.reorder.a.transform(SourceFile:148)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java)
at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method)
at sun.instrument.InstrumentationImpl.redefineClasses(InstrumentationImpl.java:170)
at com.mercury.opal.capture.jdk15.agent.ProbeClassFileTransformer.instrumentAndReplace(ProbeClassFileTransformer.java:369)
at com.mercury.opal.capture.jdk15.agent.ProbeClassFileTransformer.reinstrumentClass(ProbeClassFileTransformer.java:331)
at com.mercury.opal.capture.jdk15.agent.ProbeClassFileTransformer.patchClassLoaders(ProbeClassFileTransformer.java:137)
at com.mercury.opal.capture.jdk15.agent.ProbeClassFileTransformer.<init>(ProbeClassFileTransformer.java:98)
at com.mercury.opal.capture.jdk15.agent.InstrumentationAgent.premain(InstrumentationAgent.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at java.lang.reflect.Method.invoke(Method.java:483)
at sun.instrument.InstrumentationImpl._jrLoadClassAndStartAgent(InstrumentationImpl.java:386)
at com.zeroturnaround.jrebelbase.reorder.b.a(SourceFile:31)
at com.zeroturnaround.jrebelbase.reorder.a.c(SourceFile:129)
at com.zeroturnaround.jrebelbase.reorder.a.a(SourceFile:118)
at com.zeroturnaround.javarebel.gec.a(SourceFile:309)
at com.zeroturnaround.javarebel.gec.deferredInitHook(SourceFile:149)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java)
Config Details :
following lines in startup script based on the Jrebel root folder
export REBEL_HOME=[JRebel root folder]
export JAVA_OPTIONS="-agentpath:$REBEL_HOME/lib/libjrebel64.so -Drebel.remoting_plugin=true $JAVA_OPTIONS"
Version:
Weblogic : 12.2.1.2.0
Jrebel : 7.1.2
Can anyone help me to come over?
Please try using the latest version of JRebel instead of 7.1.2. Download it at https://zeroturnaround.com/software/jrebel/download/prev-releases/.
If for some reason the result is still the same, also delete REBEL_HOME/bootcache and retry. Should you still see the exception, please write to support#zeroturnaround.com along with the jrebel.log from REBEL_HOME and they'll be able to help you out.

SerializationComponentRegistrar is not compatible with this version of compiler

I am getting this error inside AS - even though I tripple checked to pick a valid version pairing (kotlin 1.2.40 with serialisation 0.5.0):
Error:Kotlin: [Internal Error] java.lang.IllegalStateException: The provided plugin org.jetbrains.kotlinx.serialization.compiler.extensions.SerializationComponentRegistrar is not compatible with this version of compiler
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:186)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:119)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:418)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:265)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:154)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:63)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:107)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:51)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:96)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$$inlined$ifAlive$lambda$1.invoke(CompileServiceImpl.kt:399)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$$inlined$ifAlive$lambda$1.invoke(CompileServiceImpl.kt:98)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:920)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:98)
at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:950)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:919)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:397)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:361)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
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: java.lang.AbstractMethodError: org.jetbrains.kotlinx.serialization.compiler.extensions.SerializationComponentRegistrar.registerProjectComponents(Lcom/intellij/mock/MockProject;Lorg/jetbrains/kotlin/config/CompilerConfiguration;)V
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:184)
... 33 more
Check your installed Kotlin plugin in the idea(Tools>Kotlin>Configure Kotlin Plugin Updates). Must be same as in your build.gradle file.
There's an IntelliJ / Android Studio plugin that's made just for the Kotlin Serialization support, separate from the main Kotlin plugin. From the Working in IntelliJ IDEA section of the readme:
Because serialization is still highly experimental, it is shipped as a separate artifact from "big" Kotlin IDEA plugin. You can download additional IDEA plugin for working with projects that uses serialization from its TeamCity build page
It provides links to the latest TeamCity builds for this plugin, including this one for Kotlin 1.2.40.
Since they only currently publish this plugin through TeamCity, you would have to install it manually by going to Preferences > Plugins > Install plugin from disk...
For anyone using IntelliJ instead of Android Studio, if the plugin doesn't solve the problem, the same readme says to:
try to use gradle for running builds: Settings - Build, Execution, Deployment - Build Tools - Gradle - Runner - tick Delegate IDE build/run actions to gradle; or launch builds from console.
There's an open ticket on Github about this error message, and it might also be worth keeping an eye on that.

IntelliJ Fails Deploying exploded war to tomcat

I have a Java web application I am developing in IntelliJ and deploying using Apache Tomcat. I have some run configurations defined that are shared between everyone on the team. These run configurations are defined to deploy an exploded war artifact into a local tomcat. Other team members are able to deploy and run just fine, but I get the following error:
Artifact Gradle : project : project.war (exploded): Error during artifact deployment. See server log for details.
Artifact Gradle : project : project.war (exploded): com.intellij.javaee.oss.admin.jmx.JmxAdminException: com.intellij.execution.ExecutionException: /IdeaProjects/project/build/libs/exploded/project.war not found for the web module.
It seems that IntelliJ doesn't want to create the exploded/project.war directories. If I create those directories manually I don't get that error message, but none of the WAR contents get placed into the directory.
I thought that it could be a permission error so I even tried giving my project directory 777 just to try to eliminate possible problems.
Has anyone ever run into this problem?
I am running MacOS 10.12, and have been able to deploy in the past, but this problem just started.
Thanks
Update
The IntelliJ log doesn't really show any additional errors, just the full StackTrace for the errors above.
2017-11-02 11:20:52,896 [3777157] INFO - erver.JavaeeServerInstanceImpl - com.intellij.execution.ExecutionException: <redacted>/build/libs/exploded/myproject.war not found for the web module.
com.intellij.javaee.oss.admin.jmx.JmxAdminException: com.intellij.execution.ExecutionException: <redacted>/build/libs/exploded/myproject.war not found for the web module.
at org.jetbrains.idea.tomcat.admin.TomcatAdminLocalServerImpl$DeployStep.perform(TomcatAdminLocalServerImpl.java:277)
at org.jetbrains.idea.tomcat.admin.TomcatAdminLocalServerImpl.doDeploy(TomcatAdminLocalServerImpl.java:125)
at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase$4.doPerform(JavaeeJmxAdminServerBase.java:120)
at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase$JmxOperation.perform(JavaeeJmxAdminServerBase.java:243)
at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase.doStartDeploy(JavaeeJmxAdminServerBase.java:135)
at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase$2.setDeploymentStatus(JavaeeJmxAdminServerBase.java:90)
at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase$DeploymentModelOperation.doSetDeploymentStatus(JavaeeJmxAdminServerBase.java:270)
at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase$3.doPerform(JavaeeJmxAdminServerBase.java:100)
at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase$JmxOperation.perform(JavaeeJmxAdminServerBase.java:243)
at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase.doStartDeployWithUndeploy(JavaeeJmxAdminServerBase.java:107)
at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase.startDeploy(JavaeeJmxAdminServerBase.java:74)
at org.jetbrains.idea.tomcat.admin.TomcatAdminServerBase.startDeploy(TomcatAdminServerBase.java:115)
at org.jetbrains.idea.tomcat.admin.TomcatAdminLocalServerImpl.startDeploy(TomcatAdminLocalServerImpl.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.remoteServer.agent.impl.ThreadInvocationHandler.a(ThreadInvocationHandler.java:56)
at com.intellij.remoteServer.agent.impl.ThreadInvocationHandler.a(ThreadInvocationHandler.java:100)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:212)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.intellij.execution.ExecutionException: <redacted>/build/libs/exploded/myproject.war not found for the web module.
at org.jetbrains.idea.tomcat.admin.TomcatAdminLocalServerImpl.addApplicationContext(TomcatAdminLocalServerImpl.java:217)
at org.jetbrains.idea.tomcat.admin.TomcatAdminLocalServerImpl$4.doPerform(TomcatAdminLocalServerImpl.java:121)
at org.jetbrains.idea.tomcat.admin.TomcatAdminLocalServerImpl$DeployStep.perform(TomcatAdminLocalServerImpl.java:274)
... 24 more
Before Intellij 2019.2 :
Under Gradle Settings, you have to make sure you don't have checked 'Delegate IDE build/run actions to gradle'
Since Intellij 2019.2 :
Settings is now under 'Build, Execution, Deployment > Build Tools > Gradle'.
You have to select Build and run using : Intellij IDEA
An issue has been opened on jetbrains bug tracker.

"mfp push" throws NullPointerException while deploying adapter (MobileFirst Platform 7.1)

using MobileFirst Platform CLI version 7.1.0.00.20151227-1730 I have suddenly the following error when trying to push an update I made to an adapter:
Preparing for push...
Verifying Server Configuration...
Runtime 'localMFP' will be used to push the project into.
[Error:
BUILD FAILED
/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml:497: com.worklight.upgrader.UpgradeEngineException: java.lang.NullPointerException
at com.worklight.upgrader.WLUpgradeEngine.<init>(WLUpgradeEngine.java:142)
at com.worklight.upgrader.WLUpgradeEngine.<init>(WLUpgradeEngine.java:147)
at com.worklight.upgrader.ant.UpgraderTask.execute(UpgraderTask.java:100)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.NullPointerException
at java.text.MessageFormat.applyPattern(MessageFormat.java:436)
at java.text.MessageFormat.<init>(MessageFormat.java:362)
at java.text.MessageFormat.format(MessageFormat.java:840)
at com.worklight.upgrader.WLUpgradeEngine.findProjectVersion(WLUpgradeEngine.java:602)
at com.worklight.upgrader.WLUpgradeEngine.<init>(WLUpgradeEngine.java:133)
... 18 more
Total time: 3 seconds
]
Error: Sorry an error has occurred. Please check the stack above for details.
I have tried to cleanup the project, remove what was already deployed, revert my changes to what I had when I succeeded to deploy, re-install mfp cli, but I still have the issue.
Any hint on what I could do to get rid of the exception?
Thanks!
The failure is coming from the upgrader code path, as if something is missing in the adapter files.
My suggestion is to create a new adapter and see that it gets deployed. Then, start adding back code. Maybe you will find the failing part.

log4j-jul-2.1 and Glassfish 3.1.2 usage

I am trying to redirect Java Util Logging logs to Log4j 2.1 using the birdge provided log4j-jul-2.1, but stuck with classpath problems. I have all the log4j jars in the domains lib directory and used the following JVM parameter as mentioned in log4j documentation:
-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
The problem is that the bridge LogManager provided by log4j is not available in Glassfish AppClassLoader during startup and it causes the exception below. I can fix that by modifying server main classpath (provided by -cp argument), but this is bad. Is there any other/better looking way to achieve that? Simply putting it into server main lib directory does not also work as its again not AppClassLoader.
Could not load Logmanager "org.apache.logging.log4j.jul.LogManager"
java.lang.ClassNotFoundException: org.apache.logging.log4j.jul.LogManager
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.util.logging.LogManager$1.run(LogManager.java:167)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:157)
at java.util.logging.Logger.getLogger(Logger.java:287)
at com.sun.enterprise.glassfish.bootstrap.ASMainHelper.<clinit>(ASMainHelper.java:67)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
I finally decided to use SLF4J and its SLF4JBridgeHandler for handling Java Util Logging calls. The main benefit of it is that it can be initialized at some later point when all the classes are loaded and after all required static initializations.
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
I also switched to Logback as a backend as with this solution Log4j encounters performance problems for disable JUL loggers.