0

I am working on a legacy application which is using Struts-1 and Hibernate-4. Now I have introduced Spring-Boot in the application. Below is the pom.xml that I have now ,-

<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.sprint</groupId>
    <artifactId>Project1</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>Project1 Maven Webapp</name>
    <url>http://maven.apache.org</url>


    <description>Project1RestSVTVW Multipart API</description>

    <properties>
        <!-- <spring.version>4.2.1.RELEASE</spring.version> -->
        <springboot.version>2.3.3.RELEASE</springboot.version>
        <hibernate.version>4.3.11.Final</hibernate.version>
        <maven.test.skip>true</maven.test.skip>
    </properties>

    <!-- <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> 
        <version>2.4.4</version> </parent> -->

    <dependencies>

        <!-- cxw Adding this per   to fix SOAP issues in new Eclipse -->
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-ri</artifactId>
            <version>2.3.2</version>
            <type>pom</type>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit-dep</artifactId>
            <version>4.11</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${hibernate.version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-c3p0</artifactId>
            <version>${hibernate.version}</version>
        </dependency>


        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.2.2</version>
        </dependency>

        <!-- cxw - replacing this -->
        <!-- <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> 
            <version>3.0.1</version> </dependency> -->

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>javax.servlet.jsp-api</artifactId>
            <version>2.3.1</version>
        </dependency>

        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.2.1</version> <!-- makesure correct version here -->
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.3.2</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.axis/axis -->
        <dependency>
            <groupId>org.apache.axis</groupId>
            <artifactId>axis</artifactId>
            <version>1.4</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/commons-discovery/commons-discovery -->
        <dependency>
            <groupId>commons-discovery</groupId>
            <artifactId>commons-discovery</artifactId>
            <version>0.4</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/wsdl4j/wsdl4j -->
        <dependency>
            <groupId>wsdl4j</groupId>
            <artifactId>wsdl4j</artifactId>
            <version>1.6.2</version>
        </dependency>

        <dependency>
            <groupId>javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>3.12.1.GA</version>
        </dependency>

        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>6.0.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.16</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>3.16</version>
        </dependency>

        <!-- JSTL Library -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.1.2</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/net.sourceforge.jexcelapi/jxl -->
        <!-- <dependency> <groupId>net.sourceforge.jexcelapi</groupId> <artifactId>jxl</artifactId> 
            <version>2.6</version> </dependency> -->

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>




        <!-- cxw - replacing this entirely with the following -->
        <!-- <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> 
            <version>1.4.7</version> <scope>provided</scope> -->

        <!-- cxw debug - removing exclusion for use in new eclipse -->
        <!-- <exclusions> <exclusion> <artifactId>activation</artifactId> <groupId>javax.activation</groupId> 
            </exclusion> </exclusions> -->

        <!-- </dependency> -->

        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>javax.mail</artifactId>
            <version>1.6.2</version>
        </dependency>


        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
            <version>2.3.20</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans -->
        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>2.6.0</version>
        </dependency>

        <dependency>
            <groupId>Query</groupId>
            <artifactId>QueryObject</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>Query</groupId>
            <artifactId>QueryObjectLink</artifactId>
            <version>1.0</version>
        </dependency>


        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <version>2.2.2</version>
        </dependency>
        <!-- <dependency> <groupId>struts</groupId> <artifactId>struts</artifactId> 
            <version>1.1</version> </dependency> -->

        <!-- https://mvnrepository.com/artifact/org.apache.struts/struts-core -->
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts-core</artifactId>
            <version>1.3.10</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.struts/struts-taglib -->
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts-taglib</artifactId>
            <version>1.3.10</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.struts/struts-extras -->
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts-extras</artifactId>
            <version>1.3.10</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.tomcat/jasper -->
        <!-- cxw - replacing THIS -->
        <!-- <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>jasper</artifactId> 
            <version>6.0.32</version> </dependency> -->
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>jasper</artifactId>
            <version>6.0.32</version>
            <scope>provided</scope>
        </dependency>

        <!-- https://mvnrepository.com/artifact/oracle/xmlparser 
            Project1Home.jsp error dependancy with SmfActionTypesUtil -->
        <dependency>
            <groupId>oracle</groupId>
            <artifactId>xmlparser</artifactId>
            <version>2.0</version>
        </dependency>

        <dependency>
            <groupId>JGo</groupId>
            <artifactId>JGo</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>JGo</groupId>
            <artifactId>JGoLayout</artifactId>
            <version>1.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/javax.xml/jaxrpc-api -->
        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>jaxrpc-api</artifactId>
            <version>1.1</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.enterprisedt/edtFTPj -->
        <dependency>
            <groupId>com.enterprisedt</groupId>
            <artifactId>edtFTPj</artifactId>
            <version>1.5.3</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>4.1</version>
        </dependency>

        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.glassfish.jersey/jersey-bom -->
        <dependency>
            <groupId>org.glassfish.jersey</groupId>
            <artifactId>jersey-bom</artifactId>
            <version>2.6</version>
            <type>pom</type>
        </dependency>
        <!-- ########### jDevWebservice Copy(Remove later) ############# -->
        <dependency>
            <groupId>jdev.webservice</groupId>
            <artifactId>wsclient</artifactId>
            <version>1</version>
        </dependency>

        <!-- ########### jDevWebservice Copy(Remove later) ############# -->

        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-common</artifactId>
            <version>2.6</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.glassfish.jersey.core/jersey-server -->
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-server</artifactId>
            <version>2.6</version>
        </dependency>


        <dependency>
            <groupId>jdev.webservice</groupId>
            <artifactId>soap</artifactId>
            <version>1</version>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-moxy</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-multipart</artifactId>
            <version>2.6</version>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-servlet</artifactId>
            <version>2.6</version>
        </dependency>
        <!-- if you are using Jersey client specific features without the server 
            side -->
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <version>2.6</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.6.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.6.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.json/json -->
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20090211</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.smallmind/scheduling-quartz -->
        <dependency>
            <groupId>org.smallmind</groupId>
            <artifactId>scheduling-quartz</artifactId>
            <version>2.4.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.smallmind/scheduling-quartz -->
        <dependency>
            <groupId>org.smallmind</groupId>
            <artifactId>scheduling-quartz</artifactId>
            <version>2.4.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>1.7.12</version>
        </dependency>
        <dependency>
            <groupId>com.sun</groupId>
            <artifactId>tools</artifactId>
            <version>1.6</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/tools.jar</systemPath>
        </dependency>
        <!-- Introduction of Spring Framework start -->
        <!-- <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> 
            <version>5.3.4</version> <type>pom</type> </dependency> -->
        <!-- <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> 
            <version>${spring.version}</version> </dependency> -->

        <!-- <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> 
            <version>${spring.version}</version> </dependency> -->

        <!-- <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> 
            <version>${spring.version}</version> </dependency> -->

        <!-- <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> 
            <version>${spring.version}</version> </dependency> -->
        <!-- <dependency> <groupId>org.springframework</groupId> <artifactId>spring-struts</artifactId> 
            <version>3.2.18.RELEASE</version> </dependency> -->
        <!-- Introduction of Spring Framework end -->

        <!-- Introduction of SpringBoot start -->
        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot -->
        <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> 
            <version>2.4.4</version> </dependency> -->
        <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot</artifactId> 
            <version>2.4.4</version> </dependency> -->
        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <version>${springboot.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>${springboot.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>tomcat-embed-el</artifactId>
                    <groupId>org.apache.tomcat.embed</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>tomcat-embed-core</artifactId>
                    <groupId>org.apache.tomcat.embed</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>tomcat-embed-websocket</artifactId>
                    <groupId>org.apache.tomcat.embed</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <version>${springboot.version}</version>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jersey</artifactId>
            <version>${springboot.version}</version>
        </dependency>
        <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> 
            <version>2.4.4</version> <scope>compile</scope> </dependency> -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>${springboot.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Introduction of SpringBoot end -->
        <!-- ######################## -->
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerArgument>-XDignore.symbol.file=true</compilerArgument>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>

        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.properties</include>
                </includes>
            </resource>
        </resources>

        <finalName>Project1</finalName>
    </build>


</project>

Now while I'm starting the Tomcat server in eclipse [Tomcat-8.0 or Tomcat-9.0], it doesn't start at all. And I'm getting the below error everytime in the console ,-

Mar 26, 2021 9:27:11 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-nio-8009"]
Mar 26, 2021 9:27:11 AM org.apache.coyote.AbstractProtocol destroy
SEVERE: Failed to destroy end point associated with ProtocolHandler ["ajp-nio-8009"]
java.lang.NullPointerException
    at org.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:316)
    at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:492)
    at org.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:821)
    at org.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:551)
    at org.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023)
    at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
    at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:589)
    at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
    at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:877)
    at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

Can anyone please help, how I can startup the Tomcat server and run the application as usual like before?? I got some suggestions from here: Tomcat: Failed to destroy end point associated with ProtocolHandler

But neither of them actually work for me. Kindly suggest.

Edit : please find the screenshot below ,- enter image description here

Jerry
  • 281
  • 4
  • 21
  • Your pom.xml is intriguing. Is there any reason why you have commented out the parent tag related to Springboot? – Kavitha Karunakaran Mar 26 '21 at 04:32
  • @Kavitha yes I commented out,, It was showing warnings through the pom with the versions of all dependency. Hence I commented the parent. – Jerry Mar 26 '21 at 04:36
  • Actually, you need to use the same version for parent tag as well as children so that ther are no issues with the dependencies. Otherwise it will lead to jar hell at runtime. My two cents would be to use the springboot.version property value for the parent tag too and see if that helps you to run. Second thing is to exclude the embedded tomcat from your pom so that the war can be deployed onto your standalone tomcat. – Kavitha Karunakaran Mar 26 '21 at 04:42
  • Ok, let me try. I will update with the result, on your suggestions... – Jerry Mar 26 '21 at 04:49
  • That error should be the last one of a series of errors, what was the first one? I would guess `java.net.BindException: Address already in use`. – Piotr P. Karwasz Mar 26 '21 at 05:42
  • @KavithaKarunakaran No, it didn't work. I tried with the 2 suggestions that you gave. But server didn't start. I Uncomment the `` tag and commented out the `` tag. But it failed again. – Jerry Mar 26 '21 at 06:41
  • @Poitr P. Karwasz, no there's no BindException . – Jerry Mar 26 '21 at 06:44
  • @Jerry: might be another kind of error. Read carefully the logs and check what happens between the moment Tomcat's start sequence ends and the shutdown sequence begins. BTW Tomcat 8.0 reached end-of-life a couple of years ago, you should use 8.5 instead. – Piotr P. Karwasz Mar 26 '21 at 06:50

0 Answers0