Why is the <load-on-startup> tag being ignored when web service is deployed?

I have a java web service that is supposed to start automatically when it is deployed.  For some unknown reason it does not.  I am seeking guidance on how to figure out why it is not starting automatically.  I am using jdk 1.8, jax ws 2.2.6, tomcat 8 on rhel 7.  Here is what I have in the web.xml file for the service servlet:
    <listener>
        <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>MiscService</servlet-name>
        <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>MiscService</servlet-name>
        <url-pattern>/MiscService</url-pattern>
    </servlet-mapping>

Open in new window


Is there something else I am supposed to do other than put the number 1 in the load on startup tag?  Everything that I have googled said that this is all I need to do.  My server admin guy is not much help and if there is something on the server side that needs to be done can anybody please tell me that.  If there is something else that I need to put in my code then please let me know.

I do not have this issue in the development or staging environments but I can say that the one difference in the production environment, which is where I am having this issue, is that the web service is served via a load balancer.  The request goes through one of two regular apache web server to tomcat.

HELP!!!
Monica StanleyInformation Technology SpecialistAsked:
Who is Participating?
 
CEHJCommented:
Check the logs. It might not be able to start
0
 
Monica StanleyInformation Technology SpecialistAuthor Commented:
I will ask the server admin to supply me with log files.
0
 
Monica StanleyInformation Technology SpecialistAuthor Commented:
Okay... Here is what is in the catalina.out file.

Apr 24, 2018 2:34:47 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive miscwebservice.war
Apr 24, 2018 2:34:48 PM org.apache.tomcat.util.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 4618 column 5: The string "--" is not permitted within comments.
org.xml.sax.SAXParseException; systemId: file: web.xml; lineNumber: 4618; columnNumber: 5; The string "--" is not permitted within comments.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
        at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472)
        at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanComment(XMLScanner.java:819)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanComment(XMLDocumentFragmentScannerImpl.java:1034)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2982)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
        at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1555)
        at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1856)
        at org.apache.catalina.startup.ContextConfig.getDefaultWebXmlFragment(ContextConfig.java:1494)
        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1255)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:887)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:387)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5472)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1984)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Here is my entire web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
    <listener>
        <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>MiscService</servlet-name>
        <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>MiscService</servlet-name>
        <url-pattern>/MiscService</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <resource-ref>
            <description>MSWS Connection Pool</description>
            <res-ref-name>jdbc/misc-conn</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
    </resource-ref>
</web-app>

Open in new window


Now I am even more confused.  My web.xml file is no where near 4618 lines long so where is this error coming from?  Is the web.xml file somehow transformed after it is archived into the war file?  Is the file being deployed somehow different than the one I created?
0
 
Monica StanleyInformation Technology SpecialistAuthor Commented:
Looking at the log file helped me find the problem.  There is a tomcat web.xml file that was causing the problem not the one that is deployed with my application.
0
 
CEHJCommented:
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.