question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Manifest version parsing is not working in Wildfly

See original GitHub issue

Manifest version resolution introduced in elastic/apm-agent-java#558 does not work in Widlfly. The jarUrl.getFile() returns file:/home/wildfly-9.0.2.Final/modules/system/layers/base/org/apache/httpcomponents/main/httpclient-4.3.6.jar!/ The path contains an exclamation mark, probably because the full URL is jar:file:/home/wildfly-9.0.2.Final/modules/system/layers/base/org/apache/httpcomponents/main/httpclient-4.3.6.jar!/, i.e. includes the jar: protocol. This breaks the JarFile creation.

Stack Trace
co.elastic.apm.agent.bci.bytebuddy.CustomElementMatchers - Cannot read implementation version based on ProtectionDomain ProtectionDomain (jar:file:/home/wildfly-9.0.2.Final/modules/system/layers/base/org/apache/httpcomponents/main/httpclient-4.3.6.jar!/ <no signer certificates>)
null
<no principals>
java.security.Permissions@4994c74d (
("java.security.AllPermission" "<all permissions>" "<all actions>")
)

java.io.FileNotFoundException: file:/home/wildfly-9.0.2.Final/modules/system/layers/base/org/apache/httpcomponents/main/httpclient-4.3.6.jar! (No such file or directory)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:225)
at java.util.zip.ZipFile.<init>(ZipFile.java:155)
at java.util.jar.JarFile.<init>(JarFile.java:166)
at java.util.jar.JarFile.<init>(JarFile.java:103)
at co.elastic.apm.agent.bci.bytebuddy.CustomElementMatchers.readImplementationVersionFromManifest(CustomElementMatchers.java:144)
at co.elastic.apm.agent.bci.bytebuddy.CustomElementMatchers.access$100(CustomElementMatchers.java:42)
at co.elastic.apm.agent.bci.bytebuddy.CustomElementMatchers$2.matches(CustomElementMatchers.java:126)
at co.elastic.apm.agent.bci.bytebuddy.CustomElementMatchers$2.matches(CustomElementMatchers.java:123)
at co.elastic.apm.agent.bci.ElasticApmAgent$4.matches(ElasticApmAgent.java:187)
at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$Transformation$Simple.matches(AgentBuilder.java:9983)
at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$Transformation$Simple.resolve(AgentBuilder.java:9996)
at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$Transformation$Compound.resolve(AgentBuilder.java:10252)
at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.resolve(AgentBuilder.java:10584)
at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doTransform(AgentBuilder.java:10551)
at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:10514)
at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.access$1500(AgentBuilder.java:10280)
at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:10889)
at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:10836)
at java.security.AccessController.doPrivileged(Native Method)
at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:10437)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:353)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:432)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:269)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77)
at org.jboss.modules.Module.loadModuleClass(Module.java:560)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)
at org.apache.http.impl.client.AbstractHttpClient.getRedirectStrategy(AbstractHttpClient.java:575)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:810)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:283)
at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:436)
at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:102)
at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:76)
at com.sun.proxy.$Proxy294.get(Unknown Source)
e.t.c...

Environment Wildfly 9.0.2.Final with provided httpclient 4.3.6

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
eyalkorencommented, Apr 22, 2019
0reactions
mdindoffercommented, Apr 23, 2019

@eyalkoren Yep, your fix works. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to get manifest for deployment Jboss-eap-6.2 server
I am new to jboss EAP server.I was trying to deploy my war file in jboss-eap-6.2 server (Same war file successfully deployed in...
Read more >
Developer Guide - WildFly Documentation
There are two ways to do this, either using the MANIFEST. MF or using jboss-deployment-structure. xml . Using MANIFEST.
Read more >
xi:include in xml file within jar file does not work in WildFly
It depends on your XML parser. As per your exception it seems you use SAX.
Read more >
Upgraded to wildfly-24.0.0.Final & deployed EAR with this error
The root cause of your problem is that your application is trying to use the WF24 version of the org.jboss.as.web.common module with an...
Read more >
Red Hat JBoss Enterprise Application Platform 7.4 Migration ...
This guide provides information about how to migrate your application from previous versions of. Red Hat JBoss Enterprise Application Platform. Page 5 ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found