commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tjeertes <tjeer...@xs4all.nl>
Subject Re: DigesterPipelineFactory(URL confURL) Is unable to set ruleset
Date Fri, 31 Oct 2008 20:48:41 GMT
Hello Ken,

indeed the code section seems to be alright.
I forget to include the digester package.

Thanks for putting me on track agian.
Pim

Ken Tanaka wrote:
> Pim,
>
> The code you point out looks kind of odd, I'm not sure if it needs to 
> be that way or not, I haven't had a chance to dig very deep. But the 
> code has been working for me as is.
>
> The error:
>
> java.lang.NoClassDefFoundError: org/apache/commons/digester/RuleSetBase
>
>
> indicates that you are not getting all the required libraries in your 
> class path.
>
> I recommend adding the assembly plugin to the pom.xml so the <plugins> 
> section looks like this
>
>    <build>
>        ...
>        <plugins>
>            <plugin>
>                <artifactId>maven-site-plugin</artifactId>
>                <configuration>
>                    <locales>en</locales>
>                </configuration>
>            </plugin>
>            <plugin>
>                <!-- Usage: mvn assembly:assembly -->
>                <artifactId>maven-assembly-plugin</artifactId>
>                <configuration>
>                    <descriptorRefs>
>                        
> <descriptorRef>jar-with-dependencies</descriptorRef>
>                    </descriptorRefs>
>                    <archive>
>                        <manifest>
>                            
> <mainClass>org.apache.commons.pipeline.config.DigesterPipelineFactory</mainClass>

>
>                        </manifest>
>                    </archive>
>                </configuration>
>            </plugin>
>        </plugins>
>    </build>
>
> Create a jar with dependencies with this command (in the trunk 
> directory where the pom.xml file is)
> mvn assembly:assembly
>
> If that builds successfully, then you should have all the required 
> libraries. Then run with
>
> java -jar 
> target/commons-pipeline-1.0-SNAPSHOT-jar-with-dependencies.jar 
> target/test-classes/test_conf.xml
>
> -Ken
>
> Pim Tjeertes wrote:
>> Hello,
>>
>> I'm trying out the Pipeline because the concept intriges me.
>> Ofcourse I'm starting with a really simple example using the
>> DigesterPipelineFactory(URL confURL).
>>
>> But when I do I get a Exception in thread "main"
>> java.lang.NoClassDefFoundError: org/apache/commons/digester/RuleSetBase
>>
>> I think I found out why;
>>     public DigesterPipelineFactory(URL confURL) {
>>         if (confURL == null) throw new
>> IllegalArgumentException("Configuration file URL may not be
>> null.");
>>         this.confURL = confURL;
>>
>>         //PipelineRuleSet needs a reference to {@link
>> org.apache.commons.digester.RuleSet RuleSet}s
>>         //used to parse the configuration file in case configuration is
>> split up between multiple
>>         //files.
>>         ruleSets.add(new PipelineRuleSet(ruleSets));
>>     }
>>
>>
>> I think this is the problem: (Its setting itself to itself instead of 
>> the
>> new file I gave the Digestor)
>> ruleSets.add(new PipelineRuleSet(ruleSets));
>> I would have expected something like:
>> ruleSets.add(new PipelineRuleSet(this.confURL));
>>
>> Can somebody verify whether my assumption is correct or that I'm doing
>> something stupid?
>>
>> Kind regards,
>> Pim
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>   
>


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


Mime
View raw message