You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Pim Tjeertes <tj...@xs4all.nl> on 2008/10/29 22:53:30 UTC
DigesterPipelineFactory(URL confURL) Is unable to set ruleset
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
Re: DigesterPipelineFactory(URL confURL) Is unable to set ruleset
Posted by tjeertes <tj...@xs4all.nl>.
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
Re: DigesterPipelineFactory(URL confURL) Is unable to set ruleset
Posted by Ken Tanaka <Ke...@noaa.gov>.
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
>
>
--
= Enterprise Data Services Division ===============
| CIRES, National Geophysical Data Center / NOAA |
| 303-497-6221 |
= Ken.Tanaka@noaa.gov =============================
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org