facebook

Spring boot project on Tomcat slow on start

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #512748 Reply

    afxgroup
    Participant

    Hello,
    i’ve just updated MyEclipse to 2017 version. Now i have a spring boot project that in debug mode tooks 10 minutes to start.. If i start the project without debug it starts in a few seconds without any problem
    I’ve tried several tomcats included the integrated one. Same problem.

    Can you help me? It is really urgent

    #512792 Reply

    Brian Fernandes
    Moderator

    I’m afraid I can’t think of anything that would cause a delayed startup only in debug mode. Got a few ideas and questions:

    1) Are you behind a firewall or do you have restricted access to the Internet? Some processes might run only in debug mode, try to connect to the Internet, and bad timeout behaviour / connection handling could result in your delayed startup.

    2) How are you launching your app – are you using the regular Server debugging launch configuration or something else like the Spring Boot App launch? If you can share a screenshot of your launch configuration, that would help.

    3) Have you tried debugging with a minimalistic, dummy Spring boot app? If that starts in good time, it might be a particular dependency/configuration that’s causing the slow-down and that will help with further research.

    4) When you start debugging, do you get any console output at all – do you see it waiting at any particular prompt? There are several posts about Spring boot applications taking time to start up as well as pausing at some points; the point of the stall might give you some clues.

    Hope this helps,

    #512847 Reply

    afxgroup
    Participant

    1) No indeed in my tries to understand the problem i’ve tried several Java VMs and any time i debug the project the windows firewall popup came up and i’ve always selected to permit all. However i’ve also tried to turn it off and same result. My hardware firewall also doesn’t have any outbound port blocked.

    2) I launch the application in the classic way. Servers->Tomcat->Debug

    3) No. i’ll try

    4) When i start the debug the applications starts correctly and i can see the spring boot log in the console window but for example the boot phase. For example:
    With Debug on: Root WebApplicationContext: initialization completed in 330984 ms (and the web app is not started yet)
    With Debug off: oot WebApplicationContext: initialization completed in 7660 ms

    This is the spring boot log in debug mode. Take a look at Log Time:

    2017-02-22 10:47:46.460  INFO 11216 --- [ost-startStop-1] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@526aff1b: startup date [Wed Feb 22 10:47:46 CET 2017]; root of context hierarchy
    2017-02-22 10:47:47.621  INFO 11216 --- [ost-startStop-1] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
    2017-02-22 10:47:47.701  INFO 11216 --- [ost-startStop-1] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$df9edbec] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2017-02-22 10:47:50.845  INFO 11216 --- [ost-startStop-1] o.s.cloud.commons.util.InetUtils         : Cannot determine local hostname
    2017-02-22 10:47:51.727  INFO 11216 --- [ost-startStop-1] c.a.u.web.SpringBootWebApplication       : No active profile set, falling back to default profiles: default
    2017-02-22 10:47:51.736  INFO 11216 --- [ost-startStop-1] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@610706ea: startup date [Wed Feb 22 10:47:51 CET 2017]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@526aff1b
    2017-02-22 10:48:02.194  INFO 11216 --- [ost-startStop-1] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'hystrixFeature' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.cloud.netflix.hystrix.HystrixCircuitBreakerConfiguration$HystrixWebConfiguration; factoryMethodName=hystrixFeature; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/cloud/netflix/hystrix/HystrixCircuitBreakerConfiguration$HystrixWebConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.cloud.netflix.hystrix.HystrixCircuitBreakerConfiguration; factoryMethodName=hystrixFeature; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/cloud/netflix/hystrix/HystrixCircuitBreakerConfiguration.class]]
    2017-02-22 10:48:38.875  INFO 11216 --- [ost-startStop-1] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'managementServletContext' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.class]]
    2017-02-22 10:49:28.594  WARN 11216 --- [ost-startStop-1] o.s.c.a.ConfigurationClassPostProcessor  : Cannot enhance @Configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
    2017-02-22 10:49:59.932  INFO 11216 --- [ost-startStop-1] o.s.cloud.context.scope.GenericScope     : BeanFactory id=0fffbc13-dc50-3f1a-a191-912383c69eda
    2017-02-22 10:50:16.084  INFO 11216 --- [ost-startStop-1] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
    2017-02-22 10:50:31.729  INFO 11216 --- [ost-startStop-1] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$c384d8ef] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2017-02-22 10:50:45.605  INFO 11216 --- [ost-startStop-1] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cache.annotation.ProxyCachingConfiguration' of type [class org.springframework.cache.annotation.ProxyCachingConfiguration$$EnhancerBySpringCGLIB$$c970f0d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2017-02-22 10:50:48.835  INFO 11216 --- [ost-startStop-1] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration' of type [class org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration$$EnhancerBySpringCGLIB$$10ad3b1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2017-02-22 10:51:06.045  INFO 11216 --- [ost-startStop-1] trationDelegate$BeanPostProcessorChecker : Bean 'spring.cache.CONFIGURATION_PROPERTIES' of type [class org.springframework.boot.autoconfigure.cache.CacheProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2017-02-22 10:51:10.431  INFO 11216 --- [ost-startStop-1] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.cache.CacheManagerCustomizers' of type [class org.springframework.boot.autoconfigure.cache.CacheManagerCustomizers] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2017-02-22 10:51:13.343  INFO 11216 --- [ost-startStop-1] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.cache.GuavaCacheConfiguration' of type [class org.springframework.boot.autoconfigure.cache.GuavaCacheConfiguration$$EnhancerBySpringCGLIB$$58a80c4e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2017-02-22 10:51:17.410  INFO 11216 --- [ost-startStop-1] trationDelegate$BeanPostProcessorChecker : Bean 'cacheManager' of type [class org.springframework.cache.guava.GuavaCacheManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2017-02-22 10:51:18.163  INFO 11216 --- [ost-startStop-1] trationDelegate$BeanPostProcessorChecker : Bean 'cacheAutoConfigurationValidator' of type [class org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration$CacheManagerValidator] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2017-02-22 10:51:24.253  INFO 11216 --- [ost-startStop-1] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$df9edbec] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2017-02-22 10:51:26.262  INFO 11216 --- [ost-startStop-1] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.RefreshEndpointAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.RefreshEndpointAutoConfiguration$$EnhancerBySpringCGLIB$$88fddde2] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2017-02-22 10:51:33.789  INFO 11216 --- [ost-startStop-1] o.a.c.c.C.[.[localhost].[/usermenunew]   : Initializing Spring embedded WebApplicationContext
    2017-02-22 10:51:33.794  INFO 11216 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 222058 ms
    2017-02-22 10:52:37.480  INFO 11216 --- [ost-startStop-1] b.a.w.TomcatWebSocketContainerCustomizer : NonEmbeddedServletContainerFactory detected. Websockets support should be native so this normally is not a problem.

    Another strange issue happens when i save a file. Take a look at the attached image.

    Attachments:
    You must be logged in to view attached files.
    #512850 Reply

    afxgroup
    Participant

    Well i figured out… The problems was the breakpoints i had in breakpoint view….. I’ve removed them and now all works ok.. Sorry for the inconvenience..

    #512853 Reply

    support-swapna
    Moderator

    afxgroup,

    Glad that you resolved the issue. Thank you for getting back to us.
    Please let us know if you see any issues.

    –Swapna
    MyEclipse Support

    #512863 Reply

    afxgroup
    Participant

    Would be appreciated understand why that problem in the attached image happens every time i save a file

    #512947 Reply

    Brian Fernandes
    Moderator

    Can you share with us the entire error log? That would allow us to figure out what’s going wrong with the dialog you’re seeing repeatedly.

    #513239 Reply

    afxgroup
    Participant

    This is the log

    
    !ENTRY org.eclipse.core.jobs 4 2 2017-02-24 11:00:53.634
    !MESSAGE An internal error occurred during: "Building Spring AOP reference model".
    !STACK 0
    java.lang.IllegalArgumentException
    	at org.eclipse.jdt.core.Signature.getTypeErasure(Signature.java:2271)
    	at org.eclipse.jdt.core.Signature.getTypeErasure(Signature.java:2291)
    	at org.eclipse.jdt.internal.core.BinaryMethod.getErasedParameterTypes(BinaryMethod.java:507)
    	at org.eclipse.jdt.internal.core.BinaryMethod.getErasedParameterType(BinaryMethod.java:515)
    	at org.eclipse.jdt.internal.core.BinaryMethod.hashCode(BinaryMethod.java:592)
    	at java.util.HashMap.hash(HashMap.java:338)
    	at java.util.HashMap.get(HashMap.java:556)
    	at org.eclipse.jdt.internal.core.JavaModelCache.getInfo(JavaModelCache.java:142)
    	at org.eclipse.jdt.internal.core.JavaModelManager.getInfo(JavaModelManager.java:2040)
    	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:314)
    	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:302)
    	at org.eclipse.jdt.internal.core.JavaElement.exists(JavaElement.java:220)
    	at org.eclipse.jdt.internal.core.SourceRefElement.getUnderlyingResource(SourceRefElement.java:225)
    	at org.springframework.ide.eclipse.core.model.java.JavaModelSourceLocation.getResource(JavaModelSourceLocation.java:57)
    	at org.springframework.ide.eclipse.beans.core.internal.model.Bean.getElementResource(Bean.java:117)
    	at org.springframework.ide.eclipse.aop.core.internal.model.builder.AopReferenceModelBuilderJob.buildAopReferencesForBeans(AopReferenceModelBuilderJob.java:289)
    	at org.springframework.ide.eclipse.aop.core.internal.model.builder.AopReferenceModelBuilderJob.buildAopReferencesForBeansConfig(AopReferenceModelBuilderJob.java:313)
    	at org.springframework.ide.eclipse.aop.core.internal.model.builder.AopReferenceModelBuilderJob.buildAopReferencesForFile(AopReferenceModelBuilderJob.java:367)
    	at org.springframework.ide.eclipse.aop.core.internal.model.builder.AopReferenceModelBuilderJob.buildAopModel(AopReferenceModelBuilderJob.java:464)
    	at org.springframework.ide.eclipse.aop.core.internal.model.builder.AopReferenceModelBuilderJob.run(AopReferenceModelBuilderJob.java:160)
    	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
    #513567 Reply

    Brian Fernandes
    Moderator

    Thanks for the trace – this is an error in the core of the JDT, very unusual.

    Do you have the right Java compiler settings locally? For instance, are the right Java versions configured in the Java Compiler properties page, and does the project have the right JRE assigned to it?

    You should be able to prevent the AOP builder from running by going to Project properties > Project Facets > Spring and then choose the “General Project Configuration” tab. You can deselect the “AOP Reference Model Builder” here. Alternatively, you could turn this off globally at the preferences level too. Note that this will disable some of the cross-cutting information displayed in the Spring Explorer and some hyperlink based navigation in Spring configuration files, so ideally, it would be good to get the project settings corrected to prevent this error.

    #513569 Reply

    afxgroup
    Participant

    Yes of course. The project starts correctly


    • This reply was modified 7 years, 8 months ago by afxgroup.
    #514194 Reply

    support-tony
    Keymaster

    Sorry for the delay in getting back; we can’t yet track down what has happened yet.

    It’s not clear whether you are seeing this problem when saving any file in the project or only when saving specific files. If it’s the latter, is it possible for you to share such a file with us (you can attach it on a private message if you don’t want to post it here)?

    Also did you try disabling the AOP builder for the project and, if so, did that help?

    #514373 Reply

    afxgroup
    Participant

    Yes i’ve disabled AOP as suggested but no changes and all files cause the same problem. Not only one.

    #514671 Reply

    Brian Fernandes
    Moderator

    afx,

    Just to be sure, did you disable the builder at the project property level? If so, can you disable it at the preference level too (Window > Preferences > Frameworks > Spring)? This builder is reported in the stack trace as the source of the problem, so disabling it really should prevent the error.

    If you close the project you are working on (this is important), create a new Java project and edit some file there, do you still see the problem? This would prove that the problem is specific to the project you are currently working on.

    Apologies for not being able to provide another workaround, primarily, disabling the builder should have shut this down.

Viewing 13 posts - 1 through 13 (of 13 total)
Reply To: Spring boot project on Tomcat slow on start

You must be logged in to post in the forum log in