Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Could not initialize class co.elastic.apm.mule4.agent.ApmHandler #16

Closed
GoBenGoh opened this issue Nov 29, 2021 · 4 comments
Closed

Could not initialize class co.elastic.apm.mule4.agent.ApmHandler #16

GoBenGoh opened this issue Nov 29, 2021 · 4 comments

Comments

@GoBenGoh
Copy link

image
I've managed to get a build success when installing the agent and my mule app is working correctly but I get this error. Is there something wrong with my dependencies?
image

@GoBenGoh
Copy link
Author

Full line:
INFO 2021-11-29 14:37:55,847 [[MuleRuntime].uber.03: [diy1-1].usernameFlow.CPU_LITE @6ba55b6f] [processor: usernameFlow/processors/3; event: f9b8dca0-50b4-11ec-a5d1-dc1ba166b542] org.mule.runtime.core.internal.context.notification.Policy: NotificationListener co.elastic.apm.mule4.agent.ApmMessageProcessorNotificationListener$$EnhancerByCGLIB$$d5037dd4@3eb86072 was unable to fire notification MessageProcessorNotification{action=message processor post invoke, processor=usernameFlow/processors/3, resourceId=usernameFlow, serverId=DESKTOP-4D106F7..diy1-1, timestamp=1638149875847} due to an exception: java.lang.NoClassDefFoundError: Could not initialize class co.elastic.apm.mule4.agent.ApmHandler.

@michaelhyatt
Copy link
Owner

@GoBenGoh can you please try without the apm-agent-attach dependency? The agent should include all the needed dependencies. Check out the examples directory for pom.xml file configs. You can also download the jars from the releases, so you don't have to build them yourself.

@GoBenGoh
Copy link
Author

GoBenGoh commented Dec 1, 2021

apm-agent-attach dependency is required otherwise my app fails to deploy (Cannot load class 'co.elastic.apm.attach.ElasticApmAttacher').
I downloaded the release jar (0.4.0) and ran the command filling out the path to jar and version as per the instructions
image

@GoBenGoh
Copy link
Author

GoBenGoh commented Dec 1, 2021

Actually the guy from this thread fixed it: #13

I needed to add this to my pom
<dependency>
<groupId>co.elastic.apm</groupId>
<artifactId>apm-agent-api</artifactId>
<version>1.21.0</version>
</dependency>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants