Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 74311 invoked from network); 20 Feb 2008 15:04:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2008 15:04:18 -0000 Received: (qmail 84801 invoked by uid 500); 20 Feb 2008 15:04:12 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 84773 invoked by uid 500); 20 Feb 2008 15:04:12 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 84764 invoked by uid 99); 20 Feb 2008 15:04:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Feb 2008 07:04:12 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Feb 2008 15:03:48 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D8AE3234C043 for ; Wed, 20 Feb 2008 07:03:43 -0800 (PST) Message-ID: <862953555.1203519823885.JavaMail.jira@brutus> Date: Wed, 20 Feb 2008 07:03:43 -0800 (PST) From: "Michael Dick (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Resolved: (OPENJPA-518) openJpa jar is being locked causing future deployments on an app server to fail In-Reply-To: <12421525.1203116768496.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Dick resolved OPENJPA-518. ---------------------------------- Resolution: Fixed Fix Version/s: 1.1.0 1.0.3 > openJpa jar is being locked causing future deployments on an app server to fail > ------------------------------------------------------------------------------- > > Key: OPENJPA-518 > URL: https://issues.apache.org/jira/browse/OPENJPA-518 > Project: OpenJPA > Issue Type: Bug > Components: lib > Affects Versions: 1.0.1 > Environment: Windows XP, Sun PE Application Server 8.1, JDK 1.5.0_14-b03, Spring 2.5 > Reporter: Adam Toback > Assignee: Michael Dick > Priority: Minor > Fix For: 1.0.3, 1.1.0 > > Original Estimate: 0.17h > Remaining Estimate: 0.17h > > So when I deploy my war file on the application server the first time, everything works fine. However, if I then try to undeploy or redeploy over the existing version the deployment will fail because the openjpa.jar in the WEB-INF/lib directory of my war file is locked. > I did track down the bug to: > org.apache.openjpa.lib.util.Services > The addResources method is opening a URL Connection and not performing a setUseCaches(false). I made the following changes, implemented the new jar in my webapp and it fixed the problem. > private static void addResources(URL url, Set set) throws IOException { > InputStream in = null; > BufferedReader reader = null; > try { > java.net.URLConnection ucon = url.openConnection(); > ucon.setUseCaches(false); > in = ucon.getInputStream(); > reader = new BufferedReader(new InputStreamReader(in)); > String line; > while ((line = reader.readLine()) != null) { > if (line.trim().startsWith("#") > || line.trim().length() == 0) > continue; > StringTokenizer tok = new StringTokenizer(line, "# \t"); > if (tok.hasMoreTokens()) { > String next = tok.nextToken(); > if (next != null) { > next = next.trim(); > if (next.length() > 0 && !next.startsWith("#")) > set.add(next); > } > } > } > } > catch (Exception e) { > throw new IOException(e.toString()); > } > finally { > try { reader.close(); } catch (IOException re) {} > try { in.close(); } catch (IOException ioe) {} > } > } > Only the setUseCaches(false) should be necessary, but I was just making sure that anything that was opened was closed. > Thanks, > Adam -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.