Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gretty-farm plugin throws IllegalStateException: zip file closed #24

Closed
fowlie opened this issue May 23, 2014 · 12 comments
Closed

gretty-farm plugin throws IllegalStateException: zip file closed #24

fowlie opened this issue May 23, 2014 · 12 comments

Comments

@fowlie
Copy link

fowlie commented May 23, 2014

When defining a farm extension with two or more webapps, it will deploy the first webapp just fine, but then it will throw an IllegalStateException for the rest of the webapps.

2014-05-23 11:54:34.320 WARN - Failed startup of context o.e.j.w.WebAppContext@44a02b9c{/webshop-car,file:/C:/workspace/webshop/PI/webshop-car/build/inplaceWebapp/,null}
java.lang.IllegalStateException: zip file closed
at java.util.zip.ZipFile.ensureOpen(ZipFile.java:634) ~[na:1.7.0_55]
at java.util.zip.ZipFile.getInputStream(ZipFile.java:347) ~[na:1.7.0_55]
at java.util.jar.JarFile.getInputStream(JarFile.java:409) ~[na:1.7.0_55]
at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:162) ~[na:1.7.0_55]
at org.eclipse.jetty.util.resource.URLResource.getInputStream(URLResource.java:219) ~[jetty-util-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.util.resource.JarResource.getInputStream(JarResource.java:121) ~[jetty-util-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.webapp.Descriptor.parse(Descriptor.java:65) ~[jetty-webapp-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.webapp.WebDescriptor.parse(WebDescriptor.java:148) ~[jetty-webapp-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.webapp.FragmentDescriptor.parse(FragmentDescriptor.java:64) ~[jetty-webapp-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.webapp.MetaData.addFragment(MetaData.java:248) ~[jetty-webapp-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.webapp.FragmentConfiguration.findWebFragments(FragmentConfiguration.java:84) ~[jetty-webapp-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.webapp.FragmentConfiguration.preConfigure(FragmentConfiguration.java:44) ~[jetty-webapp-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:454) ~[jetty-webapp-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:490) ~[jetty-webapp-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) [jetty-util-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jettyomponent.ContainerLifeCycle.start(ContainerLifeCycle.java:117) [jetty-util-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:99) [jetty-util-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60) [jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:154) [jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) [jetty-util-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:117) [jetty-util-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.server.Server.start(Server.java:355) [jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:99) [jetty-util-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60) [jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.server.Server.doStart(Server.java:324) [jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) [jetty-util-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.util.component.LifeCycle$start.call(Unknown Source) [jetty-util-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) [groovy-all-1.8.6.jar:1.8.6]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) [groovy-all-1.8.6.jar:1.8.6]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112) [groovy-all-1.8.6.jar:1.8.6]
at org.akhikhl.gretty.RunnerBase.startServer(RunnerBase.groovy:82) [gretty-helper-com0.19.jar:na]
at org.akhikhl.gretty.RunnerBase$startServer.call(Unknown Source) [gretty-helper-commons-0.0.19.jar:na]
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) [groovy-all-1.8.6.jar:1.8.6]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) [groovy-all-1.8.6.jar:1.8.6]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112) [groovy-all-1.8.6.jar:1.8.6]
at org.akhikhl.gretty.RunnerThread.run(RunnerThread.groovy:28) [gretty-helper-commons-0.0.19.jar:na]

@akhikhl
Copy link
Owner

akhikhl commented May 23, 2014

This error is strange. It seems that it's not caused by anything in Gretty sources. This stackoverflow thread gives a hint, that the problem is present in Jetty in general.

Could you, please, try the following:

  1. Create file "jetty.xml" in the root of the farm project (i.e. of the project where you apply 'gretty-farm' and from where you run gradle farmRun), insert code:

    <?xml version="1.0"?>
    <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
    
    <Configure id="Server" class="org.eclipse.jetty.server.Server">
      <Set class="org.eclipse.jetty.util.resource.Resource" name="defaultUseCaches">false</Set>
    </Configure>
  2. Try running a farm again.
    Check: you should see a message:

    Configuring server from /home/user/Projects/testgretty/jetty.xml
    

    that means: Gretty found "jetty.xml" and is using it.

What is the result? Is error still there?

@akhikhl
Copy link
Owner

akhikhl commented May 23, 2014

BTW, are your web-apps using web-fragments? Is there a situation that web-apps A and B are both using the same web-fragment C?

@fowlie
Copy link
Author

fowlie commented May 23, 2014

We have no web fragments. Adding the jetty.xml fixed the problem! ...however when opening the url in the browser I get org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required. I guess this would be something entirely different problem...

@fowlie fowlie closed this as completed May 23, 2014
@akhikhl
Copy link
Owner

akhikhl commented May 23, 2014

I'm glad to hear this problem is solved 😄
I will incorporate appropriate change to Gretty sources, so that defaultUseCaches is set automatically, without the need for setting in "jetty.xml".
On JasperException: ready to open new issue?

@fowlie
Copy link
Author

fowlie commented May 23, 2014

Sadly I cannot reproduce the JasperException anymore. I'm just getting Exception in thread "qtp530608225-19" now, and no stack traces at all in the console. Any tips on where to look?

@akhikhl
Copy link
Owner

akhikhl commented May 23, 2014

Maybe, we should try to isolate the problem? Is "qtp" reproducible, if each web-app is started separately (by jettyRun)?

@fowlie
Copy link
Author

fowlie commented May 23, 2014

We have about 10 subprojects in our project right now. I'm able to deploy three modules at the same time with no errors, which looks very promosing! And so when I add the fourth module, I suddenly get the NativeException from rubygrapefruit.

@akhikhl
Copy link
Owner

akhikhl commented May 23, 2014

Could you, please, you provide a stacktrace for NativeException from rubygrapefruit?
I'll try to find a solution ASAP.

@fowlie
Copy link
Author

fowlie commented May 23, 2014

This is all I get:

:farmRun
scanInterval not specified (or zero), scanning disabled
Exception in thread "Thread-9" org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:
\Program Files\Java\jdk1.7.0_55\bin\java.exe''
at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:196)
at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:325)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:83)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:6
4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'C:\Program Files\Java\jdk1.7.0_55\bin\java.exe'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WindowsProcessLauncher.start(WindowsProcessLauncher.java:22)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:65)
... 4 more
Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.7.0_55\bin\java.exe" (in directory "C:\work
space\webshop\PI"): CreateProcess error=206, Filnavnet eller filtypen er for lang
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 7 more
Caused by: java.io.IOException: CreateProcess error=206, Filnavnet eller filtypen er for lang
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:385)
at java.lang.ProcessImpl.start(ProcessImpl.java:136)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
... 8 more

@akhikhl
Copy link
Owner

akhikhl commented May 23, 2014

Hurray-hurray! I reproduced it on Windows 😄
Now things are simple, please expect the solution coming soon.

@fowlie
Copy link
Author

fowlie commented May 23, 2014

Thanks a lot, you are a true life saver 😃

@akhikhl
Copy link
Owner

akhikhl commented May 23, 2014

In the meantime the problem is fixed. New release comes in the next 30 minutes.

akhikhl added a commit that referenced this issue May 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants