You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Marty Phee <mp...@jump-technologies.com> on 2004/07/28 18:36:07 UTC

[configuration] Can't get it to work properly

I'm having trouble getting the Configuration to work.  As you can see below it
isn't reading the xml file properly.  Everything is getting jumbled up.

If I use Digester by itself it works fine.

I copied most of this from the sample files and the website.

Create configuration.
configFactory = new configurationFactory();
configFactory.setConfigurationURL(...);
configDoc = new ConfigurationXMLDocument(configFactory.getconfiguration());

Instantiate the digester object.
Digester digester  = new 
digester(configDoc.createXMLReader("LeakDetector.ConcurrentListeners"));


Configuration file.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<configuration>
    <additional>
        <hierarchicalXml fileName="leakdetectordebug.xml" at="LeakDetector"/>
    </additional>
</configuration>


Original file leakdetectordebug.xml.
<?xml version="1.0" encoding="UTF-8"?>
<LeakDetector>
    <ConcurrentListeners>
        <ConcurrentListener>
            <Port>5000</Port>
            <LeakListeners>
                <LeakListener>
                    <TopicName>q_atmos_slc1</TopicName>
                    <TopicOwner>leak</TopicOwner>
                    <SubscriberName>LeakDetector</SubscriberName>
                    <UserId>xxxxx</UserId>
                    <Password>xxxxxx</Password>
		    <dbUrl>jdbc:oracle:thin:@x.x.x.x:1521:xxxxxxx</dbUrl>
                </LeakListener>
                <LeakListener>
                    <TopicName>q_atmos_slc2</TopicName>
                    <TopicOwner>leak</TopicOwner>
                    <SubscriberName>LeakDetector</SubscriberName>
                    <UserId>xxxx</UserId>
                    <Password>xxxxxxx</Password>
		   <dbUrl>jdbc:oracle:thin:@x.x.x.x:1521:xxxxxxx</dbUrl>
                </LeakListener>
            </LeakListeners>
        </ConcurrentListener>
    </ConcurrentListeners>
</LeakDetector>

File from ConfigurationXMLDocument.write

?xml version="1.0" encoding="UTF-8"?>
<config>
  <LeakDetector>
    <ConcurrentListeners>
      <ConcurrentListener>
        <LeakListeners>
          <LeakListener>
            <dbUrl>jdbc:oracle:thin:@x.x.x.x:1521:pdlocal</dbUrl>
            <dbUrl>jdbc:oracle:thin:@x.x.x.x:1521:pdlocal</dbUrl>
            <TopicName>q_atmos_slc1</TopicName>
            <TopicName>q_atmos_slc2</TopicName>
          </LeakListener>
        </LeakListeners>
        <Port>5000</Port>
        <LeakListeners>
          <LeakListener>
            <Password>xxxx</Password>
            <Password>xxxxx</Password>
            <TopicOwner>leak</TopicOwner>
            <TopicOwner>leak</TopicOwner>
            <UserId>xxxxx</UserId>
            <UserId>xxxxx</UserId>
            <SubscriberName>LeakDetector</SubscriberName>
            <SubscriberName>LeakDetector</SubscriberName>
          </LeakListener>
        </LeakListeners>
      </ConcurrentListener>
    </ConcurrentListeners>
  </LeakDetector>
</config>

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


RE: [configuration] Can't get it to work properly

Posted by Eric Pugh <ep...@upstate.com>.
Okay, I've removed the ConfigurationXMLDocument..  It was painful to do!  I
am working on a 1.0 RC1, so I'm taking the path of least resistence here.

Eric

> -----Original Message-----
> From: Oliver Heger [mailto:hegero@med.uni-marburg.de]
> Sent: Friday, July 30, 2004 2:45 PM
> To: Jakarta Commons Users List
> Subject: Re: [configuration] Can't get it to work properly
>
>
> Eric,
>
> I have been thinking about this problem for a while, but I really don't
> see a way to get ConfigurationXMLDocument running with a reasonable
> amount of work. So I would opt for removing this class in the 1.0
> release and later add it again. I think, Emanuel is on the same opinion.
>
> I have made a suggestion for a more hierarchical design of
> [configuration], which can be found here:
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=commons-dev@ja
> karta.apache.org&msgNo=52582
>
> This approach would make integration of ConfigurationXMLDocument
> very easy.
>
> Oliver
>
> Eric Pugh wrote:
>
> > Oliver,
> > do you know what changes need to be done to make
> ConfigurationXMLDocument
> > work?  Or do you think we should remove it for now, and get the
> 1.0 release
> > out, so we can start on 2.0 refactoring?
> >
> > Eric
> >
> >
> >>-----Original Message-----
> >>From: Oliver Heger [mailto:hegero@med.uni-marburg.de]
> >>Sent: Thursday, July 29, 2004 7:53 AM
> >>To: Jakarta Commons Users List
> >>Subject: Re: [configuration] Can't get it to work properly
> >>
> >>
> >>Hello Marty,
> >>
> >>usage of ConfigurationXMLDocument is quite problematic ATM because there
> >>have been changes on other classes which brake this class. If you build
> >>[configuration] from the actual CVS sources, you will see that the unit
> >>tests for ConfigurationXMLDocument fail.
> >>
> >>Currently there is no easy solution for this problem. AFAIK it is planed
> >>that ConfigurationXMLDocument won't be part of the 1.0 release of
> >>[configuration] (which will come very soon hopefully). After that some
> >>refactoring and redesign will be performed which solve the problems.
> >>(Can somebody else confirm this or correct me?)
> >>
> >>What could help you with your actual problem is the following: If you
> >>have only one XML configuration file you have to process, you can load
> >>it directly using HierarchicalXMLConfiguration (and don't use
> >>ConfigurationFactory). If you then create a ConfigurationXMLDocument
> >>from this configuration, the resulting XML document will probably keep
> >>its structure and can be processed by Digester.
> >>
> >>Oliver
> >>
> [snip]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org


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


Re: [configuration] Can't get it to work properly

Posted by Oliver Heger <he...@med.uni-marburg.de>.
Eric,

I have been thinking about this problem for a while, but I really don't 
see a way to get ConfigurationXMLDocument running with a reasonable 
amount of work. So I would opt for removing this class in the 1.0 
release and later add it again. I think, Emanuel is on the same opinion.

I have made a suggestion for a more hierarchical design of 
[configuration], which can be found here:
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=commons-dev@jakarta.apache.org&msgNo=52582

This approach would make integration of ConfigurationXMLDocument very easy.

Oliver

Eric Pugh wrote:

> Oliver,
> do you know what changes need to be done to make ConfigurationXMLDocument
> work?  Or do you think we should remove it for now, and get the 1.0 release
> out, so we can start on 2.0 refactoring?
> 
> Eric
> 
> 
>>-----Original Message-----
>>From: Oliver Heger [mailto:hegero@med.uni-marburg.de]
>>Sent: Thursday, July 29, 2004 7:53 AM
>>To: Jakarta Commons Users List
>>Subject: Re: [configuration] Can't get it to work properly
>>
>>
>>Hello Marty,
>>
>>usage of ConfigurationXMLDocument is quite problematic ATM because there
>>have been changes on other classes which brake this class. If you build
>>[configuration] from the actual CVS sources, you will see that the unit
>>tests for ConfigurationXMLDocument fail.
>>
>>Currently there is no easy solution for this problem. AFAIK it is planed
>>that ConfigurationXMLDocument won't be part of the 1.0 release of
>>[configuration] (which will come very soon hopefully). After that some
>>refactoring and redesign will be performed which solve the problems.
>>(Can somebody else confirm this or correct me?)
>>
>>What could help you with your actual problem is the following: If you
>>have only one XML configuration file you have to process, you can load
>>it directly using HierarchicalXMLConfiguration (and don't use
>>ConfigurationFactory). If you then create a ConfigurationXMLDocument
>>from this configuration, the resulting XML document will probably keep
>>its structure and can be processed by Digester.
>>
>>Oliver
>>
[snip]

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


RE: [configuration] Can't get it to work properly

Posted by Eric Pugh <ep...@upstate.com>.
Oliver,
do you know what changes need to be done to make ConfigurationXMLDocument
work?  Or do you think we should remove it for now, and get the 1.0 release
out, so we can start on 2.0 refactoring?

Eric

> -----Original Message-----
> From: Oliver Heger [mailto:hegero@med.uni-marburg.de]
> Sent: Thursday, July 29, 2004 7:53 AM
> To: Jakarta Commons Users List
> Subject: Re: [configuration] Can't get it to work properly
>
>
> Hello Marty,
>
> usage of ConfigurationXMLDocument is quite problematic ATM because there
> have been changes on other classes which brake this class. If you build
> [configuration] from the actual CVS sources, you will see that the unit
> tests for ConfigurationXMLDocument fail.
>
> Currently there is no easy solution for this problem. AFAIK it is planed
> that ConfigurationXMLDocument won't be part of the 1.0 release of
> [configuration] (which will come very soon hopefully). After that some
> refactoring and redesign will be performed which solve the problems.
> (Can somebody else confirm this or correct me?)
>
> What could help you with your actual problem is the following: If you
> have only one XML configuration file you have to process, you can load
> it directly using HierarchicalXMLConfiguration (and don't use
> ConfigurationFactory). If you then create a ConfigurationXMLDocument
> from this configuration, the resulting XML document will probably keep
> its structure and can be processed by Digester.
>
> Oliver
>
> Marty Phee wrote:
> > I'm having trouble getting the Configuration to work.  As you
> can see below it
> > isn't reading the xml file properly.  Everything is getting jumbled up.
> >
> > If I use Digester by itself it works fine.
> >
> > I copied most of this from the sample files and the website.
> >
> > Create configuration.
> > configFactory = new configurationFactory();
> > configFactory.setConfigurationURL(...);
> > configDoc = new
> ConfigurationXMLDocument(configFactory.getconfiguration());
> >
> > Instantiate the digester object.
> > Digester digester  = new
> > digester(configDoc.createXMLReader("LeakDetector.ConcurrentListeners"));
> >
> >
> > Configuration file.
> > <?xml version="1.0" encoding="ISO-8859-1" ?>
> > <configuration>
> >     <additional>
> >         <hierarchicalXml fileName="leakdetectordebug.xml"
> at="LeakDetector"/>
> >     </additional>
> > </configuration>
> >
> >
> > Original file leakdetectordebug.xml.
> > <?xml version="1.0" encoding="UTF-8"?>
> > <LeakDetector>
> >     <ConcurrentListeners>
> >         <ConcurrentListener>
> >             <Port>5000</Port>
> >             <LeakListeners>
> >                 <LeakListener>
> >                     <TopicName>q_atmos_slc1</TopicName>
> >                     <TopicOwner>leak</TopicOwner>
> >                     <SubscriberName>LeakDetector</SubscriberName>
> >                     <UserId>xxxxx</UserId>
> >                     <Password>xxxxxx</Password>
> > 		    <dbUrl>jdbc:oracle:thin:@x.x.x.x:1521:xxxxxxx</dbUrl>
> >                 </LeakListener>
> >                 <LeakListener>
> >                     <TopicName>q_atmos_slc2</TopicName>
> >                     <TopicOwner>leak</TopicOwner>
> >                     <SubscriberName>LeakDetector</SubscriberName>
> >                     <UserId>xxxx</UserId>
> >                     <Password>xxxxxxx</Password>
> > 		   <dbUrl>jdbc:oracle:thin:@x.x.x.x:1521:xxxxxxx</dbUrl>
> >                 </LeakListener>
> >             </LeakListeners>
> >         </ConcurrentListener>
> >     </ConcurrentListeners>
> > </LeakDetector>
> >
> > File from ConfigurationXMLDocument.write
> >
> > ?xml version="1.0" encoding="UTF-8"?>
> > <config>
> >   <LeakDetector>
> >     <ConcurrentListeners>
> >       <ConcurrentListener>
> >         <LeakListeners>
> >           <LeakListener>
> >             <dbUrl>jdbc:oracle:thin:@x.x.x.x:1521:pdlocal</dbUrl>
> >             <dbUrl>jdbc:oracle:thin:@x.x.x.x:1521:pdlocal</dbUrl>
> >             <TopicName>q_atmos_slc1</TopicName>
> >             <TopicName>q_atmos_slc2</TopicName>
> >           </LeakListener>
> >         </LeakListeners>
> >         <Port>5000</Port>
> >         <LeakListeners>
> >           <LeakListener>
> >             <Password>xxxx</Password>
> >             <Password>xxxxx</Password>
> >             <TopicOwner>leak</TopicOwner>
> >             <TopicOwner>leak</TopicOwner>
> >             <UserId>xxxxx</UserId>
> >             <UserId>xxxxx</UserId>
> >             <SubscriberName>LeakDetector</SubscriberName>
> >             <SubscriberName>LeakDetector</SubscriberName>
> >           </LeakListener>
> >         </LeakListeners>
> >       </ConcurrentListener>
> >     </ConcurrentListeners>
> >   </LeakDetector>
> > </config>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
>
>
> --
> Dipl.-Inform. Oliver Heger
> Zentrale Informationsverarbeitung (ZIV) / Bereich Anwenderverfahren
> Klinikum der Philipps-Universität Marburg
> Bunsenstraße 3,
> D-35037 Marburg
> Tel: +49 6421 28-66592
> mailto:oliver.heger@med.uni-marburg.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org


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


Re: [configuration] Can't get it to work properly

Posted by Oliver Heger <he...@med.uni-marburg.de>.
Hello Marty,

usage of ConfigurationXMLDocument is quite problematic ATM because there 
have been changes on other classes which brake this class. If you build 
[configuration] from the actual CVS sources, you will see that the unit 
tests for ConfigurationXMLDocument fail.

Currently there is no easy solution for this problem. AFAIK it is planed 
that ConfigurationXMLDocument won't be part of the 1.0 release of 
[configuration] (which will come very soon hopefully). After that some 
refactoring and redesign will be performed which solve the problems. 
(Can somebody else confirm this or correct me?)

What could help you with your actual problem is the following: If you 
have only one XML configuration file you have to process, you can load 
it directly using HierarchicalXMLConfiguration (and don't use 
ConfigurationFactory). If you then create a ConfigurationXMLDocument 
from this configuration, the resulting XML document will probably keep 
its structure and can be processed by Digester.

Oliver

Marty Phee wrote:
> I'm having trouble getting the Configuration to work.  As you can see below it
> isn't reading the xml file properly.  Everything is getting jumbled up.
> 
> If I use Digester by itself it works fine.
> 
> I copied most of this from the sample files and the website.
> 
> Create configuration.
> configFactory = new configurationFactory();
> configFactory.setConfigurationURL(...);
> configDoc = new ConfigurationXMLDocument(configFactory.getconfiguration());
> 
> Instantiate the digester object.
> Digester digester  = new 
> digester(configDoc.createXMLReader("LeakDetector.ConcurrentListeners"));
> 
> 
> Configuration file.
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <configuration>
>     <additional>
>         <hierarchicalXml fileName="leakdetectordebug.xml" at="LeakDetector"/>
>     </additional>
> </configuration>
> 
> 
> Original file leakdetectordebug.xml.
> <?xml version="1.0" encoding="UTF-8"?>
> <LeakDetector>
>     <ConcurrentListeners>
>         <ConcurrentListener>
>             <Port>5000</Port>
>             <LeakListeners>
>                 <LeakListener>
>                     <TopicName>q_atmos_slc1</TopicName>
>                     <TopicOwner>leak</TopicOwner>
>                     <SubscriberName>LeakDetector</SubscriberName>
>                     <UserId>xxxxx</UserId>
>                     <Password>xxxxxx</Password>
> 		    <dbUrl>jdbc:oracle:thin:@x.x.x.x:1521:xxxxxxx</dbUrl>
>                 </LeakListener>
>                 <LeakListener>
>                     <TopicName>q_atmos_slc2</TopicName>
>                     <TopicOwner>leak</TopicOwner>
>                     <SubscriberName>LeakDetector</SubscriberName>
>                     <UserId>xxxx</UserId>
>                     <Password>xxxxxxx</Password>
> 		   <dbUrl>jdbc:oracle:thin:@x.x.x.x:1521:xxxxxxx</dbUrl>
>                 </LeakListener>
>             </LeakListeners>
>         </ConcurrentListener>
>     </ConcurrentListeners>
> </LeakDetector>
> 
> File from ConfigurationXMLDocument.write
> 
> ?xml version="1.0" encoding="UTF-8"?>
> <config>
>   <LeakDetector>
>     <ConcurrentListeners>
>       <ConcurrentListener>
>         <LeakListeners>
>           <LeakListener>
>             <dbUrl>jdbc:oracle:thin:@x.x.x.x:1521:pdlocal</dbUrl>
>             <dbUrl>jdbc:oracle:thin:@x.x.x.x:1521:pdlocal</dbUrl>
>             <TopicName>q_atmos_slc1</TopicName>
>             <TopicName>q_atmos_slc2</TopicName>
>           </LeakListener>
>         </LeakListeners>
>         <Port>5000</Port>
>         <LeakListeners>
>           <LeakListener>
>             <Password>xxxx</Password>
>             <Password>xxxxx</Password>
>             <TopicOwner>leak</TopicOwner>
>             <TopicOwner>leak</TopicOwner>
>             <UserId>xxxxx</UserId>
>             <UserId>xxxxx</UserId>
>             <SubscriberName>LeakDetector</SubscriberName>
>             <SubscriberName>LeakDetector</SubscriberName>
>           </LeakListener>
>         </LeakListeners>
>       </ConcurrentListener>
>     </ConcurrentListeners>
>   </LeakDetector>
> </config>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 


-- 
Dipl.-Inform. Oliver Heger
Zentrale Informationsverarbeitung (ZIV) / Bereich Anwenderverfahren
Klinikum der Philipps-Universität Marburg
Bunsenstraße 3,
D-35037 Marburg
Tel: +49 6421 28-66592
mailto:oliver.heger@med.uni-marburg.de

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