<Tim>
Explore posts from serversJCHJava Community | Help. Code. Learn.
•Created by <Tim> on 10/20/2024 in #java-help
Deploying Spring Boot application with Stomp over WSS using nginx
Does anyone have experience with Secure Websockets (WSS) over Nginx? I currently have this nginx config file, but the websockets stopped working once I switched from unsecure http:// and ws:// to https:// and wss:// (the https:// traffic and the rest of the application works fine though, just the websocket connection fails to establish)
Do I need to change anything on the Java Spring side or the Tomcat setup?
55 replies
JCHJava Community | Help. Code. Learn.
•Created by <Tim> on 4/24/2024 in #java-help
java.lang.NoSuchFieldError: UUID
When I try to deploy my WAR archive on the tomcat 10 I just set up (Debian, Tomcat 10.1.23, MySQL 8.24), I get the following error:
The only thing I could find on the internet about it was https://stackoverflow.com/q/76296222/6336728
I use Hibernate 6.2.7, so I downgraded to JPA 3.0.12 and Hibernate 6.1.7.Final.
Now I get a
java.util.zip.ZipException: zip END header not found
, even though jar xvf archive.war
works fine.14 replies
JCHJava Community | Help. Code. Learn.
•Created by <Tim> on 3/20/2024 in #java-help
Problems with an ArrayIndexOutOfBoundsException
Context
I have source code (as a String) that I compile in memory with the Java compiler API. I then transform the bytecode to add instrumentation: mainly tracking line coverage and obtaining variable changes.
What I'm trying to do
Now I want to add logging. For this I want to replace calls to
System.out.println
with my own logging function. (This is necessary, because (1) my custom class loader blocks loading of the System class and (2) because I want the log information stored along with the other data and contain class, method and line number of the call.)
What already works
Simply calling System.out.println("Hello, World!");
works already. Concatenating a string with a variable works now as well, e.g. System.out.println("x = " + x);
The transformation is done with the MethodVisitor from ASM:
So I mainly switch out the call to a printStreams println
with the call to my logging function and I switch out accessing System.out
with fetching a dummy PrintStream (that does nothing) from my Debug class.
In bytecode this means that an access to System.out.println is replaced with:
which in Java means:
9 replies