添加postgresql jar后Tomcat无法启动

时间:2013-09-03 17:25:30

标签: eclipse apache postgresql tomcat

我正在使用带有eclipse的apache tomcat服务器。当我将postgresql jar添加到tomcat时,它无法启动并在超时结束时显示消息:“localhost上的服务器Tomcat v7.0服务器无法在45秒内启动。如果服务器需要更多时间,请尝试增加超时时间服务器编辑器“。控制台输出如下所示:

    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

当我从tomcat的lib文件夹中删除postgresql jar时,它会像以前一样正常启动。

PostgreSQL似乎正在运行,因为我可以从pgAdmin

连接到它

有关如何解决此问题的任何想法?

1 个答案:

答案 0 :(得分:1)

嘿,我有同样的问题,我希望这可以帮助我刚刚在Tomcat目录中添加了一个新的jar .... 400 kb一个小的。然后我在tomcat/lib/目录中排序到更大到更小,我得到的开始时间是30 seconds to 60 seconds的两倍。让我疯了后来我将tomcat/lib/目录从小到大排序并取回我的32秒我想这里的问题叫做branch prediction请看看这个主题。

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

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

我希望真的可以帮助别人..

相关问题