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

kamel run runtime/examples/Sample.java fails with java.lang.NoClassDefFoundError #57

Closed
dmvolod opened this issue Sep 12, 2018 · 7 comments
Assignees
Labels
kind/bug Something isn't working

Comments

@dmvolod
Copy link
Member

dmvolod commented Sep 12, 2018

Exception in thread "main" org.joor.ReflectException: java.lang.reflect.InvocationTargetException

  | at org.joor.Reflect.on(Reflect.java:781)
  | at org.joor.Reflect.call(Reflect.java:463)
  | at org.joor.Compile.compile(Compile.java:73)
  | at org.joor.Reflect.compile(Reflect.java:77)
  | at org.apache.camel.k.jvm.RoutesLoaders$2.load(RoutesLoaders.java:90)
  | at org.apache.camel.k.jvm.Application.main(Application.java:34)
  | Caused by: java.lang.reflect.InvocationTargetException
  | 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 org.joor.Reflect.on(Reflect.java:777)
  | ... 5 more
  | Caused by: java.lang.NoClassDefFoundError: etc/camel/Sample (wrong name: Sample)
  | at java.lang.ClassLoader.defineClass1(Native Method)
  | at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
  | at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
  | ... 10 more

@nicolaferraro nicolaferraro added the kind/bug Something isn't working label Sep 13, 2018
@nicolaferraro
Copy link
Member

Same here. @lburgazzoli wdyt?

@lburgazzoli
Copy link
Contributor

lburgazzoli commented Sep 13, 2018

I need to check how the things are defined now that we use a configmap, can you try to set the class package as etc.camel ?

@dmvolod
Copy link
Member Author

dmvolod commented Sep 13, 2018

@lburgazzoli I tried with package and it's working fine, but don't know why this default package?

@lburgazzoli
Copy link
Contributor

lburgazzoli commented Sep 13, 2018

It is because I've changed how the integration is given to the runtime images: before it was included as a resource, now it is on the file system and the class name is computed from the path, I need to re-think how this is computed, maybe using an env var to tell the image the base path for integrations.

Here is the culprit: https://github.com/apache/camel-k/blob/master/runtime/jvm/src/main/java/org/apache/camel/k/jvm/RoutesLoaders.java#L85-L90

@oscerd
Copy link
Contributor

oscerd commented Sep 13, 2018

This seems to be fixed.

@nicolaferraro
Copy link
Member

Still happening...

@lburgazzoli lburgazzoli self-assigned this Sep 13, 2018
@lburgazzoli
Copy link
Contributor

on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants