Jenkins CI/CD for Github using Deploy Keys

When setting up a continuous integration and deployment (CI/CD) pipeline using Jenkins and GitHub deploy keys, you can use the Jenkins GitHub plugin to interact with the GitHub repository. Here are the general steps for setting up a basic Jenkins CI/CD pipeline using GitHub deploy keys: Set up a Jenkins server: This can be done … Read more

Amazon Keyspaces – its usage, limitations and differences with Apache Cassandra

Amazon Keyspaces is a fully managed database service offered by Amazon Web Services (AWS). It is based on Apache Cassandra, and it is designed to be scalable, highly available, and easy to use.Amazon Keyspaces allows you to store, retrieve, and manage large amounts of data in a distributed database. It is well-suited for applications that … Read more

Connect to Apache Cassandra using Java

To connect to Cassandra in Java, you will need to include the Cassandra driver in your project. Here is an example of how you can do this: Download the Cassandra Java driver from the Apache Cassandra website or from Maven Central. Add the driver to your project. If you are using Maven, you can include … Read more

Parameter 0 of constructor in org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration required a bean of type ‘javax.sql.DataSource’ that could not be found. – Bean method ‘dataSource’ not loaded because @ConditionalOnProperty (spring.datasource.jndi-name) did not find property ‘jndi-name’ – Bean method ‘dataSource’ not loaded because @ConditionalOnBean (types: org.springframework.boot.jta.XADataSourceWrapper; SearchStrategy: all) did not find any beans

This error message is indicating that your application is unable to find a bean of type ‘javax.sql.DataSource’ that is required by HibernateJpaAutoConfiguration. The error message suggests that there is a missing @ConditionalOnProperty annotation on the dataSource() method, which is causing the bean not to be loaded. The @ConditionalOnProperty annotation checks for the presence of a … Read more

Jenkins CI/CD using Github Account

When setting up a continuous integration and deployment (CI/CD) pipeline using Jenkins and a GitHub account, you can use the Jenkins GitHub plugin to interact with the GitHub repository. Here are the general steps for setting up a basic Jenkins CI/CD pipeline using a GitHub account: Set up a Jenkins server: This can be done … Read more

Write a Java program to generate age gender statistics

Here is a very simple Java program that generates age and gender statistics for a group of persons:

This program defines a map called persons, which stores the age and gender of each person as a key-value pair. The program then iterates through the map, updating counters for the number of males and females, … Read more

Jenkins CI/CD with Github with Webhooks

Creating a CI/CD pipeline using Jenkins and GitHub can be a bit involved, but I can give you an overview of the process. First, you’ll need to set up a Jenkins server. This can be done by installing Jenkins on a server or by using a cloud-based version, such as Jenkins on Azure or AWS. … Read more

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