Jenkins: stops execution of job abruptly - java

I have a scheduled pipeline which runs daily.
There was an error that I faced yesterday.One of my jobs in the pipeline failed abruptly.The console log didn't return any FAILURE status.But strangely the pipeline shows as SUCCESSFUL,despite the job failing.
My job uses chef to download files from object storage location.I checked the logs it is successful.But still somehow the job failed/interrupted.
One more thing I noticed is that though the job ran fully it still shows completed in 0ms
Started 23 hr ago
Took 0 ms
Below is the jenkins log at the time when the job started:
` **Nov 28, 2017 1:47:10 PM hudson.plugins.logparser.LogParserReader readLogPart
INFO: Start reading log part 0 in thread #0
Nov 28, 2017 1:47:10 PM hudson.plugins.logparser.LogParserReader readLogPart
INFO: Done reading log part 0
Nov 28, 2017 1:47:11 PM hudson.plugins.logparser.LogParserThread getLineStatuses
INFO: LogParserThread: Start parsing log part 0
Nov 28, 2017 1:47:11 PM hudson.plugins.logparser.LogParserThread getLineStatuses
INFO: LogParserThread: Done parsing log part 0
Nov 28, 2017 1:47:11 PM hudson.plugins.logparser.LogParserParser parseLogBody
INFO: LogParserParser: Parsing took 0 minutes (0) seconds.
Running from: /usr/lib/jenkins/jenkins.war
Nov 28, 2017 2:17:08 PM Main deleteWinstoneTempContents
WARNING: Failed to delete the temporary Winstone file /tmp/winstone/jenkins.war
Nov 28, 2017 2:17:08 PM org.eclipse.jetty.util.log.Log initialized
INFO: Logging initialized #858ms to org.eclipse.jetty.util.log.JavaUtilLog
Nov 28, 2017 2:17:09 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Nov 28, 2017 2:17:09 PM org.eclipse.jetty.server.handler.ContextHandler setContextPath
WARNING: Empty contextPath
Nov 28, 2017 2:17:09 PM org.eclipse.jetty.server.Server doStart
INFO: jetty-9.4.z-SNAPSHOT
Nov 28, 2017 2:17:10 PM org.eclipse.jetty.webapp.StandardDescriptorProcessor visitServlet
INFO: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Nov 28, 2017 2:17:10 PM org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
INFO: DefaultSessionIdManager workerName=node0
Nov 28, 2017 2:17:10 PM org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
INFO: No SessionScavenger set, using defaults
Nov 28, 2017 2:17:10 PM org.eclipse.jetty.server.session.HouseKeeper startScavenging
INFO: Scavenging every 660000ms
Jenkins home directory: /var/lib/jenkins found at: SystemProperties.getProperty("JENKINS_HOME")
Nov 28, 2017 2:17:11 PM org.eclipse.jetty.server.handler.ContextHandler doStart
INFO: Started w.#d23e042{/,file:///var/cache/jenkins/war/,AVAILABLE}{/var/cache/jenkins/war}
Nov 28, 2017 2:17:11 PM org.eclipse.jetty.server.AbstractConnector doStart
INFO: Started ServerConnector#13d73f29{HTTP/1.1,[http/1.1]}{127.0.0.1:8081}
Nov 28, 2017 2:17:11 PM org.eclipse.jetty.server.Server doStart
INFO: Started #3487ms
Nov 28, 2017 2:17:11 PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v4.0 running: controlPort=disabled
Nov 28, 2017 2:17:12 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Nov 28, 2017 2:17:13 PM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Nov 28, 2017 2:17:18 PM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Nov 28, 2017 2:17:18 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Nov 28, 2017 2:17:19 PM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
INFO: Failed to instantiate optional component org.biouno.unochoice.model.ScriptlerScript$DescriptorImpl; skipping
Nov 28, 2017 2:17:19 PM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Nov 28, 2017 2:17:20 PM jenkins.model.RunIdMigrator migrate
INFO: Migrating build records in /var/lib/jenkins/jobs/build_spark_repo/builds
Nov 28, 2017 2:17:20 PM jenkins.model.RunIdMigrator doMigrate
WARNING: found unexpected dir lastSuccessfulBuild
Nov 28, 2017 2:17:20 PM jenkins.model.RunIdMigrator doMigrate
WARNING: found unexpected dir lastStableBuild
Nov 28, 2017 2:17:20 PM jenkins.model.RunIdMigrator migrate
WARNING: Build record migration (https://jenkins.io/redirect/build-record-migration) is one-way. If you need to downgrade Jenkins, run: java -classpath "/var/cache/jenkins/war/WEB-INF/lib/jenkins-core-2.73.2.jar:/var/cache/jenkins/war/WEB-INF/lib/commons-io-2.4.jar:/var/cache/jenkins/war/WEB-INF/lib/stapler-1.250.jar:/var/cache/jenkins/war/WEB-INF/lib/ant-1.8.4.jar:/var/cache/jenkins/war/WEB-INF/lib/commons-lang-2.6.jar" jenkins.model.RunIdMigrator "/var/lib/jenkins"
Nov 28, 2017 2:17:20 PM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Nov 28, 2017 2:17:20 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Download metadata
Nov 28, 2017 2:17:20 PM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Nov 28, 2017 2:17:21 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext#479f04e6: display name [Root WebApplicationContext]; startup date [Tue Nov 28 14:17:21 CET 2017]; root of context hierarchy
Nov 28, 2017 2:17:21 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext#479f04e6]: org.springframework.beans.factory.support.DefaultListableBeanFactory#5eedf60f
Nov 28, 2017 2:17:21 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#5eedf60f: defining beans [authenticationManager]; root of factory hierarchy
Nov 28, 2017 2:17:21 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext#4a772b39: display name [Root WebApplicationContext]; startup date [Tue Nov 28 14:17:21 CET 2017]; root of context hierarchy
Nov 28, 2017 2:17:21 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext#4a772b39]: org.springframework.beans.factory.support.DefaultListableBeanFactory#5e76549c
Nov 28, 2017 2:17:21 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#5e76549c: defining beans [filter,legacy]; root of factory hierarchy**`
This worked after I re-run the job.
Just wanted to know what could be the cause of the error?

Related

JSP pages not loading on loaclhost while working with Tomcat7 on Eclipse IDE

I am working on a project for which I am using Java Servlets and JSP. Earlier the project was running fine, but now when running the project, the server is properly setup but some JSP pages are not running and others do not show any CSS applied to it.
Also console shows a warning.
Apr 19, 2016 8:24:57 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.2.
Apr 19, 2016 8:24:57 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Apr 19, 2016 8:24:58 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:TPC' did not find a matching property.
Apr 19, 2016 8:24:58 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1f 6 Jan 2014)
Apr 19, 2016 8:24:58 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
Apr 19, 2016 8:24:58 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Apr 19, 2016 8:24:58 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2996 ms
Apr 19, 2016 8:24:58 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 19, 2016 8:24:58 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
Apr 19, 2016 8:25:01 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Apr 19, 2016 8:25:02 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Apr 19, 2016 8:25:02 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3405 ms
Can you check if you war/ear file is present in tomcat and also getting deployed.
If not sure, just restart the server after clean up (deleting temp,work and logs directory).
Then try to access http://localhost:8080/ or http://localhost:8080/YOUR_DEPLOYABLE_FILE_NAME
If it still doesn't work then check mappings in web.xml.

Tomcat server "HTTP status 404" on Eclipse, working fine on windows

I am pretty new to all the servers thing so excuse me if I don't have enough knowledge to explain the situation correctly.
Basicly, I run the Tomcat server from my windows computer and it's working perfectly fine, I see the welcome page at localhost. However, when I try to deploy a project and run it with Eclipse, I see the HTTP Status 404 error.
I have read so far plenty of articles and opinions on the internet, some of them I couldn't quite understand, but what I have tried is to switch the server's location. However, when I do that, some SEVERE errors appear in the console, and I'm unable to restart the server except for if I restart Eclipse itself.
This is the full stacktrace:
Aug 02, 2015 5:11:44 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:webproject.filecounter' did not find a matching property.
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/8.0.24
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jul 1 2015 20:19:55 UTC
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 8.0.24.0
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.1
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jre1.8.0_20
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_20-b26
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\Users\Дени\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 8.0
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\Дени\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 8.0
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\Дени\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 8.0\endorsed
Aug 02, 2015 5:11:44 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1251
Aug 02, 2015 5:11:44 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_20\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jdk1.8.0_20/jre/bin/server;C:/Program Files/Java/jdk1.8.0_20/jre/bin;C:/Program Files/Java/jdk1.8.0_20/jre/lib/amd64;C:\Users\Дени\Downloads\eclipse\jre\bin\javaw.exe;C:\OrCAD\OrCAD_16.3_Demo\tools\PSpice;C:\OrCAD\OrCAD_16.3_Demo\tools\PSpice\Library;C:\OrCAD\OrCAD_16.3_Demo\tools\Capture;C:\OrCAD\OrCAD_16.3_Demo\tools\bin;C:\OrCAD\OrCAD_16.3_Demo\OpenAccess\bin\win32\opt;C:\OrCAD\OrCAD_16.3_Demo\tools\fet\bin;C:\OrCAD\OrCAD_16.3_Demo\tools\pcb\bin;C:\apache-tomcat-8.0.24;C:\Program Files\Java\jdk1.8.0_20;D:\New folder\Downloads\eclipse;;.
Aug 02, 2015 5:11:44 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Aug 02, 2015 5:11:45 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Aug 02, 2015 5:11:45 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Aug 02, 2015 5:11:45 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Aug 02, 2015 5:11:45 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2287 ms
Aug 02, 2015 5:11:45 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Aug 02, 2015 5:11:45 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.24
Aug 02, 2015 5:11:45 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [129] milliseconds.
Aug 02, 2015 5:11:46 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Aug 02, 2015 5:11:46 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Aug 02, 2015 5:11:46 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 956 ms
Aug 02, 2015 5:12:16 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/webproject.filecounter] has started
Aug 02, 2015 5:12:16 PM org.apache.catalina.core.StandardContext reload
SEVERE: Exception starting Context with name [/webproject.filecounter]
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/webproject.filecounter]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3746)
at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:292)
at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5528)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1377)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1349)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot#623ebb68]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4845)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4975)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 8 more
Caused by: java.lang.IllegalArgumentException: The main resource set specified [C:\Users\Дени\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps\webproject.filecounter] is not valid
at org.apache.catalina.webresources.StandardRoot.createMainResourceSet(StandardRoot.java:723)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:684)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more
Aug 02, 2015 5:12:16 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/webproject.filecounter] is completed
I'll appreciate any help, but, as I said, I'm pretty new to servlets and I'm sorry if I didn't explain something correctly.
I'm using Eclipse Luna and Tomcat 8.0 versions.
It says that the file webproject.filecounter is not valid. Maybe you can try to delete the . metadata.

Tomcat starting slow ( AprLyfecycleListener )

I just wanted to know why my tomcat is starting so slow.
I was able to change the timeout and then I saw the starting log
Feb 24, 2015 4:24:04 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which [...]
Feb 24, 2015 4:26:11 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Feb 24, 2015 4:26:11 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 127659 ms
Feb 24, 2015 4:26:11 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 24, 2015 4:26:11 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.43
Feb 24, 2015 4:26:11 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Feb 24, 2015 4:26:11 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Feb 24, 2015 4:26:11 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/13 config=null
Feb 24, 2015 4:26:11 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 301 ms
Analysing this:
Feb 24, 2015 4:24:04 PM org.apache.catalina.core.AprLifecycleListener init
Feb 24, 2015 4:26:11 PM org.apache.coyote.http11.Http11Protocol init
and...
Feb 24, 2015 4:26:11 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 127659 ms
The start of this AprLifecycleListener is taking 2 minutes, I saw some other logs on the internet, and they start instantly.
I'm using eclipse luna, tomcat 6, java 6, and ubuntu 12.04 x64
Thanks for the help.

Tomcat 7.0.42 Error listenerStart

Am deploying my war file on tomcat(jdk 7) and am seeing following error. Am not sure of whats causing the issue.
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1d 5 Feb 2013)
Feb 27, 2014 11:02:50 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8081"]
Feb 27, 2014 11:02:50 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Feb 27, 2014 11:02:50 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1588 ms
Feb 27, 2014 11:02:50 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Feb 27, 2014 11:02:50 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
Feb 27, 2014 11:02:50 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive D:\Dev\tools\apache-tomcat-7.0.42\webapp
s\CollaborationPortal.war
Feb 27, 2014 11:03:09 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
Feb 27, 2014 11:03:09 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
Feb 27, 2014 11:03:09 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Feb 27, 2014 11:03:09 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/CollaborationPortal] startup failed due to previous errors
Feb 27, 2014 11:03:09 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8081"]
Feb 27, 2014 11:03:09 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Feb 27, 2014 11:03:09 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 18890 ms
You can reconfigure java.utils.logging by adding /WEB-INF/classes/logging.properties to your war archive:
org.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = java.util.logging.ConsoleHandler
The actual error message should then be visible. Also, check your application logs, if an additional logging framework is already configured (eg. log4j).
There might be a mismatch in the JDK version you have installed and the JDK with which you are trying to build your project.
1) If you are using Eclipse.Go to Windows->Preferences->Compiler->check the compiler compliance level (It should match with your installed JDK)
2)
Right click on build.xml
Select Run As->Ant Build... note the ellipsis!
Switch to JRE tab
Select the jdk from the list
Build your project
( https://stackoverflow.com/a/26375026/5566348 )

Netbeans/Tomcat/Jersey loading Spring context twice

Jersey/Spring application debugged inside Netbeans and deployed to Netbean's Tomcat server has its application context loaded twice. It is loaded, unloaded, and loaded again.
BLOODY WHY?!?!
EDIT: It looks like if I comment out the servlet and servlet-mapping in web.xml, the application context is still loaded twice! If I delete /conf/web.xml file, it is STILL loaded twice. ###$#! Netbeans/Tomcat
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<servlet>
<servlet-name>ServletAdaptor</servlet-name>
<servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.PostReplaceFilter</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>ServletAdaptor</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
</web-app>
Tomcat output:
Using CATALINA_BASE: "C:\Users\adubi_000\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.27.0_base"
Using CATALINA_HOME: "C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27"
Using CATALINA_TMPDIR: "C:\Users\adubi_000\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.27.0_base\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.7.0_07"
Using CLASSPATH: "C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\bin\tomcat-juli.jar"
Listening for transport dt_shmem at address: tomcat_shared_memory_id
Sep 15, 2012 9:19:22 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:
Sep 15, 2012 9:19:22 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-80"]
Sep 15, 2012 9:19:22 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Sep 15, 2012 9:19:22 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 821 ms
Sep 15, 2012 9:19:22 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 15, 2012 9:19:22 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.27
Sep 15, 2012 9:19:22 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\adubi_000\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.27.0_base\conf\Catalina\localhost\manager.xml
Sep 15, 2012 9:19:23 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\adubi_000\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.27.0_base\conf\Catalina\localhost\ROOT.xml
Sep 15, 2012 9:19:26 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Sep 15, 2012 9:19:26 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Sat Sep 15 21:19:26 EST 2012]; root of context hierarchy
Sep 15, 2012 9:19:26 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
Sep 15, 2012 9:19:27 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#2829abfd: defining beans [...]; root of factory hierarchy
Sep 15, 2012 9:19:28 PM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
Sep 15, 2012 9:19:28 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.6.Final}
Sep 15, 2012 9:19:28 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Sep 15, 2012 9:19:28 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Sep 15, 2012 9:19:28 PM org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator instantiateExplicitConnectionProvider
INFO: HHH000130: Instantiating explicit connection provider: org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider
Sep 15, 2012 9:19:28 PM org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider configure
INFO: HHH010002: C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://127.0.0.1:3306/...
Sep 15, 2012 9:19:28 PM org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider configure
INFO: HHH000046: Connection properties: {user=root, autocommit=true, release_mode=auto}
Sep 15, 2012 9:19:28 PM org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider configure
INFO: HHH000006: Autocommit mode: true
Sep 15, 2012 9:19:28 PM com.mchange.v2.log.MLog <clinit>
INFO: MLog clients using java 1.4+ standard logging.
Sep 15, 2012 9:19:28 PM com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.1 [built 16-January-2007 14:46:42; debug? true; trace: 10]
Sep 15, 2012 9:19:29 PM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
INFO: Initializing c3p0 pool...
Sep 15, 2012 9:19:29 PM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
Sep 15, 2012 9:19:29 PM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation
INFO: HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
Sep 15, 2012 9:19:29 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory
Sep 15, 2012 9:19:29 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory
Sep 15, 2012 9:19:29 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000228: Running hbm2ddl schema update
...
Sep 15, 2012 9:19:31 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 4806 ms
Sep 15, 2012 9:19:31 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-80"]
Sep 15, 2012 9:19:31 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Sep 15, 2012 9:19:31 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 8866 ms
Sep 15, 2012 9:19:31 PM com.sun.jersey.spi.spring.container.servlet.SpringServlet getContext
INFO: Using default applicationContext
Sep 15, 2012 9:19:31 PM com.sun.jersey.spi.spring.container.SpringComponentProviderFactory registerSpringBeans
INFO: Registering Spring bean, ...
Sep 15, 2012 9:19:31 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.13 06/29/2012 05:14 PM'
Sep 15, 2012 9:19:32 PM org.springframework.context.support.AbstractApplicationContext doClose
INFO: Closing Root WebApplicationContext: startup date [Sat Sep 15 21:19:26 EST 2012]; root of context hierarchy
Sep 15, 2012 9:19:32 PM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#2829abfd: defining beans [...]; root of factory hierarchy
Sep 15, 2012 9:19:32 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Sep 15, 2012 9:19:32 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
Sep 15, 2012 9:19:32 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [java-sdk-http-connection-reaper] but has failed to stop it. This is very likely to create a memory leak.
Sep 15, 2012 9:19:32 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassFactory$1] (value [com.sun.xml.bind.v2.ClassFactory$1#911a094]) and a value of type [java.util.WeakHashMap] (value [{class javax.xml.bind.annotation.W3CDomHandler=java.lang.ref.WeakReference#64455932}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Sep 15, 2012 9:19:33 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context []
Sep 15, 2012 9:19:33 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\adubi_000\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.27.0_base\conf\Catalina\localhost\ROOT.xml
Sep 15, 2012 9:19:36 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Sep 15, 2012 9:19:36 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Sat Sep 15 21:19:36 EST 2012]; root of context hierarchy
Sep 15, 2012 9:19:36 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
Sep 15, 2012 9:19:37 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#6b63d42f: defining beans [...]; root of factory hierarchy
Sep 15, 2012 9:19:37 PM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
Sep 15, 2012 9:19:37 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.6.Final}
Sep 15, 2012 9:19:37 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Sep 15, 2012 9:19:37 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Sep 15, 2012 9:19:38 PM org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator instantiateExplicitConnectionProvider
INFO: HHH000130: Instantiating explicit connection provider: org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider
Sep 15, 2012 9:19:38 PM org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider configure
INFO: HHH010002: C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://127.0.0.1:3306/....
Sep 15, 2012 9:19:38 PM org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider configure
INFO: HHH000046: Connection properties: {user=root, autocommit=true, release_mode=auto}
Sep 15, 2012 9:19:38 PM org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider configure
INFO: HHH000006: Autocommit mode: true
Sep 15, 2012 9:19:38 PM com.mchange.v2.log.MLog <clinit>
INFO: MLog clients using java 1.4+ standard logging.
Sep 15, 2012 9:19:38 PM com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.1 [built 16-January-2007 14:46:42; debug? true; trace: 10]
Sep 15, 2012 9:19:38 PM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
INFO: Initializing c3p0 pool...
Sep 15, 2012 9:19:38 PM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
Sep 15, 2012 9:19:38 PM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation
INFO: HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
Sep 15, 2012 9:19:38 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory
Sep 15, 2012 9:19:38 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory
Sep 15, 2012 9:19:39 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000228: Running hbm2ddl schema update
...
Sep 15, 2012 9:19:40 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 4264 ms
Sep 15, 2012 9:19:40 PM org.apache.catalina.util.LifecycleBase start
INFO: The start() method was called on component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] after start() had already been called. The second call will be ignored.
Sep 15, 2012 9:19:41 PM com.sun.jersey.spi.spring.container.servlet.SpringServlet getContext
INFO: Using default applicationContext
Sep 15, 2012 9:19:41 PM com.sun.jersey.spi.spring.container.SpringComponentProviderFactory registerSpringBeans
INFO: Registering Spring bean, ...
Sep 15, 2012 9:19:41 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.13 06/29/2012 05:14 PM'
It is the work of Netbean's maven deploy plugin, which waits for tomcat to start (and load the application as specified in Netbeans-generared ROOT.xml) then tells it to reload it (from a different temporary XML).
A workaround is to edit %CATALINA_BASE%/conf/tomcat-users.xml and change the password of user 'ide' (through which netbeans controls tomcat). Tomcat still loads fine, but deploy-on-save and probably other features won't work.
I'll try looking at the source code of netbeans to see if a better solution is available. This behavior of the deploy plugin is just bizare. Surely it could start Tomcat empty, and then load the app as it's doing in the second step.

Categories

Resources