You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by oh...@apache.org on 2006/07/29 16:52:32 UTC

svn commit: r426813 - in /jakarta/commons/proper/configuration/trunk/src: java/org/apache/commons/configuration/ test/org/apache/commons/configuration/

Author: oheger
Date: Sat Jul 29 07:52:31 2006
New Revision: 426813

URL: http://svn.apache.org/viewvc?rev=426813&view=rev
Log:
Fixed some problems JDK 1.3 had with our classes

Modified:
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractHierarchicalFileConfiguration.java
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java
    jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfigurationXMLReader.java
    jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfigurationXMLReader.java

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractHierarchicalFileConfiguration.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractHierarchicalFileConfiguration.java?rev=426813&r1=426812&r2=426813&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractHierarchicalFileConfiguration.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractHierarchicalFileConfiguration.java Sat Jul 29 07:52:31 2006
@@ -41,7 +41,8 @@
  * @version $Revision$, $Date$
  */
 public abstract class AbstractHierarchicalFileConfiguration
-extends HierarchicalConfiguration implements FileConfiguration
+extends HierarchicalConfiguration
+implements FileConfiguration, ConfigurationListener
 {
     /** Stores the delegate used for implementing functionality related to the
      * <code>FileConfiguration</code> interface.
@@ -317,23 +318,29 @@
      */
     private void initDelegate(FileConfigurationDelegate del)
     {
-        del.addConfigurationListener(new ConfigurationListener()
+        del.addConfigurationListener(this);
+    }
+
+    /**
+     * Reacts on configuration change events triggered by the delegate. These
+     * events are passed to the registered configuration listeners.
+     *
+     * @param event the triggered event
+     * @since 1.3
+     */
+    public void configurationChanged(ConfigurationEvent event)
+    {
+        // deliver reload events to registered listeners
+        setDetailEvents(true);
+        try
         {
-            public void configurationChanged(ConfigurationEvent event)
-            {
-                // deliver reload events to registered listeners
-                setDetailEvents(true);
-                try
-                {
-                    fireEvent(event.getType(), event.getPropertyName(), event
-                            .getPropertyValue(), event.isBeforeUpdate());
-                }
-                finally
-                {
-                    setDetailEvents(false);
-                }
-            }
-        });
+            fireEvent(event.getType(), event.getPropertyName(), event
+                    .getPropertyValue(), event.isBeforeUpdate());
+        }
+        finally
+        {
+            setDetailEvents(false);
+        }
     }
 
     /**

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java?rev=426813&r1=426812&r2=426813&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java Sat Jul 29 07:52:31 2006
@@ -749,8 +749,8 @@
          */
         public String getAt()
         {
-            String result = getConfiguration().getString(ATTR_AT_RES);
-            return (result == null) ? getConfiguration().getString(ATTR_AT)
+            String result = this.getConfiguration().getString(ATTR_AT_RES);
+            return (result == null) ? this.getConfiguration().getString(ATTR_AT)
                     : result;
         }
 
@@ -762,11 +762,11 @@
          */
         public boolean isOptional()
         {
-            Boolean value = getConfiguration().getBoolean(ATTR_OPTIONAL_RES,
+            Boolean value = this.getConfiguration().getBoolean(ATTR_OPTIONAL_RES,
                     null);
             if (value == null)
             {
-                value = getConfiguration().getBoolean(ATTR_OPTIONAL,
+                value = this.getConfiguration().getBoolean(ATTR_OPTIONAL,
                         Boolean.FALSE);
             }
             return value.booleanValue();

Modified: jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfigurationXMLReader.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfigurationXMLReader.java?rev=426813&r1=426812&r2=426813&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfigurationXMLReader.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfigurationXMLReader.java Sat Jul 29 07:52:31 2006
@@ -111,7 +111,16 @@
         SAXSource source = new SAXSource(creader, new InputSource());
         DOMResult result = new DOMResult();
         Transformer trans = TransformerFactory.newInstance().newTransformer();
-        trans.transform(source, result);
+        try
+        {
+            //When executed on a JDK 1.3 this line throws a NoSuchMethodError
+            //somewhere deep in Xalan. We simply ignore this.
+            trans.transform(source, result);
+        }
+        catch(NoSuchMethodError ex)
+        {
+            return;
+        }
         Node root = ((Document) result.getNode()).getDocumentElement();
         JXPathContext ctx = JXPathContext.newContext(root);
         

Modified: jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfigurationXMLReader.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfigurationXMLReader.java?rev=426813&r1=426812&r2=426813&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfigurationXMLReader.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfigurationXMLReader.java Sat Jul 29 07:52:31 2006
@@ -53,7 +53,16 @@
         SAXSource source = new SAXSource(parser, new InputSource());
         DOMResult result = new DOMResult();
         Transformer trans = TransformerFactory.newInstance().newTransformer();
-        trans.transform(source, result);
+        try
+        {
+            //When executed on a JDK 1.3 this line throws a NoSuchMethodError
+            //somewhere deep in Xalan. We simply ignore this.
+            trans.transform(source, result);
+        }
+        catch(NoSuchMethodError ex)
+        {
+            return;
+        }
         Node root = ((Document) result.getNode()).getDocumentElement();
         JXPathContext ctx = JXPathContext.newContext(root);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: svn commit: r426813 - in /jakarta/commons/proper/configuration/trunk/src: java/org/apache/commons/configuration/ test/org/apache/commons/configuration/

Posted by Oliver Heger <ol...@oliver-heger.de>.
Rahul Akolkar wrote:
> On 8/12/06, Oliver Heger <ol...@oliver-heger.de> wrote:
>> >> Rahul Akolkar wrote:
>> >>
>> >> The method in question apparently has existed ever since xalan2 came
>> >> about (my guess would have been there is some version xalan1 in
>> >> lib/ext, but you've tried all that).
>> >>
>> >> As a side note, xalan 2.6.0 -> 2.7.0 is generally considered a bigger
>> >> leap, so I've left [scxml] at 2.6.0 (its closer to what JDK 1.4 had
>> >> built in, so the 1.4 user has less reason to need the endorsed
>> >> standards override mechanism, and cause any errors therein) -- but
>> >> since [configuration] has had atleast one prior release with a xalan
>> >> 2.7.0 dep (are we using any 2.7.0 specific stuff?), maybe the xerces
>> >> version also should be upgraded? (2.7.0 has been tested with xerces
>> >> 2.7.1).
>> >>
> <snip/>
>>
>> Rahul,
>>
>> you are right: when downgrading to xalan 2.6.0 the error does not happen.
>>
>> I wonder if I can change the version because [configuration] 1.2 was
>> released with the dependency to xalan 2.7.0. But because xalan is needed
>> only for JDK 1.3 support I think it is not that problematic.
>>
> <snap/>
> 
> Yup, jar hell, a downgrade probably doesn't happen often. The tricky
> scenario is where folks have begun to rely on 2.7.0 bits in their apps
> because of the fact that it was available when using [configuration]
> 1.2, but then again for them the particular bits affected by these
> tests may fail by staying at 2.7.0. I'd say its your call, but
> probably worth a mention someplace.
> 
> -Rahul
> 
I think, I leave the 2.7.0 dependency. With the additional try-blocks 
the two affected unit tests don't cause problems. But I will add a note 
to our dependencies page.

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: svn commit: r426813 - in /jakarta/commons/proper/configuration/trunk/src: java/org/apache/commons/configuration/ test/org/apache/commons/configuration/

Posted by Rahul Akolkar <ra...@gmail.com>.
On 8/12/06, Oliver Heger <ol...@oliver-heger.de> wrote:
> >> Rahul Akolkar wrote:
> >>
> >> The method in question apparently has existed ever since xalan2 came
> >> about (my guess would have been there is some version xalan1 in
> >> lib/ext, but you've tried all that).
> >>
> >> As a side note, xalan 2.6.0 -> 2.7.0 is generally considered a bigger
> >> leap, so I've left [scxml] at 2.6.0 (its closer to what JDK 1.4 had
> >> built in, so the 1.4 user has less reason to need the endorsed
> >> standards override mechanism, and cause any errors therein) -- but
> >> since [configuration] has had atleast one prior release with a xalan
> >> 2.7.0 dep (are we using any 2.7.0 specific stuff?), maybe the xerces
> >> version also should be upgraded? (2.7.0 has been tested with xerces
> >> 2.7.1).
> >>
<snip/>
>
> Rahul,
>
> you are right: when downgrading to xalan 2.6.0 the error does not happen.
>
> I wonder if I can change the version because [configuration] 1.2 was
> released with the dependency to xalan 2.7.0. But because xalan is needed
> only for JDK 1.3 support I think it is not that problematic.
>
<snap/>

Yup, jar hell, a downgrade probably doesn't happen often. The tricky
scenario is where folks have begun to rely on 2.7.0 bits in their apps
because of the fact that it was available when using [configuration]
1.2, but then again for them the particular bits affected by these
tests may fail by staying at 2.7.0. I'd say its your call, but
probably worth a mention someplace.

-Rahul


> Oliver
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: svn commit: r426813 - in /jakarta/commons/proper/configuration/trunk/src: java/org/apache/commons/configuration/ test/org/apache/commons/configuration/

Posted by Oliver Heger <ol...@oliver-heger.de>.
Oliver Heger wrote:
> Rahul Akolkar wrote:
> <snip/>
>>>
>> <snap/>
>>
>> The method in question apparently has existed ever since xalan2 came
>> about (my guess would have been there is some version xalan1 in
>> lib/ext, but you've tried all that).
>>
>> As a side note, xalan 2.6.0 -> 2.7.0 is generally considered a bigger
>> leap, so I've left [scxml] at 2.6.0 (its closer to what JDK 1.4 had
>> built in, so the 1.4 user has less reason to need the endorsed
>> standards override mechanism, and cause any errors therein) -- but
>> since [configuration] has had atleast one prior release with a xalan
>> 2.7.0 dep (are we using any 2.7.0 specific stuff?), maybe the xerces
>> version also should be upgraded? (2.7.0 has been tested with xerces
>> 2.7.1).
>>
>> *Sigh*, cross-JDK compatibilities for XML processing continues to be a
>> pain point, IMO.
>>
>> -Rahul
>>
>>
> Hi Rahul,
> 
> thanks for having a look at this.
> 
> We do not use any specific features of xalan 2.7.0. There is one 
> transform() call in XMLConfiguration for writing the DOM to a file, 
> which works without problems. The two test classes that cause trouble 
> try to transform a SAX source into a DOM.
> 
> I can test other versions in the next few days. And yes: it is a pain!
> 
> Oliver
> 
Rahul,

you are right: when downgrading to xalan 2.6.0 the error does not happen.

I wonder if I can change the version because [configuration] 1.2 was 
released with the dependency to xalan 2.7.0. But because xalan is needed 
only for JDK 1.3 support I think it is not that problematic.

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: svn commit: r426813 - in /jakarta/commons/proper/configuration/trunk/src: java/org/apache/commons/configuration/ test/org/apache/commons/configuration/

Posted by Oliver Heger <ol...@oliver-heger.de>.
Rahul Akolkar wrote:
<snip/>
>>
> <snap/>
> 
> The method in question apparently has existed ever since xalan2 came
> about (my guess would have been there is some version xalan1 in
> lib/ext, but you've tried all that).
> 
> As a side note, xalan 2.6.0 -> 2.7.0 is generally considered a bigger
> leap, so I've left [scxml] at 2.6.0 (its closer to what JDK 1.4 had
> built in, so the 1.4 user has less reason to need the endorsed
> standards override mechanism, and cause any errors therein) -- but
> since [configuration] has had atleast one prior release with a xalan
> 2.7.0 dep (are we using any 2.7.0 specific stuff?), maybe the xerces
> version also should be upgraded? (2.7.0 has been tested with xerces
> 2.7.1).
> 
> *Sigh*, cross-JDK compatibilities for XML processing continues to be a
> pain point, IMO.
> 
> -Rahul
> 
> 
Hi Rahul,

thanks for having a look at this.

We do not use any specific features of xalan 2.7.0. There is one 
transform() call in XMLConfiguration for writing the DOM to a file, 
which works without problems. The two test classes that cause trouble 
try to transform a SAX source into a DOM.

I can test other versions in the next few days. And yes: it is a pain!

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: svn commit: r426813 - in /jakarta/commons/proper/configuration/trunk/src: java/org/apache/commons/configuration/ test/org/apache/commons/configuration/

Posted by Rahul Akolkar <ra...@gmail.com>.
On 7/30/06, Oliver Heger <ol...@oliver-heger.de> wrote:
> Rahul Akolkar wrote:
> > On 7/29/06, oheger@apache.org <oh...@apache.org> wrote:
> >> Author: oheger
> >> Date: Sat Jul 29 07:52:31 2006
> >> New Revision: 426813
> >>
> >> URL: http://svn.apache.org/viewvc?rev=426813&view=rev
> >> Log:
> >> Fixed some problems JDK 1.3 had with our classes
> >>
> >
<snip/>
> >
> > Can you post the trace? (not that its guaranteed to help, but worth a
> > shot -- if we can make any recommendation to JDK 1.3 users).
> >
> > -Rahul
> >
> Okay, here is the exception trace:
>
> Testcase:
> testParse(org.apache.commons.configuration.TestHierarchicalConfigurationXMLReader):
> Caused an ERROR
> null
> java.lang.NoSuchMethodError
>        at
> org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:199)
>        at
> org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:329)
>        at
> org.apache.commons.configuration.TestHierarchicalConfigurationXMLReader.testParse(TestHierarchicalConfigurationXMLReader.java:58)
>
> Maybe it's just a problem with my setup. I did some digging, but was
> unable to solve the problem. For instance I tried newer versions of
> Xerces or xmlapis or checked the JDK1.3 directory structure for other
> included XML parsers - without success.
>
<snap/>

The method in question apparently has existed ever since xalan2 came
about (my guess would have been there is some version xalan1 in
lib/ext, but you've tried all that).

As a side note, xalan 2.6.0 -> 2.7.0 is generally considered a bigger
leap, so I've left [scxml] at 2.6.0 (its closer to what JDK 1.4 had
built in, so the 1.4 user has less reason to need the endorsed
standards override mechanism, and cause any errors therein) -- but
since [configuration] has had atleast one prior release with a xalan
2.7.0 dep (are we using any 2.7.0 specific stuff?), maybe the xerces
version also should be upgraded? (2.7.0 has been tested with xerces
2.7.1).

*Sigh*, cross-JDK compatibilities for XML processing continues to be a
pain point, IMO.

-Rahul


> Oliver
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: svn commit: r426813 - in /jakarta/commons/proper/configuration/trunk/src: java/org/apache/commons/configuration/ test/org/apache/commons/configuration/

Posted by Oliver Heger <ol...@oliver-heger.de>.
Rahul Akolkar wrote:
> On 7/29/06, oheger@apache.org <oh...@apache.org> wrote:
>> Author: oheger
>> Date: Sat Jul 29 07:52:31 2006
>> New Revision: 426813
>>
>> URL: http://svn.apache.org/viewvc?rev=426813&view=rev
>> Log:
>> Fixed some problems JDK 1.3 had with our classes
>>
> <snip/>
>>
>> Modified: 
>> jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfigurationXMLReader.java 
>>
> <snap/>
>> +        try
>> +        {
>> +            //When executed on a JDK 1.3 this line throws a 
>> NoSuchMethodError
>> +            //somewhere deep in Xalan. We simply ignore this.
>> +            trans.transform(source, result);
>> +        }
>> +        catch(NoSuchMethodError ex)
>> +        {
>> +            return;
>> +        }
> <snip/>
> 
> Can you post the trace? (not that its guaranteed to help, but worth a
> shot -- if we can make any recommendation to JDK 1.3 users).
> 
> -Rahul
> 
Okay, here is the exception trace:

Testcase: 
testParse(org.apache.commons.configuration.TestHierarchicalConfigurationXMLReader): 
Caused an ERROR
null
java.lang.NoSuchMethodError
	at 
org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:199)
	at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:329)
	at 
org.apache.commons.configuration.TestHierarchicalConfigurationXMLReader.testParse(TestHierarchicalConfigurationXMLReader.java:58)

Maybe it's just a problem with my setup. I did some digging, but was 
unable to solve the problem. For instance I tried newer versions of 
Xerces or xmlapis or checked the JDK1.3 directory structure for other 
included XML parsers - without success.

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: svn commit: r426813 - in /jakarta/commons/proper/configuration/trunk/src: java/org/apache/commons/configuration/ test/org/apache/commons/configuration/

Posted by Rahul Akolkar <ra...@gmail.com>.
On 7/29/06, oheger@apache.org <oh...@apache.org> wrote:
> Author: oheger
> Date: Sat Jul 29 07:52:31 2006
> New Revision: 426813
>
> URL: http://svn.apache.org/viewvc?rev=426813&view=rev
> Log:
> Fixed some problems JDK 1.3 had with our classes
>
<snip/>
>
> Modified: jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfigurationXMLReader.java
<snap/>
> +        try
> +        {
> +            //When executed on a JDK 1.3 this line throws a NoSuchMethodError
> +            //somewhere deep in Xalan. We simply ignore this.
> +            trans.transform(source, result);
> +        }
> +        catch(NoSuchMethodError ex)
> +        {
> +            return;
> +        }
<snip/>

Can you post the trace? (not that its guaranteed to help, but worth a
shot -- if we can make any recommendation to JDK 1.3 users).

-Rahul

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org