Springmvc+hibernate to start Tomcat in Eclipse takes a long time to resolve

Source: Internet
Author: User
Tags apache tomcat

Recently in the study of SPRINGMVC development, one question has plagued a long time, that is, to start Tomcat in Eclipse takes a long, about 1 minutes.

Start log:

September 08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log information: Server version:apache tomcat/8.0.36September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log information: Server Built:jun9 2016 13:55:50UTC September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log information: Server number:8.0.36.0September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log info: OS name:windows Server2012R2 September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log information: OS Version:6.3September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log info: architecture:amd64 September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log info: Java home:d:\jdk1.8.0_65\jre September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log information: JVM Version:1.8.0_65-b17 September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log information: JVM vendor:oracle Corporation September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log Info: CATALINA_BASE:E:\CAIHAO4\TRUNK\JAVA\.METADATA\.P LUGINS\ORG.ECLIPSE.WST.SERVER.CORE\TMP1 September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log info: catalina_home:d:\tomcat-8September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log info: Command line argument:-dcatalina.base=E:\CAIHAO4\TRUNK\JAVA\.METADATA\.PLUGINS\ORG.ECLIPSE.WST.SERVER.CORE\TMP1 September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log info: Command line argument:-dcatalina.home=d:\tomcat-8September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log info: Command line argument:-dwtp.deploy=E:\CaiHao4\trunk\Java\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log info: Command line argument:-djava.endorsed.dirs=d:\tomcat-8\endorsed September08, 2016 8:59:01pm Org.apache.catalina.startup.VersionLoggerListener Log info: Command line argument:-dfile.encoding=utf-8September08, 2016 8:59:01pm Org.apache.catalina.core.AprLifecycleListener lifecycleevent Info: The APR based Apache Tomcat Native Library which a Llows optimal performance in production environments is not found on the JAVA.LIBRARY.PATH:D:\JDK1.8.0_65\bin;C:\Windows\Sun\Java\bin; C:\Windows\system32; c:\windows;d:/jdk1.8.0_65/bin/. /jre/bin/server;d:/jdk1.8.0_65/bin/. /jre/bin;d:/jdk1.8.0_65/bin/. /JRE/LIB/AMD64; C:\Program Files (x86) \common Files\netsarang;d:\apache-maven-3.3.3\bin;d:\jdk1.8.0_65\bin; C:\ProgramData\Oracle\Java\javapath; C:\Windows\system32; C:\Windows; C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; C:\Program Files\tortoisesvn\bin; C:\Program Files (x86) \ati Technologies\ati. ace\core-static; C:\Program Files (x86) \microsoft Asp.net\asp.net Web Pages\v1.0\; C:\Program Files (x86) \ Windows Kits\8.1\windows performance toolkit\; C:\Program Files\Microsoft SQL Server\110\tools\binn\; C:\Program Files (x86) \microsoft Sdks\typescript\1.0\; C:\Program Files\Microsoft SQL Server\120\tools\binn\; C:\Program Files (x86) \microsoft SQL Server\100\tools\binn\vsshell\common7\ide\; C:\Program Files (x86) \microsoft SQL server\100\tools\binn\; C:\Program Files\Microsoft SQL Server\100\tools\binn\; C:\Program Files (x86) \microsoft SQL server\100\dts\binn\; C:\Program Files\Microsoft SQL Server\100\dts\binn\;D: \eclipse-jee-neon;;.September 08, 2016 8:59:02pm Org.apache.coyote.AbstractProtocol init info: Initializing protocolhandler["http-nio-8080"]September08, 2016 8:59:02pm Org.apache.tomcat.util.net.NioSelectorPool getsharedselector Info: Using A shared selector for servlet Write/read September 08, 2016 8:59:02pm Org.apache.coyote.AbstractProtocol init info: Initializing protocolhandler["ajp-nio-8009"]September08, 2016 8:59:02pm Org.apache.tomcat.util.net.NioSelectorPool getsharedselector Info: Using A shared selector for servlet Write/read September 08, 2016 8:59:02pm Org.apache.catalina.startup.Catalina Load Info: initialization processed in178°Ms September08, 2016 8:59:02pm Org.apache.catalina.core.StandardService startinternal Info: Starting service Catalina September08, 2016 8:59:02pm Org.apache.catalina.core.StandardEngine startinternal Info: Starting Servlet engine:apache tomcat/8.0.36September08, 2016 8:59:02pm Org.apache.catalina.startup.HostConfig deploydescriptor Info: Deploying configuration Descriptor E:\CaiHao4\ Trunk\java\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\conf\catalina\localhost\web-city.xml September08, 2016 8:59:02pm Org.apache.catalina.startup.SetContextPropertiesRule begin Warning:[Setcontextpropertiesrule]{Context} Setting property ' source ' to ' org.eclipse.jst.j2ee.server:web-city ' didn't not find a matching property. September 08, 2016 8:59:05afternoon Org.apache.jasper.servlet.TldScanner Scanjars info: At least one JAR is scanned for TLDs yet contained no TLDs. Enab Le debug logging for the logger for a complete list of the JARs that were scanned and no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. September08, 2016 8:59:05pm Org.apache.catalina.core.ApplicationContext log information:1Spring webapplicationinitializers detected on classpath September08, 2016 8:59:05pm Org.apache.catalina.core.ApplicationContext Log Info: Initializing Spring root Webapplicationcontext September08, 2016 8:59:05pm Org.springframework.web.context.ContextLoader initwebapplicationcontext Info: Root webapplicationcontext: Initialization started September08, 2016 8:59:05pm Org.springframework.web.context.support.AnnotationConfigWebApplicationContext Preparerefresh Info: Refreshing Root Webapplicationcontext:startup Date[Thu Sep 20:59:05 CST];root of context hierarchySeptember 08, 2016 8:59:05pm Org.springframework.web.context.support.AnnotationConfigWebApplicationContext loadbeandefinitions Info: Registering Annotated classes:[class Com.caihao.city.spring.config.RootConfig]September08, 2016 8:59:05pm Org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor <init> Info: jsr- 330' javax.inject.Inject ' annotation found and supported for autowiring September08, 2016 8:59:06pm Org.hibernate.Version logVersionINFO:HHH000412:Hibernate Core {5.2.2. Final} September08, 2016 8:59:06pm Org.hibernate.cfg.Environment <clinit>info:hhh000206:hibernate.properties not found September08, 2016 8:59:06afternoon org.hibernate.cfg.Environment BuildBytecodeProviderINFO:HHH000021:Bytecode provider Name:javassist September08, 2016 8:59:06pm Org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>info:hcann000001: Hibernate Commons Annotations {5.0.1. Final} September08, 2016 9:00:27pm Org.hibernate.dialect.Dialect <init>info:hhh000400:using dialect: Org.hibernate.dialect.MySQL5Dialect September08, 2016 9:00:29pm Org.springframework.web.context.ContextLoader initwebapplicationcontext Info: Root webapplicationcontext: Initialization completed in84077Ms September08, 2016 9:00:29pm Org.apache.catalina.core.ApplicationContext Log info: Initializing Spring frameworkservlet ' dispatcher ' September08, 2016 9:00:29pm Org.springframework.web.servlet.DispatcherServlet initservletbean Info: Frameworkservlet ' dispatcher ': Initialization started September08, 2016 9:00:29pm Org.springframework.web.context.support.AnnotationConfigWebApplicationContext Preparerefresh Info: Refreshing Webapplicationcontext for namespace ' Dispatcher-servlet ': startup date[Thu Sep 21:00:29 CST];parent:root WebapplicationcontextSeptember 08, 2016 9:00:29pm Org.springframework.web.context.support.AnnotationConfigWebApplicationContext loadbeandefinitions Info: Registering Annotated classes:[class Com.caihao.city.spring.config.WebConfig]September08, 2016 9:00:29pm Org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor <init> Info: jsr- 330' javax.inject.Inject ' annotation found and supported for autowiring September08, 2016 9:00:30Afternoon Org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter Initcontrolleradvicecache info: Looking for @ControllerAdvice: Webapplicationcontext for namespace ' Dispatcher-servlet ': Startup Date[Thu Sep 21:00:29 CST];parent:root WebapplicationcontextSeptember 08, 2016 9:00:30pm org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping Register information: Mapped"{[/],methods=[get]}"onto public java.lang.String com.caihao.city.controller.HomeController.index (Org.springframework.ui.Model) September 08, 2016 9:00:30pm org.springframework.web.servlet.handler.SimpleUrlHandlerMapping registerhandler Info: Mapped URL path[/**]onto handler of type[class Org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler]slf4j:failed to load class"Org.slf4j.impl.StaticLoggerBinder". Slf4j:defaulting to No-operation (NOP) Logger Implementationslf4j:see http://www.slf4j.org/codes.html# Staticloggerbinder for further details. September08, 2016 9:00:30pm Org.springframework.web.servlet.DispatcherServlet initservletbean Info: Frameworkservlet ' dispatcher ': Initialization completed in1088Ms September08, 2016 9:00:30pm Org.apache.catalina.startup.HostConfig deploydescriptor Info: Deployment of configuration Descriptor E:\CaiHao4\ Trunk\java\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\conf\catalina\localhost\web-city.xml has finished Inch87,789Ms September08, 2016 9:00:30pm Org.apache.coyote.AbstractProtocol Start info: Starting Protocolhandler["http-nio-8080"]September08, 2016 9:00:30pm Org.apache.coyote.AbstractProtocol Start info: Starting Protocolhandler["ajp-nio-8009"]September08, 2016 9:00:30pm Org.apache.catalina.startup.Catalina Start info: Server startup in88457 ms

Spring Configuration:

@Bean PublicDataSource DataSource () {Basicdatasource DataSource=NewBasicdatasource (); Datasource.setdriverclassname (Env.getrequiredproperty ("Jdbc.driverclassname")); Datasource.seturl (Env.getrequiredproperty ("Jdbc.url")); Datasource.setusername (Env.getrequiredproperty ("Jdbc.username")); Datasource.setpassword (Env.getrequiredproperty ("Jdbc.password")); Datasource.setinitialsize (Env.getrequiredproperty ("Jdbc.initialsize", Integer.class)); Datasource.setmaxidle (Env.getrequiredproperty ("Jdbc.maxidle", Integer.class)); returnDataSource; } @Bean PublicLocalsessionfactorybean sessionfactory (DataSource DataSource) {Localsessionfactorybean Factorybean=NewLocalsessionfactorybean ();        Factorybean.setdatasource (DataSource); Factorybean.setmappingresources (Newstring[]{"Com/caihao/hibernate/caihao.hbm.xml"                }); Properties Props=NewProperties (); Props.setproperty ("Hibernate.dialect", "Org.hibernate.dialect.MySQL5Dialect"); Props.setproperty ("Hibernate.show_sql", "true"); Props.setproperty ("Hibernate.jdbc.fetch_size", "50");        Factorybean.sethibernateproperties (props); returnFactorybean; }

Workaround add:

Props.setproperty ("Hibernate.temp.use_jdbc_metadata_defaults", "false");

Reference: Http://stackoverflow.com/questions/14445838/hibernate-startup-very-slow

Springmvc+hibernate to start Tomcat in Eclipse takes a long time to resolve

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.