Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 15496 invoked from network); 14 Mar 2008 11:17:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Mar 2008 11:17:06 -0000 Received: (qmail 83910 invoked by uid 500); 14 Mar 2008 11:17:01 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 83836 invoked by uid 500); 14 Mar 2008 11:17:01 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 83824 invoked by uid 99); 14 Mar 2008 11:17:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Mar 2008 04:17:01 -0700 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; Fri, 14 Mar 2008 11:16:20 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id ECFFC234C098 for ; Fri, 14 Mar 2008 04:15:24 -0700 (PDT) Message-ID: <939911148.1205493324955.JavaMail.jira@brutus> Date: Fri, 14 Mar 2008 04:15:24 -0700 (PDT) From: "Juan Jose Vazquez Delgado (JIRA)" To: dev@cocoon.apache.org Subject: =?utf-8?Q?[jira]_Commented:_(COCOON-2172)_Cocoon_Spring_Config?= =?utf-8?Q?urator_1.0.1_doesn=C2=B4t_work_properly_with_Weblogic_9.2?= In-Reply-To: <2064701123.1205493084236.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COCOON-2172?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D125= 78685#action_12578685 ]=20 Juan Jose Vazquez Delgado commented on COCOON-2172: --------------------------------------------------- I added this code in DeploymentUtil class to solve the issue: protected static void deployBlockResources(String relativeDirectory, String destinationDirectory, Map blockContexts) throws IOException { final Enumeration jarUrls =3D DeploymentUtil.class.getClassLoader()= .getResources(BLOCK_RESOURCES_PATH); while ( jarUrls.hasMoreElements() ) { final URL resourceUrl =3D (URL)jarUrls.nextElement(); String url =3D resourceUrl.toExternalForm(); if ( "file".equals(resourceUrl.getProtocol()) ) { // FIXME: This only covers the siuation when the project is= Maven generated // if this is a file url generated by the Maven, // it has this form "file:{url}/{block name}/target/classes= /COB-INF int pos =3D url.indexOf("/target/classes/COB-INF"); // extract block name (if any) if (pos >=3D 0) { String blockName =3D url.substring(0, pos); blockName =3D blockName.substring(blockName.lastIndexOf= ('/') + 1); // register the root URL for the block resources blockContexts.put(blockName, url); } } else if ( "jar".equals(resourceUrl.getProtocol()) || "zip".eq= uals(resourceUrl.getProtocol()) ) { // if this is a jar url, it has this form: "jar:{url-to-jar= }!/{resource-path}" // to open the jar, we can simply remove everything after "= !/" int pos =3D url.indexOf('!'); url =3D url.substring(0, pos+2); // +2 as we include "!/" /** * Included because of Weblogic 9.2 classloader behaviour= =20 */ if ("zip".equals(resourceUrl.getProtocol())) =09=09url =3D url.replace("zip:", "jar:file:"); final URL jarUrl =3D new URL(url); =20 final JarURLConnection connection =3D (JarURLConnection)jar= Url.openConnection(); final JarFile jarFile =3D connection.getJarFile(); String blockName =3D jarFile.getManifest().getMainAttribute= s().getValue("Cocoon-Block-Name"); if ( blockName =3D=3D null ) { String jarPath =3D jarFile.getName(); // extract jar name String jarName =3D jarPath.substring(jarPath.lastIndexO= f(File.separatorChar) + 1); // drop file extension blockName =3D jarName.substring(0, jarName.lastIndexOf(= '.')); // TODO how do we strip version from blockName? } final StringBuffer buffer =3D new StringBuffer(destinationD= irectory); buffer.append(File.separatorChar); buffer.append(relativeDirectory); buffer.append(File.separatorChar); buffer.append(blockName); String destination =3D buffer.toString(); deploy(jarFile, BLOCK_RESOURCES_PATH, destination); // register the root URL for the block resources blockContexts.put(blockName, new File(destination).toURL().= toExternalForm()); } // we only handle jar files and ordinary files // TODO - Should we throw an exception if it's some other proto= col type? (or log?) } } > Cocoon Spring Configurator 1.0.1 doesn=C2=B4t work properly with Weblogic= 9.2 > ------------------------------------------------------------------------ > > Key: COCOON-2172 > URL: https://issues.apache.org/jira/browse/COCOON-2172 > Project: Cocoon > Issue Type: Bug > Components: * Cocoon Core > Affects Versions: 2.2-dev (Current SVN) > Reporter: Juan Jose Vazquez Delgado > > Deploying to Weblogic 9.2 happens this: > 1. Spring loads the jar configurations with zip protocol instead jar prot= ocol, i.e. > zip:C:/bea/user_projects/domains/cm_domain/servers/AdminServer/tmp/_WL_us= er/proxy-ear/53xotj/war/WEB-INF/lib/cocoon- > servlet-service-impl-1.0.0-M2.jar!/META-INF/cocoon/spring/cocoon-callstac= k-environment.xml > 2. In Runtime, the "URLConnection" class is a "weblogic.utils.ZipUrlConne= ction" not a "JarURLConnection" --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.