0
votes

I am using an apache tomcat server with eclipse. When I added the postgresql jar to tomcat, it fails to start and ends on timeout with the message: "Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor". The console output is shown below:

    Sep 04, 2013 12:39:50 AM 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: C:\Program Files (x86)\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files (x86)/Java/jre7/bin/client;C:/Program Files (x86)/Java/jre7/bin;C:/Program Files (x86)/Java/jre7/lib/i386;C:\Program Files\MiKTeX 2.9\miktex\bin;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin;C:\Program Files (x86)\PC Connectivity Solution\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Windows\system32\gs\gs8.71\bin;C:\svn\bin;E:\apache-maven-3.0.5\bin;C:\Program Files\Java\jdk1.7.0_02\bin;C:\JExcel;C:\Program Files (x86)\OpenSSH\bin;C:\osmdata;C:\osm2pgsql;C:\osm2pgsql\x64\;C:\Program Files\MATLAB\R2010a\runtime\win64;C:\Program Files\MATLAB\R2010a\bin;E:\eclipse;;.
Sep 04, 2013 12:39:50 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:scriptsynth' did not find a matching property.
Sep 04, 2013 12:39:50 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Sep 04, 2013 12:39:50 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Sep 04, 2013 12:39:50 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1162 ms
Sep 04, 2013 12:39:50 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 04, 2013 12:39:50 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.41
Sep 04, 2013 12:39:57 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Sep 04, 2013 12:39:57 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
00:39:57.572 [localhost-startStop-1] INFO  o.s.web.context.ContextLoader - Root WebApplicationContext: initialization started
00:39:57.761 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Wed Sep 04 00:39:57 IST 2013]; root of context hierarchy
00:39:57.884 [localhost-startStop-1] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [applicationContext.xml]
00:39:58.656 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter#1c212b0' of type [class org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
00:39:58.727 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'dataSource' of type [class org.springframework.jndi.JndiObjectFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
00:39:58.727 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'dataSource' of type [class org.apache.tomcat.dbcp.dbcp.BasicDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
00:39:58.752 [localhost-startStop-1] INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean - Building JPA container EntityManagerFactory for persistence unit 'default'
00:39:59.167 [localhost-startStop-1] INFO  o.h.annotations.common.Version - HCANN000001: Hibernate Commons Annotations {4.0.2.Final}
00:39:59.182 [localhost-startStop-1] INFO  org.hibernate.Version - HHH000412: Hibernate Core {4.2.5.Final}
00:39:59.185 [localhost-startStop-1] INFO  org.hibernate.cfg.Environment - HHH000206: hibernate.properties not found
00:39:59.188 [localhost-startStop-1] INFO  org.hibernate.cfg.Environment - HHH000021: Bytecode provider name : javassist
00:39:59.236 [localhost-startStop-1] INFO  org.hibernate.ejb.Ejb3Configuration - HHH000204: Processing PersistenceUnitInfo [
    name: default
    ...]
00:39:59.461 [localhost-startStop-1] INFO  o.h.s.j.c.i.ConnectionProviderInitiator - HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider

When I remove the postgresql jar from tomcat's lib folder, it starts fine as before.

PostgreSQL seems to be running as I can conenct to it from pgAdmin

Any ideas on how to fix this?

1
Only add jars to your app, not to Tomcat itself. And please include ALL of the console output. None of these are error or warning severity. - nitind
@nitind - I have included more from the console (as much as the word limit allowed me). The console gets stuck for sometime on the last line and then tomcat displays the message: "Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor" - user1628340
Maybe pastebin the rest? Or just the parts that actually mention exceptions and aren't "DEBUG" output? - nitind
@nitind - please see the edited content . Actually there's no exception whatsover .. it just gets kind of stcuk at the last line of the output and then there is a timeout - user1628340
We need all there output until the line that says: "Server started in XXXXXms". - Leonel Sanches da Silva

1 Answers

1
votes

hey i had this same problem i hope this could help i just added a new jar into Tomcat directory.... a 400 kb a small one. and i sorted in the tomcat/lib/directory to bigger to smaller and i get the start time double it from 30 seconds to 60 seconds. was driving me nuts. later i sorted the tomcat/lib/directory from smaller to bigger and get back my 32 seconds i think here is the problem is called branch predictionplease take a look to this topics.

Why is it faster to process a sorted array than an unsorted array?

and

http://en.wikipedia.org/wiki/Branch_predictor

i hope really can helps somebody..