Skip to content
Advertisement

Two java files. Getting IllegalAccessError when running class with main method trying to access a method from the other file

Learning Java. I have two files, each containing one java class. When I run the file with the main method, I get the following error: Exception in thread “main” java.lang.IllegalAccessError: failed to access class TapeDeck from class TapeDeckTestDrive (TapeDeck is in unnamed module of loader ‘app’; TapeDeckTestDrive is in unnamed module of loader com.sun.tools.javac.launcher.Main$MemoryClassLoader @18bf3d14) at TapeDeckTestDrive.main(TapeDeckTestDrive.java:3) Any help please?

Strange Javadoc wrapping in Intellij

Why I am getting this strange formatting of Javadoc in Intellij? The wrapping is completely off: This is my Intellij Javdoc Formatting rules Answer You can disable the Wrap at right margin option and use the Wrapping and Braces | Hard wrap at. The current behavior is a bit confusing and there is an open issue for that.

flyway schema giving IllegalArgumentException

On running flyway schema I’m receiving this exception.using Java 8 with spring boot. Flyway is not able to initialize. Answer Check the flyway_schema_history table, there you will see that you have an entry with installed_rank value set to 0, delete the row and run your application again. This will sort the issue out.

Docker disable restart on-failure

The following situation: I have a Spring Boot Application which runs in a Docker swarm but fails to start because it was not properly configured (a property is missing). It seems to me that the docker swarm always tries to restart the container, but always fails because of the missing property. The restart makes no sense because docker will never

How to get only one role from a set of roles

I’m trying to implement a simple spring security project where basically I have user and role entities. I have a set of roles “ADMIN” and “USER”. Now I want to assign only “USER” role along with creating a new user. I have tried to use List and collections with the same problem. The User entity has Set<Role> And Role entity:

Advertisement