You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Sandra Schweighart <Sa...@Innovations.de> on 2006/04/04 11:40:20 UTC

question using drools component

Hello!

I tried to use drools but I don't understand one thing:

Where do I have to put the file "rulebase.xml" to? In conjunction with
this I also don't understand the path at  the activationSpec:
<property name="ruleBaseResource"
value="classpath:org/apache/servicemix/components/drools/rulebase.xml" />

I always get an FileNotFoundException. So I tried to load the file from
the filesystem
< .... value="file:d:/servicemix/conf/rulebase.xml"/>.
Now I didn't get the FileNotFoundException any more ... but then I got
the message that "rule-set" wasn't found. I'm very confused now.

I thought the path points to a jbi component and I wrote one that
includes the rulebase.xml file and installed it into the
components-directory.
<property name="ruleBaseResource"
value="classpath:org/apache/servicemix/components/MyComponent/rulebase.xml"
/>
=> threw an exception

And than I tried using the package path of my component:
<property name="ruleBaseResource"
value="classpath:de/myCompany/jbi/test/MyComponent/rulebase.xml" />
=>threw an exception

I think I didn't understand that at all.
Could any body explain that path thing to me and where to put my
rulebase.xml?

Thanks
Sandra

Re: question using drools component

Posted by Guillaume Nodet <gn...@gmail.com>.
Hoops, sorry :(
This reply was about WSIF, not drools.
I will look into this one asap.

Guillaume

On 4/5/06, Guillaume Nodet <gn...@gmail.com> wrote:
> This should be fixed now, see https://issues.apache.org/activemq/browse/SM-383.
>
> Cheers,
> Guillaume Nodet
>
> On 4/5/06, Sandra Schweighart <Sa...@innovations.de> wrote:
> > Hello!
> >
> > I've set everything in log4j.xml to DEBUG level but still the lines
> > around "Cann not find ..." are with "INFO". This is what is happening
> > around:
> >
> > DEBUG - ManagementContext.registerSystemService(567) | Registering
> > system service:
> > org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,Name=AdminCommandsService
> > INFO - JBIContainer.init(508) | ServiceMix JBI Container
> > (http://servicemix.org/) name: ServiceMix running version: 3.0-SNAPSHOT
> > INFO - JBIContainer.activateComponent(978) | Activating component for:
> > [container=ServiceMix,name=droolsRouter] with service:
> > {http://servicemix.apache.org/services/drools}droolsRouter component:
> > org.apache.servicemix.components.drools.DroolsComponent@1566a6c
> > INFO - ComponentMBeanImpl.init(184) | Initializing component: droolsRouter
> > (null: 4, 49): cvc-elt.1: Cannot find the declaration of element 'rule-set'.
> > DEBUG - ComponentContextImpl.activateEndpoint(133) | Component:
> > droolsRouter activated endpoint:
> > {http://servicemix.apache.org/services/drools}droolsRouter : droolsRouter
> > DEBUG - EndpointRegistry.retrieveInterfacesFromDescription(229) |
> > Endpoint
> > ServiceEndpoint[service={http://servicemix.apache.org/services/drools}droolsRouter,endpoint=droolsRouter]
> > has no service description
> >
> > I'm working with Windows 2000, ServiceMix 3.0SNAPSHOT of last night and
> > I'm trying to get the Example on http://www.servicemix.org/Drools
> > working. I've copied the rulebase.xml from
> > http://www.servicemix.org/Drools and customized the servicemix.xml to
> > find my rulebase.xml in conf-directory.
> >
> > My component finds the service endpoint "droolsRouter" but the service
> > doesn't do anything.
> >
> > Has anyone succeeded in using Drools?
> >
> > Greetings
> > Sandra
> >
> > Guillaume Nodet wrote:
> >
> > >Please try to change the log level to DEBUG in the ./conf/log4j.xml
> > >log configuration file and post any log / stack trace .
> > >I guess there will be more informations ...
> > >
> > >Cheers,
> > >Guillaume Nodet
> > >
> > >On 4/5/06, Sandra Schweighart <Sa...@innovations.de> wrote:
> > >
> > >
> > >>Thanks a lot Guillaume!
> > >>I succeeded in using file:xxx and now also with classpath:xxx
> > >>
> > >>Now I have still the following problem:
> > >>Whrere does the "Cannot find.." message come from? An why can't it be found?
> > >>My rulebase.xml doesn't contain anything else than the element
> > >>'rule-set' with its content. I even deleted the xml version element.
> > >>
> > >>INFO - ComponentMBeanImpl.init(184) | Initializing component: droolsRouter
> > >>(null: 4, 49): cvc-elt.1: Cannot find the declaration of element 'rule-set'.
> > >>
> > >>I get this message even with the latest 3.0-SNAPSHOT build.
> > >>
> > >>Sandra
> > >>
> > >>
> > >>Guillaume Nodet wrote:
> > >>
> > >>
> > >>
> >
> >
>

Re: question using drools component

Posted by Guillaume Nodet <gn...@gmail.com>.
This should be fixed now, see https://issues.apache.org/activemq/browse/SM-383.

Cheers,
Guillaume Nodet

On 4/5/06, Sandra Schweighart <Sa...@innovations.de> wrote:
> Hello!
>
> I've set everything in log4j.xml to DEBUG level but still the lines
> around "Cann not find ..." are with "INFO". This is what is happening
> around:
>
> DEBUG - ManagementContext.registerSystemService(567) | Registering
> system service:
> org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,Name=AdminCommandsService
> INFO - JBIContainer.init(508) | ServiceMix JBI Container
> (http://servicemix.org/) name: ServiceMix running version: 3.0-SNAPSHOT
> INFO - JBIContainer.activateComponent(978) | Activating component for:
> [container=ServiceMix,name=droolsRouter] with service:
> {http://servicemix.apache.org/services/drools}droolsRouter component:
> org.apache.servicemix.components.drools.DroolsComponent@1566a6c
> INFO - ComponentMBeanImpl.init(184) | Initializing component: droolsRouter
> (null: 4, 49): cvc-elt.1: Cannot find the declaration of element 'rule-set'.
> DEBUG - ComponentContextImpl.activateEndpoint(133) | Component:
> droolsRouter activated endpoint:
> {http://servicemix.apache.org/services/drools}droolsRouter : droolsRouter
> DEBUG - EndpointRegistry.retrieveInterfacesFromDescription(229) |
> Endpoint
> ServiceEndpoint[service={http://servicemix.apache.org/services/drools}droolsRouter,endpoint=droolsRouter]
> has no service description
>
> I'm working with Windows 2000, ServiceMix 3.0SNAPSHOT of last night and
> I'm trying to get the Example on http://www.servicemix.org/Drools
> working. I've copied the rulebase.xml from
> http://www.servicemix.org/Drools and customized the servicemix.xml to
> find my rulebase.xml in conf-directory.
>
> My component finds the service endpoint "droolsRouter" but the service
> doesn't do anything.
>
> Has anyone succeeded in using Drools?
>
> Greetings
> Sandra
>
> Guillaume Nodet wrote:
>
> >Please try to change the log level to DEBUG in the ./conf/log4j.xml
> >log configuration file and post any log / stack trace .
> >I guess there will be more informations ...
> >
> >Cheers,
> >Guillaume Nodet
> >
> >On 4/5/06, Sandra Schweighart <Sa...@innovations.de> wrote:
> >
> >
> >>Thanks a lot Guillaume!
> >>I succeeded in using file:xxx and now also with classpath:xxx
> >>
> >>Now I have still the following problem:
> >>Whrere does the "Cannot find.." message come from? An why can't it be found?
> >>My rulebase.xml doesn't contain anything else than the element
> >>'rule-set' with its content. I even deleted the xml version element.
> >>
> >>INFO - ComponentMBeanImpl.init(184) | Initializing component: droolsRouter
> >>(null: 4, 49): cvc-elt.1: Cannot find the declaration of element 'rule-set'.
> >>
> >>I get this message even with the latest 3.0-SNAPSHOT build.
> >>
> >>Sandra
> >>
> >>
> >>Guillaume Nodet wrote:
> >>
> >>
> >>
>
>

Re: question using drools component

Posted by Guillaume Nodet <gn...@gmail.com>.
The "(null: 4, 49): cvc-elt.1: Cannot find the declaration of element
'rule-set'." message is an output from Drools.  I guess this is about
validating the xml, but this is not a problem as our unit tests log
that also.

The example given on the drools component wiki will forward the
exchange to the "http://servicemix.org/cheese/", "receiver" service if
the input message has a property named 'idText' with the value '2'. 
Do you have such a property on your message ? else the message will be
lost.

Cheers,
Guillaume Nodet

On 4/5/06, Sandra Schweighart <Sa...@innovations.de> wrote:
> Hello!
>
> I've set everything in log4j.xml to DEBUG level but still the lines
> around "Cann not find ..." are with "INFO". This is what is happening
> around:
>
> DEBUG - ManagementContext.registerSystemService(567) | Registering
> system service:
> org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,Name=AdminCommandsService
> INFO - JBIContainer.init(508) | ServiceMix JBI Container
> (http://servicemix.org/) name: ServiceMix running version: 3.0-SNAPSHOT
> INFO - JBIContainer.activateComponent(978) | Activating component for:
> [container=ServiceMix,name=droolsRouter] with service:
> {http://servicemix.apache.org/services/drools}droolsRouter component:
> org.apache.servicemix.components.drools.DroolsComponent@1566a6c
> INFO - ComponentMBeanImpl.init(184) | Initializing component: droolsRouter
> (null: 4, 49): cvc-elt.1: Cannot find the declaration of element 'rule-set'.
> DEBUG - ComponentContextImpl.activateEndpoint(133) | Component:
> droolsRouter activated endpoint:
> {http://servicemix.apache.org/services/drools}droolsRouter : droolsRouter
> DEBUG - EndpointRegistry.retrieveInterfacesFromDescription(229) |
> Endpoint
> ServiceEndpoint[service={http://servicemix.apache.org/services/drools}droolsRouter,endpoint=droolsRouter]
> has no service description
>
> I'm working with Windows 2000, ServiceMix 3.0SNAPSHOT of last night and
> I'm trying to get the Example on http://www.servicemix.org/Drools
> working. I've copied the rulebase.xml from
> http://www.servicemix.org/Drools and customized the servicemix.xml to
> find my rulebase.xml in conf-directory.
>
> My component finds the service endpoint "droolsRouter" but the service
> doesn't do anything.
>
> Has anyone succeeded in using Drools?
>
> Greetings
> Sandra
>
> Guillaume Nodet wrote:
>
> >Please try to change the log level to DEBUG in the ./conf/log4j.xml
> >log configuration file and post any log / stack trace .
> >I guess there will be more informations ...
> >
> >Cheers,
> >Guillaume Nodet
> >
> >On 4/5/06, Sandra Schweighart <Sa...@innovations.de> wrote:
> >
> >
> >>Thanks a lot Guillaume!
> >>I succeeded in using file:xxx and now also with classpath:xxx
> >>
> >>Now I have still the following problem:
> >>Whrere does the "Cannot find.." message come from? An why can't it be found?
> >>My rulebase.xml doesn't contain anything else than the element
> >>'rule-set' with its content. I even deleted the xml version element.
> >>
> >>INFO - ComponentMBeanImpl.init(184) | Initializing component: droolsRouter
> >>(null: 4, 49): cvc-elt.1: Cannot find the declaration of element 'rule-set'.
> >>
> >>I get this message even with the latest 3.0-SNAPSHOT build.
> >>
> >>Sandra
> >>
> >>
> >>Guillaume Nodet wrote:
> >>
> >>
> >>
>
>

Re: question using drools component

Posted by Sandra Schweighart <Sa...@Innovations.de>.
Hello!

I've set everything in log4j.xml to DEBUG level but still the lines
around "Cann not find ..." are with "INFO". This is what is happening
around:

DEBUG - ManagementContext.registerSystemService(567) | Registering
system service:
org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,Name=AdminCommandsService
INFO - JBIContainer.init(508) | ServiceMix JBI Container
(http://servicemix.org/) name: ServiceMix running version: 3.0-SNAPSHOT
INFO - JBIContainer.activateComponent(978) | Activating component for:
[container=ServiceMix,name=droolsRouter] with service:
{http://servicemix.apache.org/services/drools}droolsRouter component:
org.apache.servicemix.components.drools.DroolsComponent@1566a6c
INFO - ComponentMBeanImpl.init(184) | Initializing component: droolsRouter
(null: 4, 49): cvc-elt.1: Cannot find the declaration of element 'rule-set'.
DEBUG - ComponentContextImpl.activateEndpoint(133) | Component:
droolsRouter activated endpoint:
{http://servicemix.apache.org/services/drools}droolsRouter : droolsRouter
DEBUG - EndpointRegistry.retrieveInterfacesFromDescription(229) |
Endpoint
ServiceEndpoint[service={http://servicemix.apache.org/services/drools}droolsRouter,endpoint=droolsRouter]
has no service description

I'm working with Windows 2000, ServiceMix 3.0SNAPSHOT of last night and
I'm trying to get the Example on http://www.servicemix.org/Drools
working. I've copied the rulebase.xml from
http://www.servicemix.org/Drools and customized the servicemix.xml to
find my rulebase.xml in conf-directory.

My component finds the service endpoint "droolsRouter" but the service
doesn't do anything.

Has anyone succeeded in using Drools?

Greetings
Sandra

Guillaume Nodet wrote:

>Please try to change the log level to DEBUG in the ./conf/log4j.xml
>log configuration file and post any log / stack trace .
>I guess there will be more informations ...
>
>Cheers,
>Guillaume Nodet
>
>On 4/5/06, Sandra Schweighart <Sa...@innovations.de> wrote:
>  
>
>>Thanks a lot Guillaume!
>>I succeeded in using file:xxx and now also with classpath:xxx
>>
>>Now I have still the following problem:
>>Whrere does the "Cannot find.." message come from? An why can't it be found?
>>My rulebase.xml doesn't contain anything else than the element
>>'rule-set' with its content. I even deleted the xml version element.
>>
>>INFO - ComponentMBeanImpl.init(184) | Initializing component: droolsRouter
>>(null: 4, 49): cvc-elt.1: Cannot find the declaration of element 'rule-set'.
>>
>>I get this message even with the latest 3.0-SNAPSHOT build.
>>
>>Sandra
>>
>>
>>Guillaume Nodet wrote:
>>
>>    
>>


Re: question using drools component

Posted by Guillaume Nodet <gn...@gmail.com>.
Please try to change the log level to DEBUG in the ./conf/log4j.xml
log configuration file and post any log / stack trace .
I guess there will be more informations ...

Cheers,
Guillaume Nodet

On 4/5/06, Sandra Schweighart <Sa...@innovations.de> wrote:
> Thanks a lot Guillaume!
> I succeeded in using file:xxx and now also with classpath:xxx
>
> Now I have still the following problem:
> Whrere does the "Cannot find.." message come from? An why can't it be found?
> My rulebase.xml doesn't contain anything else than the element
> 'rule-set' with its content. I even deleted the xml version element.
>
> INFO - ComponentMBeanImpl.init(184) | Initializing component: droolsRouter
> (null: 4, 49): cvc-elt.1: Cannot find the declaration of element 'rule-set'.
>
> I get this message even with the latest 3.0-SNAPSHOT build.
>
> Sandra
>
>
> Guillaume Nodet wrote:
>
> >Hi !
> >
> >The drools component uses a spring resource to locate the rulebase.
> >You can use several constructs:
> >  file:xxx will look for the rulebase on the filesystem in the given path
> >  classpath:xxx will look in the classpath
> >Note that the path given in the classpath case is in fact the name of
> >the package where the rulebase is.  So the
> >"classpath:org/apache/servicemix/components/drools/rulebase.xml" will
> >be used to find the rulebase.xml file in the
> >org.apache.servicemix.components.drools package.   In ServiceMix
> >distribution, the classpath is built with the ./conf directory, all
> >jars in ./lib and ./lib/optional.
> >This is really a classpath issue, so it's difficult to help more
> >without knowing the full environment..
> >
> >Hope this helps,
> >Guillaume Nodet
> >
> >On 4/4/06, Sandra Schweighart <Sa...@innovations.de> wrote:
> >
> >
> >>Hello!
> >>
> >>I tried to use drools but I don't understand one thing:
> >>
> >>Where do I have to put the file "rulebase.xml" to? In conjunction with
> >>this I also don't understand the path at  the activationSpec:
> >><property name="ruleBaseResource"
> >>value="classpath:org/apache/servicemix/components/drools/rulebase.xml" />
> >>
> >>I always get an FileNotFoundException. So I tried to load the file from
> >>the filesystem
> >>< .... value="file:d:/servicemix/conf/rulebase.xml"/>.
> >>Now I didn't get the FileNotFoundException any more ... but then I got
> >>the message that "rule-set" wasn't found. I'm very confused now.
> >>
> >>I thought the path points to a jbi component and I wrote one that
> >>includes the rulebase.xml file and installed it into the
> >>components-directory.
> >><property name="ruleBaseResource"
> >>value="classpath:org/apache/servicemix/components/MyComponent/rulebase.xml"
> >>/>
> >>=> threw an exception
> >>
> >>And than I tried using the package path of my component:
> >><property name="ruleBaseResource"
> >>value="classpath:de/myCompany/jbi/test/MyComponent/rulebase.xml" />
> >>=>threw an exception
> >>
> >>I think I didn't understand that at all.
> >>Could any body explain that path thing to me and where to put my
> >>rulebase.xml?
> >>
> >>Thanks
> >>Sandra
> >>
> >>
> >>
>
>

Re: question using drools component

Posted by Sandra Schweighart <Sa...@Innovations.de>.
Thanks a lot Guillaume!
I succeeded in using file:xxx and now also with classpath:xxx

Now I have still the following problem:
Whrere does the "Cannot find.." message come from? An why can't it be found?
My rulebase.xml doesn't contain anything else than the element
'rule-set' with its content. I even deleted the xml version element.

INFO - ComponentMBeanImpl.init(184) | Initializing component: droolsRouter
(null: 4, 49): cvc-elt.1: Cannot find the declaration of element 'rule-set'.

I get this message even with the latest 3.0-SNAPSHOT build.

Sandra


Guillaume Nodet wrote:

>Hi !
>
>The drools component uses a spring resource to locate the rulebase.
>You can use several constructs:
>  file:xxx will look for the rulebase on the filesystem in the given path
>  classpath:xxx will look in the classpath
>Note that the path given in the classpath case is in fact the name of
>the package where the rulebase is.  So the
>"classpath:org/apache/servicemix/components/drools/rulebase.xml" will
>be used to find the rulebase.xml file in the
>org.apache.servicemix.components.drools package.   In ServiceMix
>distribution, the classpath is built with the ./conf directory, all
>jars in ./lib and ./lib/optional.
>This is really a classpath issue, so it's difficult to help more
>without knowing the full environment..
>
>Hope this helps,
>Guillaume Nodet
>
>On 4/4/06, Sandra Schweighart <Sa...@innovations.de> wrote:
>  
>
>>Hello!
>>
>>I tried to use drools but I don't understand one thing:
>>
>>Where do I have to put the file "rulebase.xml" to? In conjunction with
>>this I also don't understand the path at  the activationSpec:
>><property name="ruleBaseResource"
>>value="classpath:org/apache/servicemix/components/drools/rulebase.xml" />
>>
>>I always get an FileNotFoundException. So I tried to load the file from
>>the filesystem
>>< .... value="file:d:/servicemix/conf/rulebase.xml"/>.
>>Now I didn't get the FileNotFoundException any more ... but then I got
>>the message that "rule-set" wasn't found. I'm very confused now.
>>
>>I thought the path points to a jbi component and I wrote one that
>>includes the rulebase.xml file and installed it into the
>>components-directory.
>><property name="ruleBaseResource"
>>value="classpath:org/apache/servicemix/components/MyComponent/rulebase.xml"
>>/>
>>=> threw an exception
>>
>>And than I tried using the package path of my component:
>><property name="ruleBaseResource"
>>value="classpath:de/myCompany/jbi/test/MyComponent/rulebase.xml" />
>>=>threw an exception
>>
>>I think I didn't understand that at all.
>>Could any body explain that path thing to me and where to put my
>>rulebase.xml?
>>
>>Thanks
>>Sandra
>>
>>    
>>


Re: question using drools component

Posted by Guillaume Nodet <gn...@gmail.com>.
Hi !

The drools component uses a spring resource to locate the rulebase.
You can use several constructs:
  file:xxx will look for the rulebase on the filesystem in the given path
  classpath:xxx will look in the classpath
Note that the path given in the classpath case is in fact the name of
the package where the rulebase is.  So the
"classpath:org/apache/servicemix/components/drools/rulebase.xml" will
be used to find the rulebase.xml file in the
org.apache.servicemix.components.drools package.   In ServiceMix
distribution, the classpath is built with the ./conf directory, all
jars in ./lib and ./lib/optional.
This is really a classpath issue, so it's difficult to help more
without knowing the full environment..

Hope this helps,
Guillaume Nodet

On 4/4/06, Sandra Schweighart <Sa...@innovations.de> wrote:
> Hello!
>
> I tried to use drools but I don't understand one thing:
>
> Where do I have to put the file "rulebase.xml" to? In conjunction with
> this I also don't understand the path at  the activationSpec:
> <property name="ruleBaseResource"
> value="classpath:org/apache/servicemix/components/drools/rulebase.xml" />
>
> I always get an FileNotFoundException. So I tried to load the file from
> the filesystem
> < .... value="file:d:/servicemix/conf/rulebase.xml"/>.
> Now I didn't get the FileNotFoundException any more ... but then I got
> the message that "rule-set" wasn't found. I'm very confused now.
>
> I thought the path points to a jbi component and I wrote one that
> includes the rulebase.xml file and installed it into the
> components-directory.
> <property name="ruleBaseResource"
> value="classpath:org/apache/servicemix/components/MyComponent/rulebase.xml"
> />
> => threw an exception
>
> And than I tried using the package path of my component:
> <property name="ruleBaseResource"
> value="classpath:de/myCompany/jbi/test/MyComponent/rulebase.xml" />
> =>threw an exception
>
> I think I didn't understand that at all.
> Could any body explain that path thing to me and where to put my
> rulebase.xml?
>
> Thanks
> Sandra
>