Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discover Datasonnet libraries at build time #6425

Closed
jamesnetherton opened this issue Sep 5, 2024 · 2 comments
Closed

Discover Datasonnet libraries at build time #6425

jamesnetherton opened this issue Sep 5, 2024 · 2 comments
Assignees
Labels
area/datasonnet enhancement New feature or request
Milestone

Comments

@jamesnetherton
Copy link
Contributor

Bug description

There have been some changes to QuarkusClassLoader which classgraph QuarkusClassLoaderHandler is not ready for.

It attempts to do reflection on a field that no longer exists:

https://github.com/classgraph/classgraph/blob/688313894de1f65bb46af551babaee8cdf01294a/src/main/java/nonapi/io/github/classgraph/classloaderhandler/QuarkusClassLoaderHandler.java#L120-L121

Which results in:

Caused by: java.lang.RuntimeException: Exception while calling findClassLoaderOrder for nonapi.io.github.classgraph.classloaderhandler.QuarkusClassLoaderHandler
	at nonapi.io.github.classgraph.classloaderhandler.ClassLoaderHandlerRegistry$ClassLoaderHandlerRegistryEntry.findClasspathOrder(ClassLoaderHandlerRegistry.java:239)
	at nonapi.io.github.classgraph.classpath.ClasspathFinder.<init>(ClasspathFinder.java:277)
	at io.github.classgraph.Scanner.<init>(Scanner.java:170)
	at io.github.classgraph.ClassGraph.scanAsync(ClassGraph.java:1562)
	at io.github.classgraph.ClassGraph.scanAsync(ClassGraph.java:1590)
	at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1615)
	at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1654)
	at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1667)
	at org.apache.camel.language.datasonnet.DatasonnetLanguage.<clinit>(DatasonnetLanguage.java:46)
	... 14 more
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at nonapi.io.github.classgraph.classloaderhandler.ClassLoaderHandlerRegistry$ClassLoaderHandlerRegistryEntry.findClasspathOrder(ClassLoaderHandlerRegistry.java:236)
	... 22 more
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.Collection.iterator()" because the return value of "nonapi.io.github.classgraph.reflection.ReflectionUtils.getFieldVal(boolean, Object, String)" is null
	at nonapi.io.github.classgraph.classloaderhandler.QuarkusClassLoaderHandler.findClasspathOrderForQuarkusClassloader(QuarkusClassLoaderHandler.java:120)
	at nonapi.io.github.classgraph.classloaderhandler.QuarkusClassLoaderHandler.findClasspathOrder(QuarkusClassLoaderHandler.java:111)
	... 24 more
@jamesnetherton
Copy link
Contributor Author

We can probably replace the classgraph stuff and use Camel's own package resource scanning APIs. I'll check.

@jamesnetherton jamesnetherton self-assigned this Sep 5, 2024
@jamesnetherton
Copy link
Contributor Author

We can actually avoid classgraph and discover libsonnet bits at build time. Needs:

https://issues.apache.org/jira/browse/CAMEL-21177

@jamesnetherton jamesnetherton changed the title [quarkus-main] Startup fails when the Datasonnet extension is on the classpath Discover Datasonnet libraries at build time Sep 16, 2024
@jamesnetherton jamesnetherton added enhancement New feature or request and removed bug Something isn't working labels Sep 16, 2024
jamesnetherton added a commit to jamesnetherton/camel-quarkus that referenced this issue Sep 16, 2024
@github-actions github-actions bot added this to the 3.15.0 milestone Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/datasonnet enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant