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

Comments

Projects
None yet
4 participants
@dmvolod
Copy link
Contributor

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 bug label Sep 13, 2018

@nicolaferraro

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2018

Same here. @lburgazzoli wdyt?

@lburgazzoli

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

commented Sep 13, 2018

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

@lburgazzoli

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2018

This seems to be fixed.

@nicolaferraro

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2018

Still happening...

@lburgazzoli lburgazzoli self-assigned this Sep 13, 2018

@lburgazzoli

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2018

on it

lburgazzoli added a commit to lburgazzoli/apache-camel-k that referenced this issue Sep 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.