java

I do not know if you used any IDE, but in eclipse you can switch to the debug mode, and change between the different threads. In each thread you can see the stack trace.

Websocket interactions in Docker

I am trying to get my Websocket server (Java) and client (JS) to interact with each other when they are both running in separate Docker containers. However, no matter what I do, I cannot get the client to even establish a connection to the server. What can be done here?

Could not pull from git repository – wrong credentials on windows

I changed my password on the github repository and Intellij asks again for the new credentials. I used the new credentials but it still tells me that I am using wrong credentials. I tried using the old credentials and it still gives me the wrong credentials. I invalidating cache and restarting IntelliJ, but it didn't work and I also tried from windows terminal but it still returns invalid credentials. I tried logging in via the webpage and it works

Intellij has a lot of interesting features and for that it makes use of cache. That sometimes makes problems like this. After invalidating caches and restarting IntelliJ the dependencies that were cached are removed and updated on the next compiling, and these errors were fixed.

IntelliJ not recognizing classes of other maven modules

I am developing an application with multiple java modules and when I try to use class of another module, that I have a dependency on java does not recognize it. It used to recognize it, but since I updated versions of the modules this does not work. I tried reimporting everything, but it doesn't work. I am working on IntelliJ

Java throws NullPointerException - No stack trace

My java applcation is throwing a NullPointerException on some data. The applications is multithreaded application that takes data as input, processes it and sends it. On some of the data I get a NullPointerException , but no stack trace. After investigating them I did not see a difference between the data that causes NullPointerException and the data that doesn't. The only difference I get is that when the NullPointerException occurs the application has a high load.

When writing to the file, I was using Writer. The solution is switching to OutputStream.

From JDOM reference, org.jdom2.output.XMLOutputter, output(Document doc, java.io.Writer out):
Warning: using your own Writer may cause the outputter's preferred character encoding to be ignored. If you use encodings other than UTF-8, we recommend using the method that takes an OutputStream instead.

Technology:

Wrong character encoding in XML file

After my Java code finished editing an XML file using JDOM2, the resulting project.xml has an incorrect encoding. Special characters (like italian "è") are not represented correctly, resulting in an unreadable character. XML Explorer (and sometimes even WinMerge) refuses to open the file.

Pages

Subscribe to java