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 6808D200C33 for ; Fri, 24 Feb 2017 14:03:50 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 66BC5160B5C; Fri, 24 Feb 2017 13:03:50 +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 B1CE5160B69 for ; Fri, 24 Feb 2017 14:03:49 +0100 (CET) Received: (qmail 1362 invoked by uid 500); 24 Feb 2017 13:03:48 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 1351 invoked by uid 99); 24 Feb 2017 13:03:48 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2017 13:03:48 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 4BB4F1A0085 for ; Fri, 24 Feb 2017 13:03:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -2.346 X-Spam-Level: X-Spam-Status: No, score=-2.346 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-2.999, SPF_NEUTRAL=0.652, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id NvTWvCdQItHz for ; Fri, 24 Feb 2017 13:03:47 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id CFB7D5F647 for ; Fri, 24 Feb 2017 13:03:46 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5772DE0901 for ; Fri, 24 Feb 2017 13:03:45 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3F40924140 for ; Fri, 24 Feb 2017 13:03:44 +0000 (UTC) Date: Fri, 24 Feb 2017 13:03:44 +0000 (UTC) From: "Karl Pauls (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (FELIX-5103) ArrayIndexOutOfBoundsException during bundle update MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 24 Feb 2017 13:03:50 -0000 [ https://issues.apache.org/jira/browse/FELIX-5103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Karl Pauls resolved FELIX-5103. ------------------------------- Resolution: Fixed I'm pretty sure this is fixed (or at least doesn't apply anymore). Please reopen if you still think it applies. > ArrayIndexOutOfBoundsException during bundle update > --------------------------------------------------- > > Key: FELIX-5103 > URL: https://issues.apache.org/jira/browse/FELIX-5103 > Project: Felix > Issue Type: Bug > Components: Framework > Affects Versions: framework-4.2.1, framework-5.2.0 > Reporter: Bram Pouwelse > Assignee: Karl Pauls > > I have traces like the one below quite often when bndtools is updating bundles in a running framework. > {code} > ! Error in updating the framework from the properties: Index: 0, Size: 0 > ! Bundle files does not exist: /Users/brampouwelse/git-repos/path/to/project/generated/mybundle.jar > ERROR: Bundle mybundle [251] Unable to update the bundle. (java.lang.IndexOutOfBoundsException: Index: 0, Size: 0) > java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 > at java.util.ArrayList.rangeCheck(ArrayList.java:653) > at java.util.ArrayList.get(ArrayList.java:429) > at org.apache.felix.framework.BundleImpl.adapt(BundleImpl.java:1064) > at org.apache.felix.framework.BundleImpl.getSymbolicName(BundleImpl.java:896) > at org.apache.felix.framework.BundleImpl.createRevision(BundleImpl.java:1226) > at org.apache.felix.framework.BundleImpl.revise(BundleImpl.java:1141) > at org.apache.felix.framework.Felix.updateBundle(Felix.java:2282) > at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:973) > at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:960) > at aQute.launcher.Launcher.synchronizeFiles(Launcher.java:534) > at aQute.launcher.Launcher.update(Launcher.java:405) > at aQute.launcher.Launcher$1.run(Launcher.java:194) > at java.util.TimerThread.mainLoop(Timer.java:555) > at java.util.TimerThread.run(Timer.java:505) > ! Failed to update bundle /Users/brampouwelse/git-repos/path/to/project/generated/mybundle.jar, exception Update of bundle mybundle [251] failed. > java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 > at java.util.ArrayList.rangeCheck(ArrayList.java:653) > at java.util.ArrayList.get(ArrayList.java:429) > at org.apache.felix.framework.BundleImpl.adapt(BundleImpl.java:1064) > ERROR: Bundle myotherbundle [252] Unable to update the bundle. (java.lang.IndexOutOfBoundsException: Index: 0, Size: 0) > at org.apache.felix.framework.BundleImpl.getSymbolicName(BundleImpl.java:896) > at org.apache.felix.framework.BundleImpl.createRevision(BundleImpl.java:1226) > at org.apache.felix.framework.BundleImpl.revise(BundleImpl.java:1141) > at org.apache.felix.framework.Felix.updateBundle(Felix.java:2282) > at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:973) > at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:960) > at aQute.launcher.Launcher.synchronizeFiles(Launcher.java:534) > at aQute.launcher.Launcher.update(Launcher.java:405) > at aQute.launcher.Launcher$1.run(Launcher.java:194) > at java.util.TimerThread.mainLoop(Timer.java:555) > at java.util.TimerThread.run(Timer.java:505) > ! Failed to update bundle /Users/brampouwelse/git-repos/path/to/project/generated/myotherbundle.jar, exception Update of bundle myotherbundle [252] failed. > {code} > Just had a look at the Felix code and this part is interesting. > {code:title=BundleImpl.java} > synchronized void revise(String location, InputStream is) > throws Exception > { > // This operation will increase the revision count for the bundle. > m_archive.revise(location, is); > try > { > BundleRevision revision = createRevision(true); > addRevision(revision); > } > catch (Exception ex) > { > m_archive.rollbackRevise(); > throw ex; > } > } > {code} > If the {{createRevision}} call throws an exception {{m_archive.rollbackRevise()}} is called this is removing revision at index 0 but the new revision was never added so it's removing the current revision instead of the new revision. > Link to the bndtools issue: https://github.com/bndtools/bndtools/issues/1217 -- This message was sent by Atlassian JIRA (v6.3.15#6346)