Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 10B20200D19 for ; Fri, 6 Oct 2017 17:40:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0F0CD1609DF; Fri, 6 Oct 2017 15:40:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 556F01609D0 for ; Fri, 6 Oct 2017 17:40:56 +0200 (CEST) Received: (qmail 82785 invoked by uid 500); 6 Oct 2017 15:40:55 -0000 Mailing-List: contact notifications-help@freemarker.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@freemarker.incubator.apache.org Delivered-To: mailing list notifications@freemarker.incubator.apache.org Received: (qmail 82773 invoked by uid 99); 6 Oct 2017 15:40:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Oct 2017 15:40:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 99B6FD035C for ; Fri, 6 Oct 2017 15:40:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.02 X-Spam-Level: X-Spam-Status: No, score=-4.02 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, WEIRD_PORT=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id R5ykyseHo365 for ; Fri, 6 Oct 2017 15:40:53 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 79E285F1BA for ; Fri, 6 Oct 2017 15:40:53 +0000 (UTC) Received: (qmail 82769 invoked by uid 99); 6 Oct 2017 15:40:53 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Oct 2017 15:40:53 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E1A52E9688; Fri, 6 Oct 2017 15:40:52 +0000 (UTC) From: psiroky To: notifications@freemarker.incubator.apache.org Reply-To: notifications@freemarker.incubator.apache.org Message-ID: Subject: [GitHub] incubator-freemarker pull request #37: Workaround for classpath resource con... Content-Type: text/plain Date: Fri, 6 Oct 2017 15:40:52 +0000 (UTC) archived-at: Fri, 06 Oct 2017 15:40:57 -0000 GitHub user psiroky opened a pull request: https://github.com/apache/incubator-freemarker/pull/37 Workaround for classpath resource concurrent access issue getResourceAsStream() is not equivalent to getResource() + openStream(). In concurrent env. the former sometimes returns and already closed stream. This is a workaround for the following issue we are encountering when using Freemarker for annotation processing in parallel maven build (-T). This is unfortunately just a workaround and such is not ideal, so fell free to reject this. The stacktrace of the error: ``` 18:44:24 [ERROR] /home/jenkins/workspace/guvnor/upstream-repos/uberfire/uberfire-showcase/uberfire-client-webapp/src/main/java/org/uberfire/client/screens/DemoSplashScreen.java:[34,1] Internal error in org.uberfire.annotations.processors.WorkbenchSplashScreenProcessorjava.lang.ExceptionInInitializerError 18:44:24 [ERROR] at org.uberfire.annotations.processors.AbstractGenerator.(AbstractGenerator.java:44) 18:44:24 [ERROR] at org.uberfire.annotations.processors.SplashScreenActivityGenerator.(SplashScreenActivityGenerator.java:41) 18:44:24 [ERROR] at org.uberfire.annotations.processors.WorkbenchSplashScreenProcessor.(WorkbenchSplashScreenProcessor.java:49) 18:44:24 [ERROR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) .... 18:44:24 [ERROR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 18:44:24 [ERROR] at java.lang.Thread.run(Thread.java:745) 18:44:24 [ERROR] Caused by: java.lang.IllegalStateException: zip file closed 18:44:24 [ERROR] at java.util.zip.ZipFile.ensureOpen(ZipFile.java:669) 18:44:24 [ERROR] at java.util.zip.ZipFile.getEntry(ZipFile.java:309) 18:44:24 [ERROR] at java.util.jar.JarFile.getEntry(JarFile.java:240) 18:44:24 [ERROR] at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:128) 18:44:24 [ERROR] at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:132) 18:44:24 [ERROR] at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:150) 18:44:24 [ERROR] at java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:238) 18:44:24 [ERROR] at freemarker.template.Configuration.(Configuration.java:431) ``` After applying the workaround we never saw that exception again (with several hundreds of builds). You can merge this pull request into a Git repository by running: $ git pull https://github.com/psiroky/incubator-freemarker zip-file-closed Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-freemarker/pull/37.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #37 ---- commit 3d0e5c503ecb81404638e918b6f3778aa3f77a6b Author: Petr Široký Date: 2017-08-23T10:44:54Z Workaround for classpath resource concurrent access issue getResourceAsStream() is not equivalent to getResource() + openStream(). In concurrent env. the former sometimes returns and already closed stream. ---- ---