Posts

Showing posts from August, 2019

Can't start tomcat! Ports are in use (error solve techinique

Can't Start Tomcat - Ports are in Use You may have a problem starting Tomcat. You may see sone ugly error message about ports in use. Solution You can use the troubleshooting tips below. Troubleshooting Tip #1 1. Exit Eclipse 2. Open a web web browser and visit, http://localhost:8080 3. If you see a "Tomcat" web page then that means Tomcat is running as a Windows service. To stop Tomcat running as a Windows services, open your Windows Control Panel. Find the service "Apache Tomcat" and stop it. 4. If you don't see a "Tomcat" web page, then stop the appropriate process displayed. -- Troubleshooting Tip #2 - GUI Option Steps to free port which is already used to run Tomcat server in Eclipse 1. On MS Windows, select Start > All Programs  > Accessories > System Tools >Resource Monitor 2. Expand the Network Tab 3. Move to the section for Listening Ports 4. Look in the Port column and scroll to find entry fo...

Deploy your web app to tomcat in war format

Bonus: Deploying your App to Tomcat as a Web Application Archive (WAR) file When you deploy your Java web apps, you can make use of a Web Application Archive (WAR) file. The Web Application Archive (WAR) file is a compressed version of your web application. It uses the zip file format but the file has the .war extension. If you are using Eclipse, then the best way to visualize it is think of your "WebContent" directory being compressed as a zip file with the .war extension. This includes all of your web pages, images, css etc. It also includes the WEB-INF directory which includes your classes in WEB-INF/classes and supporting JAR files in WEB-INF/lib. The WAR file format is part of the Java EE / Servlet specification. As a result, all Java EE servers support this format (ie jboss, weblogic, websphere, glassfish and tomcat). Below, I provide steps on how to create a WAR file in Eclipse. I also show how to deploy the WAR file on Tomcat. --- 1. In Eclipse, stop ...

java program to compare two strings

public class Main {      public static void main(String[] args)     {          Scanner sc=new Scanner(System.in);          //taking input of 2 Strings from the user to check          String s=sc.next();          String t=sc.next();          //calling the userdefined function compare and saving the result in a           //boolean variable          boolean b=compare(s,t);          //if the returned result is true,it will print "same" else "not same"          if(b==true)          {              System.out.println("Same");           }          else           {       ...

Spring Updates

Spring 5 -------------------------------------- 1. We can add custom log information now using spring framework. Spring 4.3 --------------------------------------------- Now if tour class have only 1 constructor for injection, Then no need to use the annotation "@Autowired" . If the class has several constructors then one of them must be annotated. #Latest update on spring framework #SpringUpdate ,springUpdate,SpringUpdates #Spring 5 ,Spring5 #spring4..3 ,Spring 4.3

Spring annotation configuration file

applicationContext.xml --------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"      xmlns:context="http://www.springframework.org/schema/context"     xsi:schemaLocation="http://www.springframework.org/schema/beans     http://www.springframework.org/schema/beans/spring-beans.xsd     http://www.springframework.org/schema/context     http://www.springframework.org/schema/context/spring-context.xsd">     <!-- add entry to enable component scanning --> <context:component-scan base-package="com.spring.annotationExample"> </context:component-scan>          </beans> #Spring annotation , SpringAnnotation #Spring annotation config file