I define an interface follow then I define a abstract class implement the interface then I has a class extends the abstract class now I want to generate a proxy for the instance field of the BaseCore class,I do this but I receive the exception who can help me explain the excetion and how I can solve the probl…
Tag: java
Find certain numbers in a String and add them in separate ints
I need a way to take specific “random” numbers from a string and put them each in separate int variables. For example this string cannot/shouldnt be changed: String date = “59598 22-01-19 22:46:32 00 0 0 66.2 UTC(NIST) * “; I need these three numbers in separet ints “22-01-19R…
How to have the program regenerate a “new game” where previous grid letters get swapped with new grid letters
In this program I’m trying to input a functionality to start game, where if I click start game (MainMenu) a new jpanel opens up (MainGame), creating another jpanel that creates jbuttons in a grid. If i go back, and click start game again, a new grid should generate instead of the previous one, effective…
how to remove log4j form recursive dependency?
I was trying to remove the log4j dependency from my project which is a huge repository. After having a close look in gradle files I found one of the module refers to the log4j dependency, which I excluded in gradle as shown in below code – exclude group: ‘log4j’, module: ‘log4j’ …
StackOverflowError Springboot OneToMany BiDirectional Mapping
I am currently coding a project, which requires me to map in between two entities: An account and a member. An account can have multiple members, whilst the member can only have one account. After I’ve finished coding the bidirectional way, everything was working and I got the response I wanted, which i…
How to unit test methods together with its constraint validators (which some should be mocked out)?
My app has a service layer which is composed by CDI applications scoped beans: When a method gets called, an interceptor (in my case BValInterceptor.class from Apache BVal) checks if the method contract is respected by checking the annotations and validating the parameters accordingly. As you can see, there a…
ElasticsearchClient 7.16 mapping source from JSON file
I’m migrating our app to new ElastisearchClient for Java. We have few mapping/setting/properties configurations created in JSON files like here Elastic mapping source 7.15. Is it still possible to map sources as in these examples? Or is it fully migrated to: builders and functional patterns Currently, w…
reusing stream inside a stream java
Hi I just wanted to know what is wrong with my code and how can I improve it as it throws an error “stream has already been operated upon or closed” thank you here is my code: I wanted to loop inside the file and check per line if the characters there exceeded 12 characters or not Answer You canno…
Spring data jpa, how to filter and then sort results in this example?
I wrote a method, but as you can see – Category here is never used. Is to possible to find only Dishes where Category is same as defined and only after it – sort it by parameter using plain Spring data jpa? Or the only way to it is a custom query? Answer You could add a method like below
Spring Boot, Swagger and Authorisation
I have a Spring Boot API that uses Springdoc (Swagger). The API has security with “apiKey” and “code” fields being passed in the header. I am having difficulty configuring Swagger correctly to enable the Authentication function in the Swagger UI. This is the configuration: I know this …