Websockets with Quarkus 2 and MyFaces - jsf

After upgrading Quarkus from 1.x to 2.x it is no longer possible to use websocket with Apache MyFaces (2.3-next-M6).
The browser-console shows an error like
jsf.js.xhtml?ln=javax.faces:1 WebSocket connection to 'wss://some.url/javax.faces.push/some_channel?c12dbb48ce8b67f89f550dc9d32451bd' failed
Quarkus startup-log shows the message
(Quarkus Main Thread) f:websocket support enabled but cannot found websocket ServerContainer instance on current context.
Any ideas how to get websockets working with Quarkus2 and MyFaces?

Related

Vertx cluster member connection breaks on hazelcast uuid reset

I am working on a project that is composed of multiple vertx micro services where each service runs on different containers in Openshift platform. Eventbus is used for communication between services.
Sometime when a request is made via eventbus there is no response and failing with below errors
[vert.x-eventloop-thread-2] DEBUG io.vertx.core.eventbus.impl.clustered.ConnectionHolder - tx.id=ea60ebe0-1d81-4041-80d5-79cbe1d2a11c Not connected to server
[vert.x-eventloop-thread-2] WARN io.vertx.core.eventbus.impl.clustered.ConnectionHolder - tx.id=97441ebe-8ce9-42b2-996d-35455a5b32f2 Connecting to server 65c9ab20-43f8-4c59-8455-ecca376b71ac failed
Whenever this happen I can see the below error in the destination server to which above request was made
message=WARNING: [192.168.33.42]:5701 [cdart] [5.0.3] Resetting local member UUID. Previous: 65c9ab20-43f8-4c59-8455-ecca376b71ac, new: 8dd74cdf-e4c4-443f-a38e-3f6c36721795
Could this be due to reset event raised by Hazelcast is not handled in Vertx?
Vertx 4.3.5 version is used in this project.
This is a known issue that will be fixed in the forthcoming 4.4 release.

enableTransaction not working with J2ee Container

I get below error when I consume message in a Jboss ejb container
2022-05-18 22:37:24,699 ERROR [org.jboss.resource.adapter.jms.inflow.JmsActivation] Unable to reconnect org.jboss.resource.adapter.jms.inflow.JmsActivationSpec#8315a9(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter#10a62f0 destination=queues/Subscriber.global.globalvirtual.e2e.cmdm.changepub.Virtual destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/ACTIVEMQJMSNONXAProviderAsync user=ldcp.cmdm pass= )
javax.jms.JMSException: Please enable transactions on PulsarConnectionFactory with enableTransaction=true
After getting this error - I set enableTransaction=true and started getting different error
javax.jms.JMSException: not supported
at com.datastax.oss.pulsar.jms.PulsarConnection.createConnectionConsumer(PulsarConnection.java:685)
the error is in createConnectionConsumer.
This is the method called by the JBoss container.
This method is currently not implemented
https://github.com/datastax/pulsar-jms/blob/96606d0f22a1af8fdde0c5eff0f5dde086d9862c/pulsar-jms/src/main/java/com/datastax/oss/pulsar/jms/PulsarConnection.java#L685
the implementation should be quite straighforward.
There are integration tests for Payara and Apache TomEE but JBoss is still not covered.
Please open an issue on github.

Is there anyway to connect Node.js with JBOSS 6.2 using STOMP protocol?

I would like to know if it is possible to connect Node.js (using stompjs via npm) with JBoss EAP 6.2 using the STOMP protocol. I'm trying and I don't see how to do it.
This is my code:
console.log('STOMP: Attempting connection');
stompClient = stomp.overWS(127.0.0.1:4447);
stompClient.connect(
serviceStompConfig.login,
serviceStompConfig.passcode,
_stompSuccessCallback,
_stompFailureCallback
);
I do not receive any errors. In the console I see the message "STOMP: Attempting connection" and that's it. The callback error function is not even executed.

DataStax Java driver 2.0.0-beta2 with Cassandra 1.2.1: unsupported protocol version

I'm wondering if com.datastax.cassandra:cassandra-driver-core:2.0.0-beta2 can be used with org.apache.cassandra:cassandra-all:1.2.1. I'm using cassandra-maven-plugin:1.2.1-1 (which uses org.apache.cassandra:cassandra-all:1.2.1), adding
start_native_transport: true
native_transport_port: ${cassandra.nativePort}
to the yaml plugin property. I can telnet to the port successfully.
However, when I attempt to connect via the following code,
// Ports.NATIVE has the same value as "${cassandra.nativePort}" above
Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1")
.withPort(Ports.NATIVE).build();
Session session = cluster.connect();
I get the following exception:
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1 (com.datastax.driver.core.ConnectionException: [/127.0.0.1] Unexpected error during transport initialization (com.datastax.driver.core.TransportException: [/127.0.0.1] Unexpected exception triggered (com.datastax.driver.core.exceptions.DriverInternalError: Server response from unsupported protocol version: 1))))
at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:179)
at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:77)
at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:868)
at com.datastax.driver.core.Cluster$Manager.newSession(Cluster.java:888)
at com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:792)
at com.datastax.driver.core.Cluster.connect(Cluster.java:155)
I think the crux of it is Server response from unsupported protocol version: 1.
Does this mean that the 2.0.0-beta2 driver can't be used with Cassandra 1.2.1? Where is the driver/server compatibility matrix?
I've already burned almost a day on this.
Thanks,
Matthew
Yes, it's incompatible. From the java-driver 2.0 requirements:
The driver uses Casandra's native protocol, and this version 2.0 uses the second version of that protocol. As such, this version of the driver requires a version of Cassandra greater than or equal to 2.0 (for Cassandra 1.2 please use the version 1.0 of the driver).
Try downgrading to 1.0, latest version is 1.0.4:
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-parent</artifactId>
<version>1.0.4</version>
</dependency>
The default protocol level for driver version 2.0 or above is 2. To work with older version of Cassandra (e.g. 1.2) the protocol level needs to be set to 1.
The protocol version can be set on newer drivers using Cluster.withProtocolVersion method like
Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1").withProtocolVersion(1)
.withPort(Ports.NATIVE).build();

Web application using log4j logs tons of severe error messages

I'm written an application which uses a library (Jabber stream objects) which internally uses log4j. When I deploy the application, there are no errors. However after some time, I could see lots of error message which look like this:
[#|2013-02-26T12:48:56.147+0000|SEVERE|oracle-glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=365;_ThreadName=SelectWorker 1;|java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [org.apache.log4j.spi.NOPLoggerRepository], because it has not yet been started, or was already stopped
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1401)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
at org.apache.log4j.LogManager.getLoggerRepository(LogManager.java:197)
at org.apache.log4j.LogManager.getLogger(LogManager.java:228)
at org.apache.log4j.Logger.getLogger(Logger.java:117)
I have log4j.jar inside the WEB-INF/lib directory of my application, along with the external library (JSO.jar)
The issue [1] looked similar, but doesn't seem to be the same.
[1] Web service is not working on GlassFish
I've found that this happens when I redeploy a Servlet and went away when I overridden destroy() for my Servlet and did some cleanup there.

Resources