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

Sql aggregator does not work in native mode, solve DefaultExchangeHolder globally. #2693

Closed
JiriOndrusek opened this issue May 31, 2021 · 1 comment · Fixed by #2748
Closed
Assignees
Milestone

Comments

@JiriOndrusek
Copy link
Contributor

JiriOndrusek commented May 31, 2021

During fixation of #2623, I found an issue with sql aggregator in native mode.

Firstly, simple Caused by: java.lang.ClassNotFoundException: org.apache.camel.support.DefaultExchangeHolder is thrown.
Fix (by addition of ReflectiveClassBuildItem) uncovers more serious issue. Problem is happening during serialization/deserialization of DefaultExchangeHolder.

Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: The offset of private java.lang.Exception org.apache.camel.support.DefaultExchangeHolder.exception is accessed without the field being first registered as unsafe accessed. Please register the field as unsafe accessed. You can do so with a reflection configuration that contains an entry for the field with the attribute "allowUnsafeAccess": true. Such a configuration file can be generated for you. Read BuildConfiguration.md and Reflection.md for details.
	at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:87)
	at jdk.internal.misc.Unsafe.objectFieldOffset(Unsafe.java:50)
	at java.io.ObjectStreamClass$FieldReflector.<init>(ObjectStreamClass.java:2002)
	at java.io.ObjectStreamClass.getReflector(ObjectStreamClass.java:2266)
	at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:534)
	at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:381)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1135)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:349)
	at org.apache.camel.processor.aggregate.jdbc.JdbcCamelCodec.encode(JdbcCamelCodec.java:98)

I've tried suggested solution and I've also tried to register class for serialization (using native approach oracle/graal#2730), but it didn't help.


Problem is solvable with native serialization. But for such a solution it would be nice to register DefaultExchangeHolder and linked types in some core module.

@JiriOndrusek
Copy link
Contributor Author

Enable test from #2694, which is covering this issue.

@JiriOndrusek JiriOndrusek self-assigned this May 31, 2021
@ppalaga ppalaga added this to the 2.0.0 milestone May 31, 2021
JiriOndrusek added a commit to JiriOndrusek/camel-quarkus that referenced this issue Jun 2, 2021
@JiriOndrusek JiriOndrusek changed the title Sql aggregator does not work in native mode Sql aggregator does not work in native mode, solve DefaultExchangeHolder globally. Jun 3, 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

Successfully merging a pull request may close this issue.

2 participants