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

setObject on ObjectMessage hangs when running in GraalVM #10

Open
chughts opened this issue Jan 14, 2021 · 6 comments
Open

setObject on ObjectMessage hangs when running in GraalVM #10

chughts opened this issue Jan 14, 2021 · 6 comments

Comments

@chughts
Copy link

chughts commented Jan 14, 2021

I have code that creates and puts in turn TextMessage, BytesMessage, StreamMessage, ObjectMessage and MapMessage onto queues. It works when running under standard Quarkus, but when the code is compiled and run as a GraalVM executable it hangs, with no timeout on

setObject

code just enough to recreate:

import javax.jms.ConnectionFactory;
import javax.jms.JMSContext;
import javax.jms.ObjectMessage;

@Inject
ConnectionFactory factory;

JMSContext context = factory.createContext(JMSContext.AUTO_ACKNOWLEDGE);
ObjectMessage om = context.createObjectMessage();

try {
    String d = new String("ObjectMessage");
    om.setObject(d);
} catch (JMSException e) {
        ...
}
@chughts chughts changed the title createObjectMessage hangs when running in GraalVM setObject on ObjectMessage hangs when running in GraalVM Jan 14, 2021
@gemmellr
Copy link
Collaborator

I don't see it hang, but throw, coming directly from GraalVM being unable to do the needed ObjectOutputStream.writeObject() serialization operation:

Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: ObjectOutputStream.writeObject()
        at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:87)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:68)
        ...
        at org.apache.qpid.jms.message.JmsObjectMessage.setObject(JmsObjectMessage.java:47)

This is confirmed by oracle/graal#460, though that does now indicate support is coming in GraalVM 21.0.0 via oracle/graal#2730

@chughts
Copy link
Author

chughts commented Jan 14, 2021

I am currently on
LLVM (GraalVM CE Native 20.2.0)
Running on a Mac (Catalina)

I am not getting the exception, only a hang.

@gemmellr
Copy link
Collaborator

I was using GraalVM CE 20.3.0 and my own reproducer. Note that it isn't an [JMS]Exception that is thrown but an Error. The above code example wont catch it.

@chughts
Copy link
Author

chughts commented Jan 14, 2021

You are right. Adding a catch(Error e), shows up the thrown error.

I was expecting anything I didn't catch to bubble up through the Quarkus code and show up in the logs.

@cescoffier
Copy link
Contributor

Serialization has been added into GraalVM. Worth rechecking with a recent version.
If you use "custom" objects, make sure they are annotated with @RegisterForReflection

@chughts
Copy link
Author

chughts commented May 30, 2022

I will give it a go.

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