Skip to content

ap-loader-all in maven not the same as the released  #7

Open
@maxandersen

Description

@maxandersen

I've been trying to use ap-loader-* artifacts from maven but afaics the released jar's from github release page and the maven central jars are NOT the same.

Resulting in this error using the maven jars:

run: /Users/manderse/.jbang/cache/jdks/19/bin/java '-javaagent:/Users/manderse/.m2/repository/me/bechberger/ap-loader-macos/2.9-4/ap-loader-macos-2.9-4.jar=start,event=cpu,file=profile.html' --enable-preview --add-opens java.base/java.lang=ALL-UNNAMED -classpath /Users/manderse/.jbang/cache/jars/VirtualThreadReflectionBenchmark.java.7d632a1c2e33734f11f5a17bf40fd430f897bd02269d088fa6ed26853056da8b.jar:/Users/manderse/.m2/repository/org/openjdk/jmh/jmh-generator-annprocess/1.36/jmh-generator-annprocess-1.36.jar:/Users/manderse/.m2/repository/org/openjdk/jmh/jmh-core/1.36/jmh-core-1.36.jar:/Users/manderse/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/manderse/.m2/repository/org/apache/commons/commons-math3/3.2/commons-math3-3.2.jar org.openjdk.jmh.Main
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:491)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:503)
Caused by: java.lang.NoClassDefFoundError: dev/dirs/ProjectDirectories
	at one.profiler.AsyncProfilerLoader.getExtractionDirectory(AsyncProfilerLoader.java:128)
	at one.profiler.AsyncProfilerLoader.getAsyncProfilerPath(AsyncProfilerLoader.java:345)
	at one.profiler.AsyncProfilerLoader.attach(AsyncProfilerLoader.java:613)
	at one.profiler.AsyncProfilerLoader.agentmain(AsyncProfilerLoader.java:625)
	at one.profiler.AsyncProfilerLoader.premain(AsyncProfilerLoader.java:586)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	... 3 more
Caused by: java.lang.ClassNotFoundException: dev.dirs.ProjectDirectories
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 9 more
*** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed

Using the downloaded jar works fine so I tried to compare them and notice that the released jars has dev/dirs embedded but the ones in maven central does not.

2023-02-14_11-37-27

There is also native image config missing and the manifest.mf is slightly different:

2023-02-14_11-38-14

Is there a reason for this difference?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions