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.

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

Read More

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

Read More

ArrayList in java , add() method

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

Read More