Category "java"

Unable to pass java compiler parameters using maven

As the title says I am unable to pass command line parameters to the java compiler using maven, I am using the maven-compiler-plugin to do it, and accordingly t

Unable to update Maven configuration Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5

From inside eclipse when i am doing Maven -> Update Project i am getting following issue Unable to update Maven configuration Could not calculate build

spring-boot-starter-data-jpa dependency error

I am using new version of Spring boot - 1.5.7. But , when I create new spring starter project with jpa dependency, I got strange error: Caused by: org.spr

Defining a default/global Java object to Nashorn script engine?

With Java's Nashorn script engine, I can provide objects in the context of an eval() using bindings like so: Bindings bindings = scriptContext.getBindings(Scri

Consider defining a bean of type 'org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository' in your configuration

I am using spring oAuthClient version 5.2.4.RELEASE By following the document link of spring security https://docs.spring.io/spring-security/site/docs/current

Read property file of one java project in another java project

Here is my problem statement: I have a project A which is built in spring and is a maven project. there is project B(not using any framework) which I am develo

Initializing C3P0 connection pool takes 2 min

I can't wrap my head around why the initialization of a c3p0 connection pool takes 2 min in my Hibernate application. This is in my Hibernate.cfg.xml: <hib

How to open file in another directory in java?

How to open a file that is not present in the current directory but in another directory. For example, I have a folder F:/test and my file is in F:/test/test2/d

What should I use instead of the deprecated Date.getHours()

If a method is deprecated in Java there will be a another better way to have same functionality, right? Date date = new Date(); date.getHours() As getHours()

How to match a string's end using a regex pattern in Java?

I want a regular expression pattern that will match with the end of a string. I'm implementing a stemming algorithm that will remove suffixes of a word. E.g. fo

Override the handleNoHandlerFoundException

I want override the Spring Boot default result when calling a not-existing route: { "timestamp": "2022-03-20T17:01:07.453+00:00", "status": 404, "er

No adapter for endpoint; Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?

I am struggling with an Spring-WS with JMS example. I set the Spring-WS and JMS wiring as per the Spring recommendations. But I kept getting following error. I

Memory leak with Mongo Java Connection

I am constructing MongoClient Connection in the below manner : public static synchronized MongoClient getInstance(String mongoDbUri) { try {

Why all the test cases are not getting passed for the below question?

The Coding Question which I am trying to solve is this. I tried to solve but not all the test cases passed I am not able to find what could be the reason? Iden

Gradle: Override transitive dependency by version classifier

One of the dependencies declared in my project has a transitive dependency on 'com.google.guava:guava:15.0'. But my application deployed on WAS/Weblogic doesn't

Round robin with failover with Apache http client

Looking the Apache HTTP components HttpClientBuilder and seeing that it has retry handler route planner backoff strategy I am wondering whether these are intend

Helidon custom interceptor

I use helidon SE 1.4.4, how can add intercepor for all response. My route is: return Routing.builder() .register(JsonSupport.create())

Convert the result of Throwable.getStackTrace() to a string that depicts the stacktrace [duplicate]

Easiest way to convert the result of Throwable.getStackTrace() to a string that depicts the stacktrace?

In Spring mvc application, @RequestBody is throwing java.io.EOFException

In the jsp i am passing the data as json,as in the controller method i am trying to map the data to Personbean object using @RequestMapping. But its throwi

Iterate the values from the List and get oldest, newest dates

I am working on spring application. I am having a LinkedHashMap<Integer, List<MyDTO>> object, in the value of the map (i.e,List<MyDTO>) I hav