You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Juan Jose Vazquez Delgado (JIRA)" <ji...@apache.org> on 2008/03/14 12:11:24 UTC

[jira] Created: (COCOON-2172) Cocoon Spring Configurator 1.0.1 doesn´t work properly with Weblogic 9.2

Cocoon Spring Configurator 1.0.1 doesn´t 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 protocol, i.e.
zip:C:/bea/user_projects/domains/cm_domain/servers/AdminServer/tmp/_WL_user/proxy-ear/53xotj/war/WEB-INF/lib/cocoon-
servlet-service-impl-1.0.0-M2.jar!/META-INF/cocoon/spring/cocoon-callstack-environment.xml

2. In Runtime, the "URLConnection" class is a "weblogic.utils.ZipUrlConnection" not a "JarURLConnection"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COCOON-2172) Cocoon Spring Configurator 1.0.1 doesn´t work properly with Weblogic 9.2

Posted by "Juan Jose Vazquez Delgado (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juan Jose Vazquez Delgado updated COCOON-2172:
----------------------------------------------

              Fix Version/s: 2.2-dev (Current SVN)
    Fix version (Component): Parent values: Cocoon Core(10227). Level 1 values: 2.2.0-RC3-dev(10304). 

> Cocoon Spring Configurator 1.0.1 doesn´t 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
>             Fix For: 2.2-dev (Current SVN)
>
>
> Deploying to Weblogic 9.2 happens this:
> 1. Spring loads the jar configurations with zip protocol instead jar protocol, i.e.
> zip:C:/bea/user_projects/domains/cm_domain/servers/AdminServer/tmp/_WL_user/proxy-ear/53xotj/war/WEB-INF/lib/cocoon-
> servlet-service-impl-1.0.0-M2.jar!/META-INF/cocoon/spring/cocoon-callstack-environment.xml
> 2. In Runtime, the "URLConnection" class is a "weblogic.utils.ZipUrlConnection" not a "JarURLConnection"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (COCOON-2172) Cocoon Spring Configurator 1.0.1 doesn´t work properly with Weblogic 9.2

Posted by "Reinhard Poetz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reinhard Poetz reassigned COCOON-2172:
--------------------------------------

    Assignee: Reinhard Poetz

> Cocoon Spring Configurator 1.0.1 doesn´t 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
>            Assignee: Reinhard Poetz
>             Fix For: 2.2-dev (Current SVN)
>
>
> Deploying to Weblogic 9.2 happens this:
> 1. Spring loads the jar configurations with zip protocol instead jar protocol, i.e.
> zip:C:/bea/user_projects/domains/cm_domain/servers/AdminServer/tmp/_WL_user/proxy-ear/53xotj/war/WEB-INF/lib/cocoon-
> servlet-service-impl-1.0.0-M2.jar!/META-INF/cocoon/spring/cocoon-callstack-environment.xml
> 2. In Runtime, the "URLConnection" class is a "weblogic.utils.ZipUrlConnection" not a "JarURLConnection"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (COCOON-2172) Cocoon Spring Configurator 1.0.1 doesn´t work properly with Weblogic 9.2

Posted by "Reinhard Poetz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reinhard Poetz closed COCOON-2172.
----------------------------------

                     Resolution: Fixed
    Affects version (Component): Parent values: Configuration(10176).   (was: Parent values: Cocoon Core(10151). Level 1 values: 2.2.0-RC2(10309). )
        Fix version (Component): Parent values: Servlet Service Framework(10247).   (was: Parent values: Cocoon Core(10227). Level 1 values: 2.2.0-RC3-dev(10304). )

applied in trunk. Please cross check.

> Cocoon Spring Configurator 1.0.1 doesn´t 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
>            Assignee: Reinhard Poetz
>             Fix For: 2.2-dev (Current SVN)
>
>
> Deploying to Weblogic 9.2 happens this:
> 1. Spring loads the jar configurations with zip protocol instead jar protocol, i.e.
> zip:C:/bea/user_projects/domains/cm_domain/servers/AdminServer/tmp/_WL_user/proxy-ear/53xotj/war/WEB-INF/lib/cocoon-
> servlet-service-impl-1.0.0-M2.jar!/META-INF/cocoon/spring/cocoon-callstack-environment.xml
> 2. In Runtime, the "URLConnection" class is a "weblogic.utils.ZipUrlConnection" not a "JarURLConnection"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-2172) Cocoon Spring Configurator 1.0.1 doesn´t work properly with Weblogic 9.2

Posted by "Juan Jose Vazquez Delgado (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-2172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578685#action_12578685 ] 

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 = DeploymentUtil.class.getClassLoader().getResources(BLOCK_RESOURCES_PATH);
        while ( jarUrls.hasMoreElements() ) {
            final URL resourceUrl = (URL)jarUrls.nextElement();

            String url = 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 = url.indexOf("/target/classes/COB-INF");
                // extract block name (if any)
                if (pos >= 0) {
                    String blockName = url.substring(0, pos);
                    blockName = blockName.substring(blockName.lastIndexOf('/') + 1);
                    // register the root URL for the block resources
                    blockContexts.put(blockName, url);
                }
            } else if ( "jar".equals(resourceUrl.getProtocol()) || "zip".equals(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 = url.indexOf('!');
                url = url.substring(0, pos+2); // +2 as we include "!/"
                /**
                 * Included because of Weblogic 9.2 classloader behaviour 
                 */
                if ("zip".equals(resourceUrl.getProtocol()))
                		url = url.replace("zip:", "jar:file:");
                final URL jarUrl = new URL(url);
              
                final JarURLConnection connection = (JarURLConnection)jarUrl.openConnection();
                final JarFile jarFile = connection.getJarFile();
                String blockName = jarFile.getManifest().getMainAttributes().getValue("Cocoon-Block-Name");
                if ( blockName == null ) {
                    String jarPath = jarFile.getName();
                    // extract jar name
                    String jarName = jarPath.substring(jarPath.lastIndexOf(File.separatorChar) + 1);
                    // drop file extension
                    blockName = jarName.substring(0, jarName.lastIndexOf('.'));
                    // TODO how do we strip version from blockName?
                }
                final StringBuffer buffer = new StringBuffer(destinationDirectory);
                buffer.append(File.separatorChar);
                buffer.append(relativeDirectory);
                buffer.append(File.separatorChar);
                buffer.append(blockName);
                String destination = 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 protocol type? (or log?)
        }
    }

> Cocoon Spring Configurator 1.0.1 doesn´t 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 protocol, i.e.
> zip:C:/bea/user_projects/domains/cm_domain/servers/AdminServer/tmp/_WL_user/proxy-ear/53xotj/war/WEB-INF/lib/cocoon-
> servlet-service-impl-1.0.0-M2.jar!/META-INF/cocoon/spring/cocoon-callstack-environment.xml
> 2. In Runtime, the "URLConnection" class is a "weblogic.utils.ZipUrlConnection" not a "JarURLConnection"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.