java.lang.IllegalArgumentException: Child name [/mytestapp] is not unique

Sometimes while deploying war to tomcat leads to the error. 15-Jun-2021 13:41:40.282 INFO [ajp-nio-127.0.0.1-8209-exec-10] org.apache.catalina.startup.HostConfig.undeploy Undeploying context [/mytestapp] 15-Jun-2021 13:41:40.956 INFO [ajp-nio-127.0.0.1-8209-exec-10] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/mytestapp.war] 15-Jun-2021 13:41:40.963 INFO [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/mytestapp.war] 15-Jun-2021 13:41:40.964 SEVERE [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/opt/tomcat/webapps/mytestapp.war] java.lang.IllegalArgumentException: Child name [/mytestapp] is not … Read more

java.lang.NoSuchMethodError: ‘org.junit.jupiter.api.extension.TestInstances org.junit.jupiter.api.extension.ExtensionContext.getRequiredTestInstances()’

Problem: java.lang.NoSuchMethodError: ‘org.junit.jupiter.api.extension.TestInstances org.junit.jupiter.api.extension.ExtensionContext.getRequiredTestInstances()’ Using : openJdk16 maven3 eclipse2021-03   Solution: I was using maven dependency for Junit 5 <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <version>5.3.0</version> <scope>test</scope> </dependency> And to solve this issue I had to update the dependency to <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <version>5.5.0</version> <scope>test</scope> </dependency>   After that change eclipse did run the tests fine.

Mock Interviews for Java developers

Are you preparing for interviews specifically for a Java developer position. Why not try a mock interview with us. Our interviewers would conduct a short half an hour interview with you. You can pay as you wish for the interview. Fill the contact form below and we will send you an invite for a skype … Read more

How to find a word inside a folder recursively in linux?

This can be done using grep command.

If you are searching in current directory use dot(.) as shown below

Options we have used -n                   : Show relative line number in the file -r                    :  Recursively … Read more

Unsupported major.minor version 52.0

Recently we migrated to Java 8 from Java 7. And after installing Java 8 on my system, running any test threw the exception

And the solution for me was to run Maven > Update Project from context menu. You can also update the classpath of your project from command line using the following command … Read more

Convert an Image to base64 string in java

Geowave queries: Querying by polygon, Filtering on attributes of features using CQL queries, Ingesting polygons, and running polygon intersect queries

Jsoup Maven and gradle dependecies

jsoup is a Java library for working with real-world HTML. It provides a very convenient API for extracting and manipulating data, using the best of DOM, CSS, and jquery-like methods. Maven If you use Maven to manage the dependencies in your Java project, you do not need to download; just place the following into your … Read more

ArrayList in java , add() method

Here is a real world example of using java.util.ArrayList add method.