Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EF3B9188FC for ; Thu, 1 Oct 2015 21:26:15 +0000 (UTC) Received: (qmail 50776 invoked by uid 500); 1 Oct 2015 21:26:12 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 50552 invoked by uid 500); 1 Oct 2015 21:26:12 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 50526 invoked by uid 99); 1 Oct 2015 21:26:12 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Oct 2015 21:26:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 0F6AFC0099 for ; Thu, 1 Oct 2015 21:26:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.9 X-Spam-Level: ** X-Spam-Status: No, score=2.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id MTt3Tc3PIwTP for ; Thu, 1 Oct 2015 21:26:01 +0000 (UTC) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 7E43E201FB for ; Thu, 1 Oct 2015 21:26:00 +0000 (UTC) Received: by wiclk2 with SMTP id lk2so8933493wic.0 for ; Thu, 01 Oct 2015 14:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=O86UxSXGBc4zt2sfmQTByehsSrEU4nHhR34f9E4uSnA=; b=CmVM7IT87ZyAz1OiWXcH/x0mgY1jfulcUJ0kcpPzfEjvb7QdJRpDW5CTFAj+fXB+NL iU0DHER77EYs8HuiFLTCjtK/5sL1c9w5voNRzF77Bd5fEWOtdu0+8LN6iyNle6lSha1x V7qYblRpwJ9PQoLmYjJySbAeDkwVCqMmngYHKXEL7wb/qTEn0+FxBYYX3gANQRKnnP47 ETdAxW6RejdDZiJfKJn4Js268fzuivGnZad3sZPS0ntQqHY8lDw+WoFBYgr6GhuY+/7i T1fHFsQVAz1QhHabzwSjVanfJqsR7BHW5yd32cOwjCV4nKkfeEv0Tap1jce7MzUbvpW5 YbZA== MIME-Version: 1.0 X-Received: by 10.180.90.166 with SMTP id bx6mr735936wib.93.1443734760206; Thu, 01 Oct 2015 14:26:00 -0700 (PDT) Received: by 10.27.92.197 with HTTP; Thu, 1 Oct 2015 14:26:00 -0700 (PDT) In-Reply-To: <560D8BBA.5020107@christopherschultz.net> References: <560D8BBA.5020107@christopherschultz.net> Date: Thu, 1 Oct 2015 17:26:00 -0400 Message-ID: Subject: Re: Parallel deployment URL issue From: Chris Gamache To: Tomcat Users List Content-Type: multipart/alternative; boundary=f46d043bdf86883a4e052111b1f0 --f46d043bdf86883a4e052111b1f0 Content-Type: text/plain; charset=UTF-8 I didn't know that you could do that for parallel deployment! A quick follow-up set of questions: Up until now I was counting on manager and tomcat's unpackWAR handling the nuts and bolts of the deploy process. Even though the warfile is named yourWar-00002.war, if I allow tomcat to unpack the war, it will unpack it as yourWar##00002 in webapps (taking its cue from the .xml file name). I can specify an already unpacked war outside of the standard deployment path for docBase and it indeed does work. I understand the close relationship of context name, context path, context version and the base file name (the name minus any .war or .xml extension) of the xml file. It was fine up until now. But now, if I have to break convention and manage getting the war uploaded and unpacked along with the per-app-version xml file all by myself without any help from tomcat, what are some best practices or pitfalls to avoid? It seems too easy and that's always when, in the movies, the trap gets sprung. On Thu, Oct 1, 2015 at 3:38 PM, Christopher Schultz < chris@christopherschultz.net> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > Chris, > > On 10/1/15 11:51 AM, Chris Gamache wrote: > > Hi all, > > > > I'm stuck using axis2-1.5.4. > > > > Here's what I think is happening: > > > > Axis2 does this sort of container-in-a-container thing. It creates > > its own classloader and pulls in all of its jar libraries > > dynamically. The problem is that it uses a java.net.URL to target > > the files. This would be fine except for the problem that the > > folder name, when using parallel deployment, is > > > > /path/to/yourWar##12345 > > > > So (from org.apache.axis2.deployment.util.Utils) > > > > public static URL[] getURLsForAllJars(URL url, File tmpDir) { > > FileInputStream fin = null; InputStream in = null; ZipInputStream > > zin = null; try { ArrayList array = new ArrayList(); in = > > url.openStream(); > > > > The problem is that URL was constructed from a File object in the > > org.apache.axis2.deployment.repository.util.DeploymentFileData.setClas > sLoader(boolean, > > > > > ClassLoader, File) method using the toURL() method. The toURL() method i > s > > deprecated because it doesn't escape special characters, namely the > > "##" in the path. > > > > When it hits url.openStream() it is discarding everything after the > > ##nnnnn part of the path (think hash value in a web URL). It throws > > a "java.io.FileNotFoundException: /path/to/yourWar (No such file > > or directory)" > > > > Getting in there and patching axis2-1.5.4 is less-than-desirable. > > So many things to go wrong. > > > > Is there a way to alter the way tomcat unpacks the warfile? Is > > there a way to configure the version delimiters from ## to perhaps > > ~~ or $$ ? > > What about using version-1.2.3.war and placing a version##1.2.3.xml > file into CATALINA_BASE/[engine]/[host]/? I think that'll get you > better-looking file paths. > > - -chris > -----BEGIN PGP SIGNATURE----- > Comment: GPGTools - http://gpgtools.org > > iQIcBAEBCAAGBQJWDYu6AAoJEBzwKT+lPKRYYSoQAIbX2A5X591X7FQP5qTD4GOj > A0O2sXoJAsssz9Gq81o69lh07oFkKb+MivROuI4rP4fGiBbcKiHVJCpA5xqqn3HL > inJK61675n2fr+II5ww7+X39zwX1fpBzYCYTIMtslG4fmO3whpPh3xbx00lwodrX > 9AIp6V47WQQR9hjGLZaJkixN/wMwVEHOwy6XaPN1qiBfVvEedaGEXrUC8zVrUZ6B > RieZWCru8NCkA8V4M8jbIZS3MkOovJi1Mg3s9d/Njm1fX9BjLTrwK484bBtAOOR1 > pxGeBeqkFCNe1/Fkjd/6YOgP1Y6ezYCu395a1CTMnGXcI13FCLIOEiOind6u8+Oi > rjGL8DsrcIlpKpqiIJ9JcY5gNCTksRs8IPRXMNAMinvZtlKnyCuSA9yBjyxs+v60 > ge8glvXaUfrBTUnLFg2g8F8QbIww0UJvzpNAjMdtY1KO5RKYxwxDFigWVQFQrV13 > 0RwcbDSnnlJJHABI7ajO6UC5nMVrzMak2bN9hTYA6nipAUuXavI1ozLPorHszg5f > GF+a/ww+/dGaqHVbvRGxGePDKeesPo3U+Dg+5M+Bl3aCOORfGEt96tzKVMpuveCp > VLRJ5owC2LNWAil9AndkFKPF9nwps/3tRwl5G/LuvfHn7cNFg1nASQyrbua/asxM > D3eGZK/W4NjolBgbIUk4 > =E4sU > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --f46d043bdf86883a4e052111b1f0--