cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Víctor Pergolesi <victorpergol...@codimat.com.ar>
Subject [SOLVED] Sitemap not found on Novell - cocoon 2.2.0
Date Mon, 13 Apr 2009 22:11:51 GMT
Hello to all!!!
  
Finally after almost 30 days we have been able to arrive to the solution of the problem that
we begin passed March 16.  
  
The problem has to do exclusively with the form that Novell uses to name the resources. An
error took place with the URI that are generated to name the resources.  Something like file://sys:/...
or file:/sys:/ or \\/sys:/... not work.
  
Working on org.apache.excalibur.source.impl.FileSource.java downloaded from http://excalibur.apache.org
/ we could arrive to the solution.  The class is include in excalibur-sourceresolve-2.2.3.jar
  
We test a basic application with some blocks in Tomcat 5 and Tomcat 5.5 on Novell 6 SP8..
Maybe in the future will appear similar problems in other classes but we have now an important
experience to solve that. 

I hope this solution would be used in future upgrades of excalibur.apache.org project and
of cocoon.apache.org project. 

The (significant) code of FileSource.java is 

================================================================================
...
public FileSource(String uri) throws SourceException, MalformedURLException
    {
        int pos = SourceUtil.indexOfSchemeColon(uri);
        if (pos == -1)
        {
            throw new MalformedURLException("Invalid URI : " + uri);
        }
        String scheme = uri.substring(0, pos);
        String fileName = uri.substring(pos + 1);
        fileName = SourceUtil.decodePath(fileName);
        
        if (fileName.startsWith("//\\")) {
            //
            // CASE Novell Netware
            // If the case is  //\sys:...
            //
            fileName = fileName.substring(3);
        }
        
        this.init(scheme, new File(fileName));
    }

    /**
     * Builds a FileSource, given an URI scheme and a File.
     *
     * @param scheme
     * @param file
     * @throws SourceException
     */
    public FileSource(String scheme, File file) throws SourceException
    {
        this.init(scheme, file);
    }

    private void init(String scheme, File file) throws SourceException
    {
        this.m_scheme = scheme;

        String uri;
        try
        {
            uri = file.toURL().toExternalForm();
            // toExternalForm() is buggy, see e.g. http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4924415
            // therefore we check if file: is followed by just one slash
            // TODO when we move to JDK 1.4+, we should use file.toURI().toASCIIString() instead.
            //if ( uri.length() > 6 && uri.startsWith("file:/") && uri.charAt(6)
!= '/' )
            if (uri.charAt(6) == '/') {
                // 
                // CASE Novell Netware
                // If the case is file://sys:/...
                //
                uri = uri.substring(0,5) + uri.substring(7);
            } else if (uri.charAt(5) == '/') {
                //
                // CASE Novell Netware
                // If the case is file:/sys:/...
                //
                uri = uri.substring(0,5) + uri.substring(6);
            } else {
                if ( uri.length() > 6 && uri.startsWith("file:/") )
                {
                    uri = "file:///" + uri.substring(6);
                }
            }
        }
        catch (MalformedURLException mue)
        {
            // Can this really happen ?
            throw new SourceException("Failed to get URL for file " + file, mue);
        }

        if (!uri.startsWith(scheme))
        {
            // Scheme is not "file:"
            uri = scheme + ':' + uri.substring(uri.indexOf(':') + 1);
        }

        this.m_uri = uri;

        this.m_file = file;
    }

...
================================================================================

A special gratefulness to   
* Mathia Rheem, Reinhard Pötz {Indoqa} whose comments were used for the solution.  
  
* our specialist in Novell, the engineer Gabriel Fernández from Bilbao and Associates  
  
* my co-workers: Nicolás Santecchia and Ariel Paz, who accompanied me in the search of the
solution and they helped me in conserving the necessary climate to be able to work.  

Thanks to all.

Víctor Pergolesi.  

From: Víctor Pergolesi [mailto:victorpergolesi@codimat.com.ar]
To: users@cocoon.apache.org
Sent: Mon, 16 Mar 2009 15:08:30 -0300
Subject: Sitemap not found on Novell - cocoon 2.2.0

                Hello, I am Victor Pergolesi. I am new to this list.
I have in production some applications with cocoon 2.1.10 on Novell 6.5 SP2 over Tomcat 4.1.30
(java 1.4.2_13)

I am testing now Cocoon 2.2.0.
I am using maven to generate the application and Tomcat 5.5 to run it. In Windows all works
very good.

BUT I have a problem when I test on Novell 6.5 SP8 with Tomcat 5.5(plus compatibility pack)
(java 1.4.2_18)

When I call the application I receive the error: 

javax.servlet.ServletException: Resource not found.
    org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:197)
    org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:84)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:468)
    org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:443)
    org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.invoke(ServletFactoryBean.java:264)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    $Proxy3.service(Unknown Source)
    org.apache.cocoon.servletservice.DispatcherServlet.service(DispatcherServlet.java:106)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.cocoon.servlet.multipart.MultipartFilter.doFilter(MultipartFilter.java:131)

root cause

org.apache.cocoon.ResourceNotFoundException: Resource not found.
    org.apache.cocoon.components.source.util.SourceUtil.handle(SourceUtil.java:363)
    org.apache.cocoon.components.source.util.SourceUtil.toSAX(SourceUtil.java:185)
    org.apache.cocoon.components.treeprocessor.TreeProcessor.createSitemapProgram(TreeProcessor.java:356)
    org.apache.cocoon.components.treeprocessor.TreeProcessor.buildConcreteProcessor(TreeProcessor.java:404)
    org.apache.cocoon.components.treeprocessor.TreeProcessor.setupConcreteProcessor(TreeProcessor.java:338)
    org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:246)
    org.apache.cocoon.servlet.RequestProcessor.process(RequestProcessor.java:351)
    org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:169)
    org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:84)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:468)
    org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:443)
    org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.invoke(ServletFactoryBean.java:264)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    $Proxy3.service(Unknown Source)
    org.apache.cocoon.servletservice.DispatcherServlet.service(DispatcherServlet.java:106)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.cocoon.servlet.multipart.MultipartFilter.doFilter(MultipartFilter.java:131)

root cause

org.apache.excalibur.source.SourceNotFoundException: file://sys:/tomcat/5.5/work/Catalina/localhost/b-1/blocks/bloque1/sitemap.xmap
doesn't exist.
    org.apache.excalibur.source.impl.FileSource.getInputStream(FileSource.java:157)
    org.apache.cocoon.components.source.impl.DelayedRefreshSourceWrapper.getInputStream(DelayedRefreshSourceWrapper.java:69)
    org.apache.cocoon.components.source.util.SourceUtil.toSAX(SourceUtil.java:180)
    org.apache.cocoon.components.treeprocessor.TreeProcessor.createSitemapProgram(TreeProcessor.java:356)
    org.apache.cocoon.components.treeprocessor.TreeProcessor.buildConcreteProcessor(TreeProcessor.java:404)
    org.apache.cocoon.components.treeprocessor.TreeProcessor.setupConcreteProcessor(TreeProcessor.java:338)
    org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:246)
    org.apache.cocoon.servlet.RequestProcessor.process(RequestProcessor.java:351)
    org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:169)
    org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:84)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:468)
    org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:443)
    org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.invoke(ServletFactoryBean.java:264)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    $Proxy3.service(Unknown Source)
    org.apache.cocoon.servletservice.DispatcherServlet.service(DispatcherServlet.java:106)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.cocoon.servlet.multipart.MultipartFilter.doFilter(MultipartFilter.java:131)

root cause

java.io.FileNotFoundException: \\sys:\tomcat\5.5\work\Catalina\localhost\b-1\blocks\bloque1\sitemap.xmap
    java.io.FileInputStream.open(Native Method)
    java.io.FileInputStream.<init>(FileInputStream.java:106)
    org.apache.excalibur.source.impl.FileSource.getInputStream(FileSource.java:153)
    org.apache.cocoon.components.source.impl.DelayedRefreshSourceWrapper.getInputStream(DelayedRefreshSourceWrapper.java:69)
    org.apache.cocoon.components.source.util.SourceUtil.toSAX(SourceUtil.java:180)
    org.apache.cocoon.components.treeprocessor.TreeProcessor.createSitemapProgram(TreeProcessor.java:356)
    org.apache.cocoon.components.treeprocessor.TreeProcessor.buildConcreteProcessor(TreeProcessor.java:404)
    org.apache.cocoon.components.treeprocessor.TreeProcessor.setupConcreteProcessor(TreeProcessor.java:338)
    org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:246)
    org.apache.cocoon.servlet.RequestProcessor.process(RequestProcessor.java:351)
    org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:169)
    org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:84)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:468)
    org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:443)
    org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.invoke(ServletFactoryBean.java:264)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    $Proxy3.service(Unknown Source)
    org.apache.cocoon.servletservice.DispatcherServlet.service(DispatcherServlet.java:106)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.cocoon.servlet.multipart.MultipartFilter.doFilter(MultipartFilter.java:131)


The file SITEMAP.XMAP is here but Novell don´t find it. I read about SYS become a protocol
but I have the problem since 2 weeks ago and I don´t find a solution.

Has somebody have a similar problem? How can I resolve it? Please help me.

Thanks for your help.
Víctor.


  
    _____  

  Este mensaje y sus adjuntos contienen información confidencial y son para uso exclusivo
del destinatario. Si hubiese recibido este mensaje por error, o contuviera información que
Ud. no desea recibir, por favor le agradecemos nos lo haga saber y lo elimine de su sistema.
Cualquier inconveniente, enviarlo a librodequejas@codimat.com.ar.
  Este correo ha sido chequeado por el servidor de Codimat S.A. www.codimat.com.ar
        
  
    _____  

  Este mensaje y sus adjuntos contienen información confidencial y son para uso exclusivo
del destinatario. Si hubiese recibido este mensaje por error, o contuviera información que
Ud. no desea recibir, por favor le agradecemos nos lo haga saber y lo elimine de su sistema.
Cualquier inconveniente, enviarlo a librodequejas@codimat.com.ar.
  Este correo ha sido chequeado por el servidor de Codimat S.A. www.codimat.com.ar
        


Este mensaje y sus adjuntos contienen información confidencial y son para uso exclusivo del
destinatario. Si hubiese recibido este mensaje por error, o contuviera información que Ud.
no desea recibir, por favor le agradecemos nos lo haga saber y lo elimine de su sistema. Cualquier
inconveniente, enviarlo a librodequejas@codimat.com.ar.
Este correo ha sido chequeado por el servidor de Codimat S.A. www.codimat.com.ar

Mime
View raw message