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

[Serialization] transferException URI option does not work in native mode #1868

Closed
jamesnetherton opened this issue Oct 2, 2020 · 5 comments
Assignees
Milestone

Comments

@jamesnetherton
Copy link
Contributor

transferException uses object serialization / deserialization which is currently not supported by GraalVM.

We should add some documentation to the affected extensions:

  • activemq
  • ahc
  • ahc-ws
  • ahc-wss
  • amqp
  • http
  • https
  • jms
  • netty-http
  • rabbitmq
  • servlet
  • vertx-http
@jamesnetherton jamesnetherton added the documentation Improvements or additions to documentation label Oct 2, 2020
@jamesnetherton jamesnetherton added this to the 1.2.0 milestone Oct 2, 2020
@jamesnetherton jamesnetherton self-assigned this Oct 2, 2020
@ppalaga
Copy link
Contributor

ppalaga commented Oct 2, 2020

Could you please explain where that serialization happens? If it in Camel, we could perhaps implement a workaround?

@jamesnetherton
Copy link
Contributor Author

Yes, it's in the various Camel components. E.g like here:

https://github.com/apache/camel/blob/master/components/camel-http-common/src/main/java/org/apache/camel/http/common/DefaultHttpBinding.java#L205-L210

And here:

https://github.com/apache/camel/blob/master/components/camel-http-common/src/main/java/org/apache/camel/http/common/DefaultHttpBinding.java#L383

I forget there's also the allowJavaSerializedObject which has the same issue. But it's not enabled by default since it can be a security risk.

@jamesnetherton jamesnetherton removed this from the 1.2.0 milestone Oct 6, 2020
@ppalaga ppalaga changed the title transferException URI option does not work in native mode [Serialization] transferException URI option does not work in native mode May 26, 2021
@jamesnetherton jamesnetherton added this to the 2.1.0 milestone Jul 7, 2021
@jamesnetherton
Copy link
Contributor Author

I spent some time trying to enable serialization support for transferException. There might be a GraalVM bug that is stopping deserialization of exceptions from working.

I've configured the relevant classes for serialization but deserializing an exception always results in:

Exception in thread "main" java.lang.ClassNotFoundException: [Ljava.lang.StackTraceElement;
	at com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSupport.java:71)
	at java.lang.Class.forName(DynamicHub.java:1319)
	at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:756)
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1995)
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1862)
	at java.io.ObjectInputStream.readArray(ObjectInputStream.java:2057)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1667)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2464)
	at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:629)
	at java.lang.Throwable.readObject(Throwable.java:896)
	at java.lang.reflect.Method.invoke(Method.java:566)
	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1175)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2325)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2196)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1679)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:493)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:451)

I tried with a basic test app without Camel or Quarkus and got the same result.

@ppalaga
Copy link
Contributor

ppalaga commented Jul 22, 2021

[Ljava.lang.StackTraceElement is array of java.lang.StackTraceElement - maybe array types need some special registration or they are not supported yet?

@jamesnetherton
Copy link
Contributor Author

I got a bit further by registering some additional classes for reflection. But now stuck at:

java.io.InvalidClassException: java.util.Collections$EmptyList; no valid constructor
	at java.io.ObjectStreamClass$ExceptionInfo.newInvalidClassException(ObjectStreamClass.java:159)
	at java.io.ObjectStreamClass.checkDeserialize(ObjectStreamClass.java:875)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2170)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1679)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2464)
	at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:629)
	at java.lang.Throwable.readObject(Throwable.java:896)

I'll dig into it some more...

jamesnetherton added a commit to jamesnetherton/camel-quarkus that referenced this issue Jul 23, 2021
@zbendhiba zbendhiba modified the milestones: 2.1.0, 2.2.0 Jul 23, 2021
@jamesnetherton jamesnetherton removed the documentation Improvements or additions to documentation label Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants