You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Reinhard Poetz <re...@apache.org> on 2007/05/03 14:38:45 UTC

Trunk currently broken: UnknownHostException

Grek,

Andrew (OsX) and I (Win32) run into a problem with current trunk. It's 
reproducible with the block archetype. Are you aware of any changes that causes 
this:

javax.servlet.ServletException: Unable to read Avalon configuration from 
'sitemap.xmap'.;
nested exception is java.net.UnknownHostException: D
         at 
org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:224)
         at org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:62)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at 
org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(S
ervletServiceContext.java:537)
         at 
org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(S
ervletServiceContext.java:519)
         at 
org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.i
nvoke(ServletFactoryBean.java:229)
         at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflective
MethodInvocation.java:161)

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

Re: Trunk currently broken: UnknownHostException

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Grzegorz Kossakowski napisał(a):
> 
> 
> Lesson is taken to never commit stuff (especially core) without testing damn right. I've reverted my changes and broken
> tests pass again with new source resolve so I hope it's working again.
> 

Actually, it does _not_ work with new source resolve. Even though tests pass, all servlets (using servlet-service-fw)
mounted by cocoon-webapp are not accessible. Errors are similar to those mentioned before by others.

With downgraded version it is really working again.

-- 
Grzegorz Kossakowski

Re: Trunk currently broken: UnknownHostException

Posted by Carsten Ziegeler <cz...@apache.org>.
Is there a bug in the latest source resolver? I'm ready to fix it if  
someone can come up with a test case which does not require to get  
Cocoon running.

Carsten

Carsten Ziegeler:

>  Jorg Heymans wrote:
>
>>
>> nope, its mine. I didn't test the new release thorough enough  
>> before upgrading. So what can i do (apart from looking at the  
>> code) to help this getting fixed ?
>>
> Strange, the latest version runs in my projects (it's not Cocoon,  
> perhaps that's the difference?).
> Anyway, it would be great if we had a junit test case or at least a  
> description of what to test.
>
> Carsten
> --
> Carsten Ziegeler
>
>
>
>

--
Carsten Ziegeler





Re: Trunk currently broken: UnknownHostException

Posted by Carsten Ziegeler <cz...@apache.org>.
  Jorg Heymans wrote:

>
> nope, its mine. I didn't test the new release thorough enough  
> before upgrading. So what can i do (apart from looking at the code)  
> to help this getting fixed ?
>
Strange, the latest version runs in my projects (it's not Cocoon,  
perhaps that's the difference?).
Anyway, it would be great if we had a junit test case or at least a  
description of what to test.

Carsten
--
Carsten Ziegeler





Re: Trunk currently broken: UnknownHostException

Posted by Jorg Heymans <jh...@apache.org>.
Grzegorz Kossakowski wrote:
> Carsten Ziegeler napisał(a):
>> Reinhard Poetz wrote:
>>
>>> Carsten Ziegeler wrote:
>>>> Is this bug caused by the latest source resolver or by some of the
>>>> changes in Cocoon?
>>> yes, unfortunatly it is. I reverted sourceresolve to 2.2.1 in our root
>>> pom.
>>>
>> That's strange, I don't have problems with the new version. Anyway,
>> afaik there is only one new feature in the latest version which should
>> fix a bug on macosx, so it should be very easy to fix this. What urls do
>> not work? Can you (or someone else) file a bug?
>>
>> Thanks
> 
> I'm feeling really sorry. It's all my fault :(

nope, its mine. I didn't test the new release thorough enough before 
upgrading. So what can i do (apart from looking at the code) to help 
this getting fixed ?


Jorg








Re: Trunk currently broken: UnknownHostException

Posted by Carsten Ziegeler <cz...@apache.org>.
Grzegorz Kossakowski wrote:

> Carsten Ziegeler napisał(a):
>>
>> Reinhard Poetz wrote:
>>
>>> Carsten Ziegeler wrote:
>>>> Is this bug caused by the latest source resolver or by some of the
>>>> changes in Cocoon?
>>>
>>> yes, unfortunatly it is. I reverted sourceresolve to 2.2.1 in our  
>>> root
>>> pom.
>>>
>> That's strange, I don't have problems with the new version. Anyway,
>> afaik there is only one new feature in the latest version which  
>> should
>> fix a bug on macosx, so it should be very easy to fix this. What  
>> urls do
>> not work? Can you (or someone else) file a bug?
>>
>> Thanks
>
> I'm feeling really sorry. It's all my fault :(
> I've committed changes without testing it throughly enough (I've  
> tested FileGenerator because it seemed to be most
> affected and it worked) and with disabled tests while compiling.  
> I've disabled them because I'm working now on really
> poor machine at home and it took ages to test everything.
>
> Lesson is taken to never commit stuff (especially core) without  
> testing damn right. I've reverted my changes and broken
> tests pass again with new source resolve so I hope it's working again.
>
> Sorry, again.
>
Bad things happen from time to time :)
The important things is that you fixed the problem and told us about it.

> BTW. Now I'm lost a little bit with SAXParser and it's usage. I  
> would like to utilize SourceUtil functionality but with
>  org.apache.cocoon.core.xml.SAXParser. Any clues or advices?
Hmm, the SourceUtil has some nice methods combined with some ugly  
stuff. I think it might make sense to create new methods for the  
SAXParser and deprecate the old ones.

Carsten

--
Carsten Ziegeler





Re: Trunk currently broken: UnknownHostException

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Carsten Ziegeler napisał(a):
> 
> Reinhard Poetz wrote:
> 
>> Carsten Ziegeler wrote:
>>> Is this bug caused by the latest source resolver or by some of the
>>> changes in Cocoon?
>>
>> yes, unfortunatly it is. I reverted sourceresolve to 2.2.1 in our root
>> pom.
>>
> That's strange, I don't have problems with the new version. Anyway,
> afaik there is only one new feature in the latest version which should
> fix a bug on macosx, so it should be very easy to fix this. What urls do
> not work? Can you (or someone else) file a bug?
> 
> Thanks

I'm feeling really sorry. It's all my fault :(
I've committed changes without testing it throughly enough (I've tested FileGenerator because it seemed to be most
affected and it worked) and with disabled tests while compiling. I've disabled them because I'm working now on really
poor machine at home and it took ages to test everything.

Lesson is taken to never commit stuff (especially core) without testing damn right. I've reverted my changes and broken
tests pass again with new source resolve so I hope it's working again.

Sorry, again.

BTW. Now I'm lost a little bit with SAXParser and it's usage. I would like to utilize SourceUtil functionality but with
 org.apache.cocoon.core.xml.SAXParser. Any clues or advices?

-- 
Grzegorz Kossakowski

Re: Trunk currently broken: UnknownHostException

Posted by Carsten Ziegeler <cz...@apache.org>.
The only real change apart from refactoring is imho:

Jorg Heymans wrote:
> --- 2.2.1/org/apache/excalibur/source/impl/FileSource.java	 
> 2007-05-03 20:08:08.000000000 +0200
> +++ 2.2.2/org/apache/excalibur/source/impl/FileSource.java	 
> 2007-05-03 20:08:22.000000000 +0200
> @@ -80,7 +80,7 @@
>
>      /**
>       * Builds a FileSource, given an URI scheme and a File.
> -     *
> +     *
>       * @param scheme
>       * @param file
>       * @throws SourceException
> @@ -98,6 +98,13 @@
>          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) != '/' )
> +            {
> +                uri = "file://" + uri.substring(6);
> +            }
>          }
>          catch (MalformedURLException mue)
>          {

--
Carsten Ziegeler





Re: Trunk currently broken: UnknownHostException

Posted by Jorg Heymans <jh...@apache.org>.
Carsten Ziegeler wrote:

> That's strange, I don't have problems with the new version. Anyway, 
> afaik there is only one new feature in the latest version which should 
> fix a bug on macosx, so it should be very easy to fix this. What urls do 
> not work? Can you (or someone else) file a bug?

I can reproduce the bug by doing

mvn clean install -Dmaven.test.skip=true
cd core/cocoon-webapp
mvn jetty:run

then access localhost:8888 in browser

=======================

In case it helps, below is a diff of 2.2.1 and 2.2.2 sourcejars :


Only in 2.2.2/org/apache/excalibur/source: AvalonSourceUtil.java
diff -r -u 
2.2.1/org/apache/excalibur/source/ModifiableTraversableSource.java 
2.2.2/org/apache/excalibur/source/ModifiableTraversableSource.java
--- 2.2.1/org/apache/excalibur/source/ModifiableTraversableSource.java 
2007-05-03 20:08:08.000000000 +0200
+++ 2.2.2/org/apache/excalibur/source/ModifiableTraversableSource.java 
2007-05-03 20:08:22.000000000 +0200
@@ -19,7 +19,7 @@
  /**
   * A modifiable traversable source. This adds to {@link 
ModifiableSource} the
   * ability to create a directory.
- *
+ *
   * @author <a href="mailto:dev@avalon.apache.org">Avalon Development 
Team</a>
   * @version CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:26 $
   */
@@ -32,7 +32,7 @@
       * If the source already exists, this method does nothing if it's 
already
       * traversable, and fails otherwise.
       */
-    public void makeCollection() throws SourceException;
+    void makeCollection() throws SourceException;

  }

diff -r -u 2.2.1/org/apache/excalibur/source/SourceParameters.java 
2.2.2/org/apache/excalibur/source/SourceParameters.java
--- 2.2.1/org/apache/excalibur/source/SourceParameters.java	2007-05-03 
20:08:08.000000000 +0200
+++ 2.2.2/org/apache/excalibur/source/SourceParameters.java	2007-05-03 
20:08:22.000000000 +0200
@@ -95,6 +95,7 @@
       * children of the configuration.
       * If no children are available <code>null</code>
       * is returned.
+     * @deprecated Use {@link 
AvalonSourceUtil#createSourceParameters(Configuration)} instead.
       */
      public static SourceParameters create( Configuration conf )
      {
@@ -292,6 +293,8 @@
      /**
       * Create a Parameters object.
       * The first value of each parameter is added to the Parameters 
object.
+     * @deprecated Use {@link 
AvalonSourceUtil#getFirstParameters(SourceParameters)} or
+     *             {@link #getFirstParametersMap}.
       * @return An Parameters object - if no parameters are defined 
this is an
       *         empty object.
       */
@@ -309,6 +312,25 @@
      }

      /**
+     * Create a map object.
+     * The first value of each parameter is added to the map.
+     * @return A new map - if no parameters are defined this is an
+     *         empty map.
+     */
+    public Map getFirstParametersMap()
+    {
+        final Map result = new HashMap();
+        Iterator iter = this.getParameterNames();
+        String parName;
+        while( iter.hasNext() )
+        {
+            parName = (String)iter.next();
+            result.put( parName, this.getParameter( parName ) );
+        }
+        return result;
+    }
+
+    /**
       * Build a query string.
       * The query string can e.g. be used for http connections.
       * @return A query string which contains for each parameter/value pair
@@ -487,17 +509,17 @@
              this.names.remove( name );
          }
      }
-
+
      /**
-     * Returns an immutable java.util.Map containing parameter names as 
keys and
-     * parameter values as map values. The keys in the parameter map 
are of type String.
+     * Returns an immutable java.util.Map containing parameter names as 
keys and
+     * parameter values as map values. The keys in the parameter map 
are of type String.
       * The values in the parameter map are of type String array.
       */
-    public Map getParameterMap()
+    public Map getParameterMap()
      {
          final Map m = new HashMap(this.names);
          Iterator entries = m.entrySet().iterator();
-        while (entries.hasNext())
+        while (entries.hasNext())
          {
              Map.Entry entry = (Map.Entry)entries.next();
              ArrayList list = (ArrayList)entry.getValue();
diff -r -u 2.2.1/org/apache/excalibur/source/SourceUtil.java 
2.2.2/org/apache/excalibur/source/SourceUtil.java
--- 2.2.1/org/apache/excalibur/source/SourceUtil.java	2007-05-03 
20:08:08.000000000 +0200
+++ 2.2.2/org/apache/excalibur/source/SourceUtil.java	2007-05-03 
20:08:22.000000000 +0200
@@ -52,6 +52,7 @@
       * Append parameters to the uri.
       * Each parameter is appended to the uri with "parameter=value",
       * the parameters are separated by "&".
+     * @deprecated Use {@link AvalonSourceUtil#appendParameters(String, 
Parameters)} instead.
       */
      public static String appendParameters( String uri,
                                             Parameters parameters )
@@ -499,7 +500,7 @@
                                            destination.getURI()+
                                            "' is not writeable");
              }
-
+
              IOException firstE = null;
              ModifiableSource modDestination = 
(ModifiableSource)destination;
              try
@@ -519,7 +520,7 @@
                              // Remebver the original exception in case 
there are problems closing
                              //  any streams.
                              firstE = e;
-
+
                              // If possible, cancel the destination.
                              if ( modDestination.canCancel( out ) )
                              {
@@ -547,7 +548,7 @@
                      firstE = ioe;
                  }
              }
-
+
              // If there were any problems then wrap the original 
exception in a SourceException.
              if ( firstE != null )
              {
diff -r -u 2.2.1/org/apache/excalibur/source/SourceValidity.java 
2.2.2/org/apache/excalibur/source/SourceValidity.java
--- 2.2.1/org/apache/excalibur/source/SourceValidity.java	2007-05-03 
20:08:08.000000000 +0200
+++ 2.2.2/org/apache/excalibur/source/SourceValidity.java	2007-05-03 
20:08:22.000000000 +0200
@@ -44,10 +44,8 @@
  {
      final int VALID   = +1;
      final int INVALID = -1;
-    /** @deprecated because it has been misspelled, use UNKNOWN of 
course */
-    final int UNKNWON = 0;
      final int UNKNOWN = 0;
-
+
      /**
       * Check if the component is still valid. The possible results are :
       * <ul>
Only in 2.2.2/org/apache/excalibur/source/impl: AbstractSourceResolver.java
Only in 2.2.2/org/apache/excalibur/source/impl: DefaultSourceResolver.java
diff -r -u 2.2.1/org/apache/excalibur/source/impl/FileSource.java 
2.2.2/org/apache/excalibur/source/impl/FileSource.java
--- 2.2.1/org/apache/excalibur/source/impl/FileSource.java	2007-05-03 
20:08:08.000000000 +0200
+++ 2.2.2/org/apache/excalibur/source/impl/FileSource.java	2007-05-03 
20:08:22.000000000 +0200
@@ -80,7 +80,7 @@

      /**
       * Builds a FileSource, given an URI scheme and a File.
-     *
+     *
       * @param scheme
       * @param file
       * @throws SourceException
@@ -98,6 +98,13 @@
          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) != '/' )
+            {
+                uri = "file://" + uri.substring(6);
+            }
          }
          catch (MalformedURLException mue)
          {
@@ -186,7 +193,7 @@

      /**
       * Return a validity object based on the file's modification date.
-     *
+     *
       * @see org.apache.excalibur.source.Source#getValidity()
       */
      public SourceValidity getValidity()
@@ -390,11 +397,11 @@
          {
              throw new SourceNotFoundException("Cannot delete 
non-existing file " + m_file.toString());
          }
-
+
          if (!m_file.delete())
          {
              throw new SourceException("Could not delete " + 
m_file.toString() + " (unknown reason)");
-        }
+        }
      }

 
//----------------------------------------------------------------------------------
@@ -490,10 +497,10 @@
                          m_source.getFile().delete();
                      }
                      // Rename temp file to destination file
-                    if (!m_tmpFile.renameTo(m_source.getFile()))
+                    if (!m_tmpFile.renameTo(m_source.getFile()))
                      {
-                       throw new IOException("Could not rename " +
-                         m_tmpFile.getAbsolutePath() +
+                       throw new IOException("Could not rename " +
+                         m_tmpFile.getAbsolutePath() +
                           " to " + m_source.getFile().getAbsolutePath());
                      }

diff -r -u 
2.2.1/org/apache/excalibur/source/impl/SourceResolverImpl.java 
2.2.2/org/apache/excalibur/source/impl/SourceResolverImpl.java
--- 2.2.1/org/apache/excalibur/source/impl/SourceResolverImpl.java 
2007-05-03 20:08:08.000000000 +0200
+++ 2.2.2/org/apache/excalibur/source/impl/SourceResolverImpl.java 
2007-05-03 20:08:22.000000000 +0200
@@ -17,23 +17,22 @@
  package org.apache.excalibur.source.impl;

  import java.io.File;
-import java.io.IOException;
  import java.net.MalformedURLException;
  import java.net.URL;
-import java.util.Map;

-import org.apache.avalon.framework.CascadingRuntimeException;
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.context.ContextException;
  import org.apache.avalon.framework.context.Contextualizable;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.logger.LogEnabled;
+import org.apache.avalon.framework.logger.Logger;
  import org.apache.avalon.framework.service.ServiceException;
  import org.apache.avalon.framework.service.ServiceManager;
  import org.apache.avalon.framework.service.ServiceSelector;
  import org.apache.avalon.framework.service.Serviceable;
  import org.apache.avalon.framework.thread.ThreadSafe;
-import org.apache.excalibur.source.*;
+import org.apache.excalibur.source.SourceFactory;
+import org.apache.excalibur.source.SourceResolver;

  /**
   * This is the default implemenation of a {@link SourceResolver}.
@@ -57,23 +56,75 @@
   * @version $Id: SourceResolverImpl.java,v 1.4 2004/02/28 11:47:24 
cziegeler Exp $
   */
  public class SourceResolverImpl
-    extends AbstractLogEnabled
+    extends AbstractSourceResolver
      implements Serviceable,
      Contextualizable,
      Disposable,
-    SourceResolver,
+    LogEnabled,
      ThreadSafe
  {
+
      /** The component m_manager */
      protected ServiceManager m_manager;

      /** The special Source factories */
      protected ServiceSelector m_factorySelector;

+    /** Our logger. */
+    private Logger m_logger;
+
+    /**
+     * @see 
org.apache.excalibur.source.impl.AbstractSourceResolver#getSourceFactory(java.lang.String)
+     */
+    protected SourceFactory getSourceFactory(String protocol)
+    {
+        try
+        {
+            return (SourceFactory) m_factorySelector.select(protocol);
+        }
+        catch (ServiceException e)
+        {
+            // we go back to the default factory selector
+            return null;
+        }
+    }
+
+    /**
+     * @see 
org.apache.excalibur.source.impl.AbstractSourceResolver#releaseSourceFactory(org.apache.excalibur.source.SourceFactory)
+     */
+    protected void releaseSourceFactory(SourceFactory factory)
+    {
+        m_factorySelector.release(factory);
+    }
+
      /**
-     * The base URL
+     * @see 
org.apache.avalon.framework.logger.LogEnabled#enableLogging(org.apache.avalon.framework.logger.Logger)
       */
-    protected URL m_baseURL;
+    public void enableLogging(Logger logger)
+    {
+        m_logger = logger;
+    }
+
+    protected final Logger getLogger()
+    {
+        return m_logger;
+    }
+
+    /**
+     * @see 
org.apache.excalibur.source.impl.AbstractSourceResolver#debug(java.lang.String)
+     */
+    protected final void debug(String text)
+    {
+        m_logger.debug(text);
+    }
+
+    /**
+     * @see 
org.apache.excalibur.source.impl.AbstractSourceResolver#isDebugEnabled()
+     */
+    protected final boolean isDebugEnabled()
+    {
+        return m_logger.isDebugEnabled();
+    }

      /**
       * Get the context
@@ -117,8 +168,8 @@
      }

      /**
-     * Set the current <code>ComponentLocator</code> instance used by this
-     * <code>Composable</code>.
+     * Set the current <code>ServiceManager</code> instance used by this
+     * <code>Serviceable</code>.
       *
       * @avalon.dependency type="org.apache.excalibur.source.SourceFactory"
       */
@@ -126,13 +177,12 @@
          throws ServiceException
      {
          m_manager = manager;
-
-        if ( m_manager.hasService( SourceFactory.ROLE + "Selector" ) )
-        {
-            m_factorySelector = (ServiceSelector) m_manager.lookup( 
SourceFactory.ROLE + "Selector" );
-        }
+        m_factorySelector = (ServiceSelector) m_manager.lookup( 
SourceFactory.ROLE + "Selector" );
      }

+    /**
+     * @see org.apache.avalon.framework.activity.Disposable#dispose()
+     */
      public void dispose()
      {
          if( null != m_manager )
@@ -141,148 +191,4 @@
              m_factorySelector = null;
          }
      }
-
-    /**
-     * Get a <code>Source</code> object.
-     * @throws org.apache.excalibur.source.SourceNotFoundException if 
the source cannot be found
-     */
-    public Source resolveURI( String location )
-        throws MalformedURLException, IOException, SourceException
-    {
-        return this.resolveURI( location, null, null );
-    }
-
-    /**
-     * Get a <code>Source</code> object.
-     * @throws org.apache.excalibur.source.SourceNotFoundException if 
the source cannot be found
-     */
-    public Source resolveURI( String location,
-                              String baseURI,
-                              Map parameters )
-        throws MalformedURLException, IOException, SourceException
-    {
-        if( getLogger().isDebugEnabled() )
-        {
-            getLogger().debug( "Resolving '" + location + "' with base 
'" + baseURI + "' in context '" + m_baseURL + "'" );
-        }
-        if( location == null ) throw new MalformedURLException( 
"Invalid System ID" );
-        if( null != baseURI && SourceUtil.indexOfSchemeColon(baseURI) 
== -1 )
-        {
-            throw new MalformedURLException( "BaseURI is not valid, it 
must contain a protocol: " + baseURI );
-        }
-
-        if( baseURI == null ) baseURI = m_baseURL.toExternalForm();
-
-        String systemID = location;
-        // special handling for windows file paths
-        if( location.length() > 1 && location.charAt( 1 ) == ':' )
-            systemID = "file:/" + location;
-        else if( location.length() > 2 && location.charAt(0) == '/' && 
location.charAt(2) == ':' )
-            systemID = "file:" + location;
-
-        // determine protocol (scheme): first try to get the one of the 
systemID, if that fails, take the one of the baseURI
-        String protocol;
-        int protocolPos = SourceUtil.indexOfSchemeColon(systemID);
-        if( protocolPos != -1 )
-        {
-            protocol = systemID.substring( 0, protocolPos );
-        }
-        else
-        {
-            protocolPos = SourceUtil.indexOfSchemeColon(baseURI);
-            if( protocolPos != -1 )
-                protocol = baseURI.substring( 0, protocolPos );
-            else
-                protocol = "*";
-        }
-
-        Source source = null;
-        // search for a SourceFactory implementing the protocol
-        SourceFactory factory = null;
-        try
-        {
-            factory = (SourceFactory)m_factorySelector.select( protocol );
-            systemID = absolutize( factory, baseURI, systemID );
-            if( getLogger().isDebugEnabled() )
-                getLogger().debug( "Resolved to systemID : " + systemID );
-            source = factory.getSource( systemID, parameters );
-        }
-        catch( final ServiceException ce )
-        {
-            // no selector available, use fallback
-        }
-        finally
-        {
-            m_factorySelector.release( factory );
-        }
-
-        if( null == source )
-        {
-            try
-            {
-                factory = (SourceFactory) m_factorySelector.select("*");
-                systemID = absolutize( factory, baseURI, systemID );
-                if( getLogger().isDebugEnabled() )
-                    getLogger().debug( "Resolved to systemID : " + 
systemID );
-                source = factory.getSource( systemID, parameters );
-            }
-            catch (ServiceException se )
-            {
-                throw new SourceException( "Unable to select source 
factory for " + systemID, se );
-            }
-            finally
-            {
-                m_factorySelector.release(factory);
-            }
-        }
-
-        return source;
-    }
-
-    /**
-     * Makes an absolute URI based on a baseURI and a relative URI.
-     */
-    private String absolutize( SourceFactory factory, String baseURI, 
String systemID )
-    {
-        if( factory instanceof URIAbsolutizer )
-            systemID = ((URIAbsolutizer)factory).absolutize(baseURI, 
systemID);
-        else
-            systemID = SourceUtil.absolutize(baseURI, systemID);
-        return systemID;
-    }
-
-    /**
-     * Releases a resolved resource
-     * @param source the source to release
-     */
-    public void release( final Source source )
-    {
-        if( source == null ) return;
-
-        // search for a SourceFactory implementing the protocol
-        final String scheme = source.getScheme();
-        SourceFactory factory = null;
-
-        try
-        {
-            factory = (SourceFactory) m_factorySelector.select(scheme);
-            factory.release(source);
-        }
-        catch (ServiceException se )
-        {
-            try
-            {
-                factory = (SourceFactory) m_factorySelector.select("*");
-                factory.release(source);
-            }
-            catch (ServiceException sse )
-            {
-                throw new CascadingRuntimeException( "Unable to select 
source factory for " + source.getURI(), se );
-            }
-        }
-        finally
-        {
-            m_factorySelector.release( factory );
-        }
-    }
  }


Re: Trunk currently broken: UnknownHostException

Posted by Carsten Ziegeler <cz...@apache.org>.
Reinhard Poetz wrote:

> Carsten Ziegeler wrote:
>> Is this bug caused by the latest source resolver or by some of the  
>> changes in Cocoon?
>
> yes, unfortunatly it is. I reverted sourceresolve to 2.2.1 in our  
> root pom.
>
That's strange, I don't have problems with the new version. Anyway,  
afaik there is only one new feature in the latest version which  
should fix a bug on macosx, so it should be very easy to fix this.  
What urls do not work? Can you (or someone else) file a bug?

Thanks

Carsten
--
Carsten Ziegeler





Re: Trunk currently broken: UnknownHostException

Posted by Reinhard Poetz <re...@apache.org>.
Carsten Ziegeler wrote:
> Is this bug caused by the latest source resolver or by some of the 
> changes in Cocoon?

yes, unfortunatly it is. I reverted sourceresolve to 2.2.1 in our root pom.

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

Re: Trunk currently broken: UnknownHostException

Posted by Carsten Ziegeler <cz...@apache.org>.
Is this bug caused by the latest source resolver or by some of the  
changes in Cocoon?

Carsten

Andrew Savory wrote:

> Hi,
>
> On 3 May 2007, at 13:38, Reinhard Poetz wrote:
>
>> Andrew (OsX) and I (Win32) run into a problem with current trunk.
>
> For those trying to use trunk, svn update -r534341 will get you to  
> 'last known good'.
>
>
> Thanks,
>
> Andrew.
> --
> Andrew Savory, Managing Director, Sourcesense UK
> Tel: +44 (0)870 741 6658  Fax: +44 (0)700 598 1135
> Web: http://www.sourcesense.com/
>
>

--
Carsten Ziegeler





Re: Trunk currently broken: UnknownHostException

Posted by Andrew Savory <an...@luminas.co.uk>.
Hi,

On 3 May 2007, at 13:38, Reinhard Poetz wrote:

> Andrew (OsX) and I (Win32) run into a problem with current trunk.

For those trying to use trunk, svn update -r534341 will get you to  
'last known good'.


Thanks,

Andrew.
--
Andrew Savory, Managing Director, Sourcesense UK
Tel: +44 (0)870 741 6658  Fax: +44 (0)700 598 1135
Web: http://www.sourcesense.com/