java.io.FileNotFoundException: JAR entry META-INF/services/org.codehaus.groovy.runtime.ExtensionModule


(Endre Stølsvik) #1

I have a “self-contained WAR file” with Jetty set up. I am trying to execute this with ant.java (due to how I want the system to act: When main finishes, I want the task to finish, with Jetty running in the background).

On command line, this works just fine.

In Eclipse, I get this Exception: java.io.FileNotFoundException: JAR entry META-INF/services/org.codehaus.groovy.runtime.ExtensionModule

The WAR notably uses Logback and the “Gaffer Configurator”, which is “configure your logging using Groovy”.

I googled and found this one: https://github.com/groovy/groovy-core/pull/258

Here is the full stacktrace:

[ant:java] 12:51:43,451 |-ERROR in ch.qos.logback.classic.util.ContextInitializer@76f1eedd - Failed to instantiate ch.qos.logback.classic.gaffer.GafferConfigurator java.lang.reflect.InvocationTargetException
[ant:java]
at java.lang.reflect.InvocationTargetException
[ant:java]
at
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[ant:java]
at
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[ant:java]
at
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[ant:java]
at
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
[ant:java]
at
at ch.qos.logback.classic.gaffer.GafferUtil.newGafferConfiguratorInstance(GafferUtil.java:52)
[ant:java]
at
at ch.qos.logback.classic.gaffer.GafferUtil.runGafferConfiguratorOn(GafferUtil.java:41)
[ant:java]
at
at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:65)
[ant:java]
at
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
[ant:java]
at
at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
[ant:java]
at
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
[ant:java]
at
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
[ant:java]
at
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
[ant:java]
at
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
[ant:java]
at
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
[ant:java]
at
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
[ant:java]
at
at com.customer.JettyWar.start(JettyWar.java:150)
[ant:java]
at
at com.customer.JettyWar.main(JettyWar.java:96)
[ant:java]
at
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ant:java]
at
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[ant:java]
at
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ant:java]
at
at java.lang.reflect.Method.invoke(Method.java:606)
[ant:java]
at
at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
[ant:java]
at
at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
[ant:java]
at
at org.apache.tools.ant.taskdefs.Java.run(Java.java:771)
[ant:java]
at
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221)
[ant:java]
at
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
[ant:java]
at
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
[ant:java]
at
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[ant:java]
at
at sun.reflect.GeneratedMethodAccessor332.invoke(Unknown Source)
[ant:java]
at
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ant:java]
at
at java.lang.reflect.Method.invoke(Method.java:606)
[ant:java]
at
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[ant:java]
at
at groovy.util.AntBuilder.performTask(AntBuilder.java:260)
[ant:java]
at
at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:220)
[ant:java]
at
at org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted(BasicAntBuilder.java:71)
[ant:java]
at
at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
[ant:java]
at
at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:170)
[ant:java]
at
at org.gradle.api.internal.project.ant.BasicAntBuilder.doInvokeMethod(BasicAntBuilder.java:86)
[ant:java]
at
at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
[ant:java]
at
at org.gradle.api.internal.project.DefaultAntBuilder.super$3$invokeMethod(DefaultAntBuilder.groovy)
[ant:java]
at
at sun.reflect.GeneratedMethodAccessor257.invoke(Unknown Source)
[ant:java]
at
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ant:java]
at
at java.lang.reflect.Method.invoke(Method.java:606)
[ant:java]
at
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
[ant:java]
at
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
[ant:java]
at
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1047)
[ant:java]
at
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128)
[ant:java]
at
at org.gradle.api.internal.project.DefaultAntBuilder.invokeMethod(DefaultAntBuilder.groovy:37)
[ant:java]
at
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
[ant:java]
at
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
[ant:java]
at
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
[ant:java]
at
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
[ant:java]
at
at build_3abp62dg6o7faf0hvr598adpeg.runJettyWar_antJava(..##..\build.gradle:357)
[ant:java]
at
at build_3abp62dg6o7faf0hvr598adpeg.runJettyWar_antJava(..##..\build.gradle)
[ant:java]
at
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ant:java]
at
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[ant:java]
at
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ant:java]
at
at java.lang.reflect.Method.invoke(Method.java:606)
[ant:java]
at
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
[ant:java]
at
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
[ant:java]
at
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:361)
[ant:java]
at
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
[ant:java]
at
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
[ant:java]
at
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
[ant:java]
at
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
[ant:java]
at
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:137)
[ant:java]
at
at build_3abp62dg6o7faf0hvr598adpeg$_run_closure22.doCall(..##..\build.gradle:396)
[ant:java]
at
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ant:java]
at
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[ant:java]
at
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ant:java]
at
at java.lang.reflect.Method.invoke(Method.java:606)
[ant:java]
at
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
[ant:java]
at
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
[ant:java]
at
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
[ant:java]
at
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
[ant:java]
at
at groovy.lang.Closure.call(Closure.java:412)
[ant:java]
at
at groovy.lang.Closure.call(Closure.java:425)
[ant:java]
at
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:502)
[ant:java]
at
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:483)
[ant:java]
at
at org.gradle.api.internal.tasks.TaskStatusNagger$1.execute(TaskStatusNagger.java:77)
[ant:java]
at
at org.gradle.api.internal.tasks.TaskStatusNagger$1.execute(TaskStatusNagger.java:73)
[ant:java]
at
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
[ant:java]
at
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
[ant:java]
at
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
[ant:java]
at
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
[ant:java]
at
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
[ant:java]
at
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
[ant:java]
at
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
[ant:java]
at
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
[ant:java]
at
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
[ant:java]
at
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
[ant:java]
at
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
[ant:java]
at
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
[ant:java]
at
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
[ant:java]
at
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
[ant:java]
at
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
[ant:java]
at
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
[ant:java]
at
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
[ant:java]
at
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
[ant:java]
at
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
[ant:java]
at
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
[ant:java]
at
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
[ant:java]
at
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
[ant:java]
at
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
[ant:java]
at
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
[ant:java]
at
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
[ant:java]
at
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
[ant:java]
at
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
[ant:java]
at
at org.gradle.tooling.internal.provider.BuildModelAction.run(BuildModelAction.java:70)
[ant:java]
at
at org.gradle.tooling.internal.provider.BuildModelAction.run(BuildModelAction.java:30)
[ant:java]
at
at org.gradle.tooling.internal.provider.ConfiguringBuildAction.run(ConfiguringBuildAction.java:108)
[ant:java]
at
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:45)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:42)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:34)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:71)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:69)
[ant:java]
at
at org.gradle.util.Swapper.swap(Swapper.java:38)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:69)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:60)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:45)
[ant:java]
at
at org.gradle.launcher.daemon.server.DaemonStateCoordinator.runCommand(DaemonStateCoordinator.java:186)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.doBuild(StartBuildOrRespondWithBusy.java:49)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:36)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(DaemonHygieneAction.java:39)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:32)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
[ant:java]
at
at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:51)
[ant:java]
at
at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.handleCommand(DefaultIncomingConnectionHandler.java:155)
[ant:java]
at
at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.receiveAndHandleCommand(DefaultIncomingConnectionHandler.java:128)
[ant:java]
at
at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.run(DefaultIncomingConnectionHandler.java:116)
[ant:java]
at
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
[ant:java]
at
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[ant:java]
at
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[ant:java]
at
at java.lang.Thread.run(Thread.java:744)
[ant:java] Caused by: java.lang.ExceptionInInitializerError
[ant:java]
at
at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:162)
[ant:java]
at
at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:192)
[ant:java]
at
at ch.qos.logback.classic.gaffer.GafferConfigurator.$getStaticMetaClass(GafferConfigurator.groovy)
[ant:java]
at
at ch.qos.logback.classic.gaffer.GafferConfigurator.<init>(GafferConfigurator.groovy)
[ant:java]
at
... 153 common frames omitted
[ant:java] Caused by: groovy.lang.GroovyRuntimeException: Unable to load module META-INF descriptor
[ant:java]
at
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromMetaInf(ExtensionModuleScanner.java:68)
[ant:java]
at
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModules(ExtensionModuleScanner.java:54)
[ant:java]
at
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:110)
[ant:java]
at
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:71)
[ant:java]
at
at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:33)
[ant:java]
at
... 157 common frames omitted
[ant:java] Caused by: java.io.FileNotFoundException: JAR entry META-INF/services/org.codehaus.groovy.runtime.ExtensionModule not found in ..##..\build-gradle\xyz-DEVELOPMENT_VERSION.war
[ant:java]
at
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:140)
[ant:java]
at
at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:150)
[ant:java]
at
at java.net.URL.openStream(URL.java:1037)
[ant:java]
at
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromMetaInf(ExtensionModuleScanner.java:65)
[ant:java]
at
... 161 common frames omitted