Search code examples
javamavenhibernate-toolsjboss-tools

hibernate-tools maven dependency causing timeout scanning annotations


On Windows , when I am running jetty mvn:run I am getting Timeout error as below. I found memory consumption was aoround 170 MB when this timesout.

However same pom.xml configuration is running without timeout in mac and ubuntu.

mvn jetty:run

2014-09-21 14:50:25.510:INFO:oejs.Server:main: jetty-9.1.1.v20140108
2014-09-21 14:52:50.493:INFO:oeja.AnnotationConfiguration:main: Scanned 1 contai
ner path jars, 90 WEB-INF/lib jars, 1 WEB-INF/classes dirs in 143202ms for conte
xt o.e.j.m.p.JettyWebAppContext@1161acd{/MY_PROJECT,file:/C:/MY_PC/src/MY_PROJECT
/src/main/webapp/,STARTING}{file:/C:/MY_PC/src/MY_PROJECT/src/main/webapp/}
2014-09-21 14:52:50.495:WARN:oejw.WebAppContext:main: Failed startup of context
o.e.j.m.p.JettyWebAppContext@1161acd{/MY_PROJECT,file:/C:/MY_PC/src/MY_PROJECT/sr
c/main/webapp/,STARTING}{file:/C:/MY_PC/src/MY_PROJECT/src/main/webapp/}
java.lang.Exception: Timeout scanning annotations
        at org.eclipse.jetty.annotations.AnnotationConfiguration.scanForAnnotati
ons(AnnotationConfiguration.java:560)
        at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(Annot
ationConfiguration.java:441)
        at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:4
66)
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.jav
a:1342)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandle
r.java:743)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492
)
        at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebApp
Context.java:282)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:69)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLi
feCycle.java:117)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Container
LifeCycle.java:99)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHand
ler.java:60)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(Con
textHandlerCollection.java:154)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:69)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLi
feCycle.java:117)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Container
LifeCycle.java:99)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHand
ler.java:60)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:69)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLi
feCycle.java:117)
        at org.eclipse.jetty.server.Server.start(Server.java:355)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Container
LifeCycle.java:99)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHand
ler.java:60)
        at org.eclipse.jetty.server.Server.doStart(Server.java:324)
        at org.eclipse.jetty.maven.plugin.JettyServer.doStart(JettyServer.java:6
8)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:69)
        at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJ
ettyMojo.java:564)
        at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJett
yMojo.java:360)
        at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.java
:168)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:132)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThre
adedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:120)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)
2014-09-21 14:52:50.617:WARN:oejsh.RequestLogHandler:main: !RequestLog
2014-09-21 14:52:50.758:INFO:oejs.ServerConnector:main: Started ServerConnector@
a2c21a{HTTP/1.1}{0.0.0.0:8585}

When I remove below dependency from pom.xml, it however runs properly ..

         <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-tools</artifactId>
            <version>4.3.1.CR1</version>
        </dependency>

Do we need special configuration for hibernate tools in maven ?


Solution

  • this fixed it

    mvn jetty:run -Dorg.eclipse.jetty.annotations.maxWait=120