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

ZipFile throw IllegalStateException when using springboot 1.4.1 #6681

Closed
DiegoCoronel opened this Issue Nov 5, 2016 · 12 comments

Comments

Projects
None yet
4 participants
@DiegoCoronel
Contributor

DiegoCoronel commented Nov 5, 2016

Guys,

Im completely stuck with this issue, i have 1.3.X working like a charm, but when i try 1.4.1 im having this problem:

Exception in thread "ContainerBackgroundProcessor[StandardEngine[Tomcat]]" java.lang.IllegalStateException: zip file closed
	at java.util.zip.ZipFile.ensureOpen(ZipFile.java:669)
	at java.util.zip.ZipFile.getEntry(ZipFile.java:309)
	at java.util.jar.JarFile.getEntry(JarFile.java:240)
	at java.util.jar.JarFile.getJarEntry(JarFile.java:223)
	at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:1005)
	at sun.misc.URLClassPath.getResource(URLClassPath.java:212)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at com.redhat.ceylon.launcher.CeylonClassLoader.loadClass(CeylonClassLoader.java:208)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1380)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1344)
	at java.lang.Thread.run(Thread.java:745)

and the method that starts this problem:

screen shot 2016-11-05 at 11 40 30

and the moment the error occur:

screen shot 2016-11-05 at 11 40 12

screen shot 2016-11-05 at 11 39 52

Im really unable to know what to do from all this info, i need help to know if exists anything relevant in this info or what should i look for ...

@gavinking asked in gitter about --flat-classpath and yes.. im using same workspace/environment as the version 1.3.8.

This project can be pulled from my branch and its just go in run.ceylon and run as ceylon application.

@gavinking

This comment has been minimized.

Contributor

gavinking commented Nov 5, 2016

FTR I experienced the same problem but I have no clue how to solve it.

Sent from my iPhone

On 5 Nov 2016, at 16:58, Diego Coronel notifications@github.com wrote:

Guys,

Im completely stuck with this issue, i have 1.3.X working like a charm, but when i try 1.4.1 im having this problem:

Exception in thread "ContainerBackgroundProcessor[StandardEngine[Tomcat]]" java.lang.IllegalStateException: zip file closed
at java.util.zip.ZipFile.ensureOpen(ZipFile.java:669)
at java.util.zip.ZipFile.getEntry(ZipFile.java:309)
at java.util.jar.JarFile.getEntry(JarFile.java:240)
at java.util.jar.JarFile.getJarEntry(JarFile.java:223)
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:1005)
at sun.misc.URLClassPath.getResource(URLClassPath.java:212)
at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at com.redhat.ceylon.launcher.CeylonClassLoader.loadClass(CeylonClassLoader.java:208)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1380)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1344)
at java.lang.Thread.run(Thread.java:745)
and the method that starts this problem:

and the moment the error occur:

Im really unable to know what to do from all this info, i need help to know if exists anything relevant in this info or what should i look for ...

@gavinking asked in gitter about --flat-classpath and yes.. im using same workspace/environment as the version 1.3.8.

This project can be pulled from my branch and its just go in run.ceylon and run as ceylon application.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@FroMage FroMage modified the milestone: 1.3.1 Nov 7, 2016

@FroMage

This comment has been minimized.

Contributor

FroMage commented Nov 7, 2016

I don't see how the Spring clearing is related. Does it close the classloader? It doesn't look like it from its source code: https://github.com/spring-projects/spring-framework/blob/master/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java#L151

It looks more like we clear it ourselves after the run method, and that your program continues from a spawned thread.

Except I just checked and we don't clear it.

What you should do is break on ZipFile when it sets closeRequested to see who closes it.

@DiegoCoronel

This comment has been minimized.

Contributor

DiegoCoronel commented Nov 7, 2016

I tried to put breakpoint in each moment that closeRequest is assigned to true and its almost impossible to debug, its like a million of times... here some of these moments:

screen shot 2016-11-07 at 09 52 33

screen shot 2016-11-07 at 09 47 36

But all this means nothing to me, I spent almost 40 min doing next for each time it stopped in breakpoint and i dont know if I was close or not to the moment explodes in spring.

@FroMage

This comment has been minimized.

Contributor

FroMage commented Nov 8, 2016

OK, give me a test I can use?

@DiegoCoronel

This comment has been minimized.

Contributor

DiegoCoronel commented Nov 8, 2016

You can clone this repo: theres a branch springboot1.4.1 then go into bar folder and run it, if you need a zip project i can do it also

@FroMage

This comment has been minimized.

Contributor

FroMage commented Nov 8, 2016

So running my test programmatically it works:


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.4.1.RELEASE)

4524 [main] INFO bar.run_ - Starting run_ on atlantis with PID 1248 (started by stephane in /home/stephane/src/java-eclipse/ceylon/tool-provider)
4525 [main] INFO bar.run_ - No active profile set, falling back to default profiles: default
4598 [main] INFO org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@290995ef: startup date [Tue Nov 08 16:38:20 CET 2016]; root of context hierarchy
6094 [main] INFO org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$e34df30b] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
6494 [main] INFO org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer - Tomcat initialized with port(s): 0 (http)
Nov 08, 2016 4:38:22 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Nov 08, 2016 4:38:22 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.5.5
Nov 08, 2016 4:38:22 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring embedded WebApplicationContext
6607 [localhost-startStop-1] INFO org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 2011 ms
6779 [localhost-startStop-1] INFO org.springframework.boot.web.servlet.ServletRegistrationBean - Mapping servlet: 'dispatcherServlet' to [/]
6783 [localhost-startStop-1] INFO org.springframework.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'characterEncodingFilter' to: [/*]
6784 [localhost-startStop-1] INFO org.springframework.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
6784 [localhost-startStop-1] INFO org.springframework.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'httpPutFormContentFilter' to: [/*]
6784 [localhost-startStop-1] INFO org.springframework.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'requestContextFilter' to: [/*]
7621 [main] INFO liquibase - Successfully acquired change log lock
8241 [main] INFO liquibase - Creating database history table with name: PUBLIC.DATABASECHANGELOG
8243 [main] INFO liquibase - Reading from PUBLIC.DATABASECHANGELOG
8247 [main] INFO liquibase - classpath:/liquibase/db.changelog-master.xml: classpath:/liquibase/database_structure.xml::bar_structure::diego.coronel: Custom SQL executed
8251 [main] INFO liquibase - classpath:/liquibase/db.changelog-master.xml: classpath:/liquibase/database_structure.xml::bar_structure::diego.coronel: Table bar created
8251 [main] INFO liquibase - classpath:/liquibase/db.changelog-master.xml: classpath:/liquibase/database_structure.xml::bar_structure::diego.coronel: ChangeSet classpath:/liquibase/database_structure.xml::bar_structure::diego.coronel ran successfully in 5ms
8259 [main] INFO liquibase - Successfully released change log lock
8346 [main] INFO org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean - Building JPA container EntityManagerFactory for persistence unit 'default'
Nov 08, 2016 4:38:24 PM org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation
INFO: HHH000204: Processing PersistenceUnitInfo [
    name: default
    ...]
Nov 08, 2016 4:38:24 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {5.0.11.Final}
Nov 08, 2016 4:38:24 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Nov 08, 2016 4:38:24 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Nov 08, 2016 4:38:24 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
Nov 08, 2016 4:38:24 PM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
Nov 08, 2016 4:38:24 PM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: HHH000227: Running hbm2ddl schema export
Nov 08, 2016 4:38:24 PM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: HHH000230: Schema export complete
9095 [main] INFO org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default'
9596 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@290995ef: startup date [Tue Nov 08 16:38:20 CET 2016]; root of context hierarchy
9672 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[],methods=[GET],produces=[application/json]}" onto public final java.lang.Iterable<bar.model.Bar> bar.controller.PersonController.findAll()
9673 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/{id}],methods=[GET],produces=[application/json]}" onto public final bar.model.Bar bar.controller.PersonController.find(long)
9673 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public final long bar.controller.PersonController.create(bar.model.Bar)
9714 [main] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
9714 [main] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
9761 [main] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
10227 [main] INFO org.springframework.jmx.export.annotation.AnnotationMBeanExporter - Registering beans for JMX exposure on startup
10269 [main] INFO org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer - Tomcat started on port(s): 41561 (http)
10273 [main] INFO bar.run_ - Started run_ in 6.763 seconds (JVM running for 11.433)
10276 [Thread-4] INFO org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@290995ef: startup date [Tue Nov 08 16:38:20 CET 2016]; root of context hierarchy
10278 [Thread-4] INFO org.springframework.jmx.export.annotation.AnnotationMBeanExporter - Unregistering JMX-exposed beans on shutdown
10280 [Thread-4] INFO org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default'

Or, it shuts down immediatly, with no error. Pretty sure it should not shutdown, though. Perhaps it needs to block?

But running it from the CLI gives me this:

Handler java.util.logging.ConsoleHandler is not defined

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.4.1.RELEASE)

4541 [main] INFO bar.run_ - Starting run_ on atlantis with PID 32533 (/home/stephane/src/java-eclipse/ceylon-spring-boot/bar/modules/bar/1.0.0/bar-1.0.0.car started by stephane in /home/stephane/src/java-eclipse/ceylon-spring-boot/bar)
4541 [main] INFO bar.run_ - No active profile set, falling back to default profiles: default
4601 [main] INFO org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@7dcb913a: startup date [Tue Nov 08 16:27:41 CET 2016]; root of context hierarchy
6086 [main] INFO org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$b5a9efa] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
6437 [main] INFO org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer - Tomcat initialized with port(s): 0 (http)
6542 [localhost-startStop-1] INFO org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 1944 ms
6713 [localhost-startStop-1] INFO org.springframework.boot.web.servlet.ServletRegistrationBean - Mapping servlet: 'dispatcherServlet' to [/]
6716 [localhost-startStop-1] INFO org.springframework.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'characterEncodingFilter' to: [/*]
6716 [localhost-startStop-1] INFO org.springframework.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
6716 [localhost-startStop-1] INFO org.springframework.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'httpPutFormContentFilter' to: [/*]
6717 [localhost-startStop-1] INFO org.springframework.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'requestContextFilter' to: [/*]
7467 [main] INFO liquibase - Successfully acquired change log lock
8068 [main] INFO liquibase - Creating database history table with name: PUBLIC.DATABASECHANGELOG
8070 [main] INFO liquibase - Reading from PUBLIC.DATABASECHANGELOG
8074 [main] INFO liquibase - classpath:/liquibase/db.changelog-master.xml: classpath:/liquibase/database_structure.xml::bar_structure::diego.coronel: Custom SQL executed
8079 [main] INFO liquibase - classpath:/liquibase/db.changelog-master.xml: classpath:/liquibase/database_structure.xml::bar_structure::diego.coronel: Table bar created
8079 [main] INFO liquibase - classpath:/liquibase/db.changelog-master.xml: classpath:/liquibase/database_structure.xml::bar_structure::diego.coronel: ChangeSet classpath:/liquibase/database_structure.xml::bar_structure::diego.coronel ran successfully in 6ms
8089 [main] INFO liquibase - Successfully released change log lock
8176 [main] INFO org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean - Building JPA container EntityManagerFactory for persistence unit 'default'
8885 [main] INFO org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default'
9355 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@7dcb913a: startup date [Tue Nov 08 16:27:41 CET 2016]; root of context hierarchy
9429 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[],methods=[GET],produces=[application/json]}" onto public final java.lang.Iterable<bar.model.Bar> bar.controller.PersonController.findAll()
9429 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/{id}],methods=[GET],produces=[application/json]}" onto public final bar.model.Bar bar.controller.PersonController.find(long)
9429 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public final long bar.controller.PersonController.create(bar.model.Bar)
9468 [main] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
9468 [main] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
9512 [main] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
9959 [main] INFO org.springframework.jmx.export.annotation.AnnotationMBeanExporter - Registering beans for JMX exposure on startup
9973 [main] ERROR org.springframework.boot.SpringApplication - Application startup failed
java.lang.IllegalStateException: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to stop embedded Tomcat
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.stopAndReleaseEmbeddedServletContainer(EmbeddedWebApplicationContext.java:310)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:125)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
    at bar.run_.run(run.ceylon:10)
    at bar.run_.main(run.ceylon)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.redhat.ceylon.compiler.java.runtime.tools.impl.JavaRunnerImpl.invokeMain(JavaRunnerImpl.java:93)
    at com.redhat.ceylon.compiler.java.runtime.tools.impl.JavaRunnerImpl.run(JavaRunnerImpl.java:61)
    at ceylon.modules.bootstrap.CeylonRunTool.startInFlatClasspath(CeylonRunTool.java:336)
    at ceylon.modules.bootstrap.CeylonRunTool.run(CeylonRunTool.java:214)
    at com.redhat.ceylon.common.tools.CeylonTool.run(CeylonTool.java:540)
    at com.redhat.ceylon.common.tools.CeylonTool.execute(CeylonTool.java:416)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.redhat.ceylon.launcher.Launcher.runInJava7Checked(Launcher.java:115)
    at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:41)
    at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:34)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.redhat.ceylon.launcher.Bootstrap.runVersion(Bootstrap.java:162)
    at com.redhat.ceylon.launcher.Bootstrap.runInternal(Bootstrap.java:117)
    at com.redhat.ceylon.launcher.Bootstrap.run(Bootstrap.java:93)
    at com.redhat.ceylon.launcher.Bootstrap.main(Bootstrap.java:85)
Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to stop embedded Tomcat
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.stop(TomcatEmbeddedServletContainer.java:284)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.stopAndReleaseEmbeddedServletContainer(EmbeddedWebApplicationContext.java:306)
    ... 33 more
Caused by: java.lang.IllegalStateException: zip file closed
    at java.util.zip.ZipFile.ensureOpen(ZipFile.java:634)
    at java.util.zip.ZipFile.getEntry(ZipFile.java:305)
    at java.util.jar.JarFile.getEntry(JarFile.java:227)
    at java.util.jar.JarFile.getJarEntry(JarFile.java:210)
    at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:840)
    at sun.misc.URLClassPath.getResource(URLClassPath.java:199)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:358)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at com.redhat.ceylon.launcher.CeylonClassLoader.loadClass(CeylonClassLoader.java:208)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:240)
    at org.apache.catalina.startup.Tomcat.stop(Tomcat.java:366)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.stopTomcat(TomcatEmbeddedServletContainer.java:224)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.stop(TomcatEmbeddedServletContainer.java:276)
    ... 34 more
9975 [main] WARN org.springframework.boot.SpringApplication - Unable to close ApplicationContext
java.lang.IllegalStateException: zip file closed
    at java.util.zip.ZipFile.ensureOpen(ZipFile.java:634)
    at java.util.zip.ZipFile.getEntry(ZipFile.java:305)
    at java.util.jar.JarFile.getEntry(JarFile.java:227)
    at java.util.jar.JarFile.getJarEntry(JarFile.java:210)
    at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:840)
    at sun.misc.URLClassPath.getResource(URLClassPath.java:199)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:358)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at com.redhat.ceylon.launcher.CeylonClassLoader.loadClass(CeylonClassLoader.java:208)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at org.springframework.boot.SpringApplication.isMainThread(SpringApplication.java:911)
    at org.springframework.boot.SpringApplication.getSpringBootExceptionHandler(SpringApplication.java:902)
    at org.springframework.boot.SpringApplication.registerLoggedException(SpringApplication.java:850)
    at org.springframework.boot.SpringApplication.reportFailure(SpringApplication.java:840)
    at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:816)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:326)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
    at bar.run_.run(run.ceylon:10)
    at bar.run_.main(run.ceylon)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.redhat.ceylon.compiler.java.runtime.tools.impl.JavaRunnerImpl.invokeMain(JavaRunnerImpl.java:93)
    at com.redhat.ceylon.compiler.java.runtime.tools.impl.JavaRunnerImpl.run(JavaRunnerImpl.java:61)
    at ceylon.modules.bootstrap.CeylonRunTool.startInFlatClasspath(CeylonRunTool.java:336)
    at ceylon.modules.bootstrap.CeylonRunTool.run(CeylonRunTool.java:214)
    at com.redhat.ceylon.common.tools.CeylonTool.run(CeylonTool.java:540)
    at com.redhat.ceylon.common.tools.CeylonTool.execute(CeylonTool.java:416)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.redhat.ceylon.launcher.Launcher.runInJava7Checked(Launcher.java:115)
    at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:41)
    at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:34)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.redhat.ceylon.launcher.Bootstrap.runVersion(Bootstrap.java:162)
    at com.redhat.ceylon.launcher.Bootstrap.runInternal(Bootstrap.java:117)
    at com.redhat.ceylon.launcher.Bootstrap.run(Bootstrap.java:93)
    at com.redhat.ceylon.launcher.Bootstrap.main(Bootstrap.java:85)
Fatal: Ceylon command could not be executed
   --> zip file closed

It's pretty confusing because it appears to be having an exception when shutting down the server.

@FroMage

This comment has been minimized.

Contributor

FroMage commented Nov 8, 2016

Ha: interestingly, this happens:

Clearing cache for CeylonClassLoader
java.lang.Exception: Stack trace
    at java.lang.Thread.dumpStack(Thread.java:1365)
    at com.redhat.ceylon.launcher.CeylonClassLoader.clearCache(CeylonClassLoader.java:275)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.boot.ClearCachesApplicationListener.clearClassLoaderCaches(ClearCachesApplicationListener.java:46)
    at org.springframework.boot.ClearCachesApplicationListener.clearClassLoaderCaches(ClearCachesApplicationListener.java:51)
    at org.springframework.boot.ClearCachesApplicationListener.onApplicationEvent(ClearCachesApplicationListener.java:36)
    at org.springframework.boot.ClearCachesApplicationListener.onApplicationEvent(ClearCachesApplicationListener.java:30)
@FroMage

This comment has been minimized.

Contributor

FroMage commented Nov 8, 2016

So it looks like Spring Boot has that method name hard-coded, but I'm pretty sure it should not apply to our class loader. I can rename it but throwup.

@bjansen

This comment has been minimized.

Contributor

bjansen commented Nov 8, 2016

Simply rename it to clearCacheFuckYouSpringBoot :)

@FroMage FroMage closed this in 710b307 Nov 8, 2016

@FroMage

This comment has been minimized.

Contributor

FroMage commented Nov 8, 2016

OK fixed, @DiegoCoronel . But you have to prevent the run method from exiting apparently. So read from the command-line or whatever else Spring Boot tells you to do, but it looks like it now returns and spawns a thread.

@DiegoCoronel

This comment has been minimized.

Contributor

DiegoCoronel commented Nov 8, 2016

Thanks @FroMage \o/ .. Ill take a look tonight .

@DiegoCoronel

This comment has been minimized.

Contributor

DiegoCoronel commented Nov 8, 2016

Confirmed. Working perfect, no need to prevent the run method from exiting. Thank you very much @FroMage . Now i can update my demo to latest stable version of springboot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment