[rules-users] Error with conversion from .brl to .drl file

Fnu Mahalakshmi FMahalakshmi at nyx.com
Mon Jun 14 10:24:15 EDT 2010


Hi,

This is my exact code:
I added the missing BRXMLpackage again.
I have my .brl file in the current working directory with all the .drlfiles.
When I do: File file = new File(rulesFiles); => I get FileNotFound exception // I don't understand this as the file is in the correct path as other files

When I hardcode the path - I get the conversion to the XML format (which I printed to the console)- the new drl file gets formed - but not in the current working directory - it is in the main project directory.
Program again crashes at this line:
 addRulesToThisPackage.addPackageFromDrl(new

                         InputStreamReader(RuleRunner.class.getResourceAsStream(drlFilePath)));

I get error stack:


Exception in thread "main" java.lang.NullPointerException
        at java.io.Reader.<init>(Unknown Source)
        at java.io.InputStreamReader.<init>(Unknown Source)
        at com.org.RuleRunner.loadRuleFile(RuleRunner.java:81)
        at com.org.RuleRunner.loadRules(RuleRunner.java:43)
        at com.org.RuleRunner.runStatelessRules(RuleRunner.java:104)
        at com.org.RulesTest.main(RulesTest.java:40)

**********************************************************************
My code is as follows:


File file = new File(rulesFiles);

            String brl = null;

            try{

                  BRXMLPersistence read = (BRXMLPersistence) BRXMLPersistence.getInstance();

                  BRDRLPersistence write = (BRDRLPersistence) BRDRLPersistence.getInstance();

                  brl = FileUtils.readFileToString(file);

                System.out.println("File content: " + brl);

                String outputDRL = write.marshal(read.unmarshal(brl));

                String drlFilePath = "drlFile.drl";

                File drlFile = new File(drlFilePath);

                FileUtils.writeStringToFile(drlFile, outputDRL);

                addRulesToThisPackage.addPackageFromDrl(new

                         InputStreamReader(RuleRunner.class.getResourceAsStream(drlFilePath)));

            }catch (IOException e) {



                  e.printStackTrace();

             }


Am I going wrong at some part????


Please help,

Thanks
M

-----Original Message-----
From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of rules-users-request at lists.jboss.org
Sent: Monday, June 14, 2010 10:02 AM
To: rules-users at lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 69

Send rules-users mailing list submissions to
        rules-users at lists.jboss.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
        rules-users-request at lists.jboss.org

You can reach the person managing the list at
        rules-users-owner at lists.jboss.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."


Today's Topics:

   1. Re: Error with conversion from .brl to .drl file (Fnu Mahalakshmi)
   2. Re: Error with conversion from .brl to .drl file
      (Swindells, Thomas)
   3. Re: rules-users Digest, Vol 43, Issue 68 (Fnu Mahalakshmi)


----------------------------------------------------------------------

Message: 1
Date: Mon, 14 Jun 2010 09:23:33 -0400
From: Fnu Mahalakshmi <FMahalakshmi at nyx.com>
Subject: Re: [rules-users] Error with conversion from .brl to .drl
        file
To: "'rules-users at lists.jboss.org'" <rules-users at lists.jboss.org>
Message-ID:
        <994758E35590274E955FA75763C5AA5002D010F3 at MTEXMBXP01.ad.NYX.com>
Content-Type: text/plain; charset="us-ascii"


Hi Giovanni,

The classpath shows the commons jar added under UserEntries.

I am getting another error when I try running the program now :

Exception in thread "main" java.lang.NoClassDefFoundError: org/drools/brms/server/util/BRXMLPersistence
        at com.org.RulesTest.main(RulesTest.java:40)
Caused by: java.lang.ClassNotFoundException: org.drools.brms.server.util.BRXMLPersistence
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        ... 1 more

This was not coming till now.
The exception come at the line when the .brl file is to  be processed.
I am not able to figure out. I tried googling the error. But no use!

Please help!
Thanks
M

------------------------------

Message: 2
Date: Mon, 14 Jun 2010 10:09:50 +0200
From: Giovanni Motta <mottagio at gmail.com>
Subject: Re: [rules-users] Error with conversion from .brl to .drl
        file
To: Rules Users List <rules-users at lists.jboss.org>
Message-ID:
        <AANLkTim_pHwmnwB0GmYWqE05FHCL1NZkG0f7nP3bHgj0 at mail.gmail.com>
Content-Type: text/plain; charset="windows-1252"

Are you launching the application from within eclipse?
Have you checked the classpath of the launch configuration? You can see it
by right-clicking the .java file and then selecting "run as --> run
configurations..."
Does it show the commons jar?


2010/6/12 Fnu Mahalakshmi <FMahalakshmi at nyx.com>

>  Hi,
>
> I just tried everything I could think of but still getting error.
>
> Using following code for converting from .brl file to .drl file:
>
>
>
> File file = *new* File(rulesFiles);
>
>             String brl = *null*;
>
>             *try*{
>
>                   BRXMLPersistence read = (BRXMLPersistence)
> BRXMLPersistence.*getInstance*();
>
>                   BRDRLPersistence write = (BRDRLPersistence)
> BRDRLPersistence.*getInstance*();
>
>                   brl = FileUtils.*readFileToString*(file);
>
>                 System.*out*.println("File content: " + brl);
>
>                 String outputDRL = write.marshal(read.unmarshal(brl));
>
>                 String drlFilePath = "drlFile.drl";
>
>                 File drlFile = *new* File(drlFilePath);
>
>                 FileUtils.*writeStringToFile*(drlFile, outputDRL);
>
>                 addRulesToThisPackage.addPackageFromDrl(*new*
>
>                          InputStreamReader(RuleRunner.*class*
> .getResourceAsStream(drlFilePath)));
>
>             }*catch* (IOException e) {
>
>
>
>                   e.printStackTrace();
>
>              }
>
>
>
> I have added the org.apache.commons .jar files to the classpath.
>
> It contains a FileUtils.java  file which I added to the classpath.
>
>
>
> Now the error I get when I run the program is :
>
> Exception in thread "main" java.lang.Error: Unresolved compilation problem:
>
>
>       FileUtils cannot be resolved
>
>
>
>       at com.org.RuleRunner.loadRuleFile(*RuleRunner.java:70*)//
>
>       at com.org.RuleRunner.loadRules(*RuleRunner.java:45*)
>
>       at com.org.RuleRunner.runStatelessRules(*RuleRunner.java:102*)
>
>       at com.org.RulesTest.main(*RulesTest.java:40*)
>
>
>
>
>
>
>
> I don?t understand why still I am getting the error.
>
> RuleRunner.java:70 is : brl = FileUtils.*readFileToString*(file);
>
> Is there any thing else I could use ?/ Could you give me a hint??
>
> Thank you
>
> M
>
> ------------------------------
>
> *Please consider the environment before printing this email.*
>
> *Visit our website at http://www.nyse.com
> *****************************************************************************
>
> Note: The information contained in this message and any attachment to it is
> privileged, confidential and protected from disclosure. If the reader of
> this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please notify the sender immediately by replying to
> the message, and please delete it from your system. Thank you. NYSE
> Euronext. *
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100614/9b0e6d9f/attachment.html

------------------------------

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


End of rules-users Digest, Vol 43, Issue 67
*******************************************
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com

****************************************************

Note:  The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure.  If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.  If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system.  Thank you.  NYSE Euronext.




------------------------------

Message: 2
Date: Mon, 14 Jun 2010 14:34:02 +0100
From: "Swindells, Thomas" <TSwindells at nds.com>
Subject: Re: [rules-users] Error with conversion from .brl to .drl
        file
To: Rules Users List <rules-users at lists.jboss.org>
Message-ID:
        <DAC86F5F3B84F14088F0DB16092558CA090212652C at UKMA1.UK.NDS.COM>
Content-Type: text/plain; charset="us-ascii"

Looks like your classpath is missing a jar that contains org.drools.brms.server.util.BRXMLPersistence
Your either missing a dependency that you need or you may have a mix of different versions causing problems.

What's in your classpath and how are you managing it?

Thomas

> -----Original Message-----
> From: rules-users-bounces at lists.jboss.org [mailto:rules-users-
> bounces at lists.jboss.org] On Behalf Of Fnu Mahalakshmi
> Sent: 14 June 2010 14:24
> To: 'rules-users at lists.jboss.org'
> Subject: Re: [rules-users] Error with conversion from .brl to .drl file
>
>
> Hi Giovanni,
>
> The classpath shows the commons jar added under UserEntries.
>
> I am getting another error when I try running the program now :
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/drools/brms/server/util/BRXMLPersistence
>       at com.org.RulesTest.main(RulesTest.java:40)
> Caused by: java.lang.ClassNotFoundException:
> org.drools.brms.server.util.BRXMLPersistence
>       at java.net.URLClassLoader$1.run(Unknown Source)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at java.net.URLClassLoader.findClass(Unknown Source)
>       at java.lang.ClassLoader.loadClass(Unknown Source)
>       at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>       at java.lang.ClassLoader.loadClass(Unknown Source)
>       at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>       ... 1 more
>
> This was not coming till now.
> The exception come at the line when the .brl file is to  be processed.
> I am not able to figure out. I tried googling the error. But no use!
>
> Please help!
> Thanks
> M
>
> ------------------------------
>
> Message: 2
> Date: Mon, 14 Jun 2010 10:09:50 +0200
> From: Giovanni Motta <mottagio at gmail.com>
> Subject: Re: [rules-users] Error with conversion from .brl to .drl
>       file
> To: Rules Users List <rules-users at lists.jboss.org>
> Message-ID:
>       <AANLkTim_pHwmnwB0GmYWqE05FHCL1NZkG0f7nP3bHgj0 at mail.gmail.com>
> Content-Type: text/plain; charset="windows-1252"
>
> Are you launching the application from within eclipse?
> Have you checked the classpath of the launch configuration? You can see it
> by right-clicking the .java file and then selecting "run as --> run
> configurations..."
> Does it show the commons jar?
>
>
> 2010/6/12 Fnu Mahalakshmi <FMahalakshmi at nyx.com>
>
> >  Hi,
> >
> > I just tried everything I could think of but still getting error.
> >
> > Using following code for converting from .brl file to .drl file:
> >
> >
> >
> > File file = *new* File(rulesFiles);
> >
> >             String brl = *null*;
> >
> >             *try*{
> >
> >                   BRXMLPersistence read = (BRXMLPersistence)
> > BRXMLPersistence.*getInstance*();
> >
> >                   BRDRLPersistence write = (BRDRLPersistence)
> > BRDRLPersistence.*getInstance*();
> >
> >                   brl = FileUtils.*readFileToString*(file);
> >
> >                 System.*out*.println("File content: " + brl);
> >
> >                 String outputDRL = write.marshal(read.unmarshal(brl));
> >
> >                 String drlFilePath = "drlFile.drl";
> >
> >                 File drlFile = *new* File(drlFilePath);
> >
> >                 FileUtils.*writeStringToFile*(drlFile, outputDRL);
> >
> >                 addRulesToThisPackage.addPackageFromDrl(*new*
> >
> >                          InputStreamReader(RuleRunner.*class*
> > .getResourceAsStream(drlFilePath)));
> >
> >             }*catch* (IOException e) {
> >
> >
> >
> >                   e.printStackTrace();
> >
> >              }
> >
> >
> >
> > I have added the org.apache.commons .jar files to the classpath.
> >
> > It contains a FileUtils.java  file which I added to the classpath.
> >
> >
> >
> > Now the error I get when I run the program is :
> >
> > Exception in thread "main" java.lang.Error: Unresolved compilation problem:
> >
> >
> >       FileUtils cannot be resolved
> >
> >
> >
> >       at com.org.RuleRunner.loadRuleFile(*RuleRunner.java:70*)//
> >
> >       at com.org.RuleRunner.loadRules(*RuleRunner.java:45*)
> >
> >       at com.org.RuleRunner.runStatelessRules(*RuleRunner.java:102*)
> >
> >       at com.org.RulesTest.main(*RulesTest.java:40*)
> >
> >
> >
> >
> >
> >
> >
> > I don?t understand why still I am getting the error.
> >
> > RuleRunner.java:70 is : brl = FileUtils.*readFileToString*(file);
> >
> > Is there any thing else I could use ?/ Could you give me a hint??
> >
> > Thank you
> >
> > M
> >
> > ------------------------------
> >
> > *Please consider the environment before printing this email.*
> >
> > *Visit our website at http://www.nyse.com
> >
> *****************************************************************************
> >
> > Note: The information contained in this message and any attachment to it is
> > privileged, confidential and protected from disclosure. If the reader of
> > this message is not the intended recipient, or an employee or agent
> > responsible for delivering this message to the intended recipient, you are
> > hereby notified that any dissemination, distribution or copying of this
> > communication is strictly prohibited. If you have received this
> > communication in error, please notify the sender immediately by replying to
> > the message, and please delete it from your system. Thank you. NYSE
> > Euronext. *
> >
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.jboss.org/pipermail/rules-
> users/attachments/20100614/9b0e6d9f/attachment.html
>
> ------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> End of rules-users Digest, Vol 43, Issue 67
> *******************************************
> Please consider the environment before printing this email.
>
> Visit our website at http://www.nyse.com
>
> ****************************************************
>
> Note:  The information contained in this message and any attachment to it is
> privileged, confidential and protected from disclosure.  If the reader of this
> message is not the intended recipient, or an employee or agent responsible for
> delivering this message to the intended recipient, you are hereby notified
> that any dissemination, distribution or copying of this communication is
> strictly prohibited.  If you have received this communication in error, please
> notify the sender immediately by replying to the message, and please delete it
> from your system.  Thank you.  NYSE Euronext.
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster at nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************



------------------------------

Message: 3
Date: Mon, 14 Jun 2010 10:01:13 -0400
From: Fnu Mahalakshmi <FMahalakshmi at nyx.com>
Subject: Re: [rules-users] rules-users Digest, Vol 43, Issue 68
To: "'rules-users at lists.jboss.org'" <rules-users at lists.jboss.org>
Message-ID:
        <994758E35590274E955FA75763C5AA5002D010F4 at MTEXMBXP01.ad.NYX.com>
Content-Type: text/plain; charset="us-ascii"

Hi Kicho,

I could not find addPackageFromBRL() in Package Builder.

Any other options???

Thanks
M
-----Original Message-----
From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of rules-users-request at lists.jboss.org
Sent: Monday, June 14, 2010 8:36 AM
To: rules-users at lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 68

Send rules-users mailing list submissions to
        rules-users at lists.jboss.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
        rules-users-request at lists.jboss.org

You can reach the person managing the list at
        rules-users-owner at lists.jboss.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."


Today's Topics:

   1. Re: running brl rules - error (kicho)
   2. Error using change-set (Raf)
   3. Re: Error using change-set (Esteban Aliverti)
   4. Re: Error using change-set (Raf)


----------------------------------------------------------------------

Message: 1
Date: Mon, 14 Jun 2010 04:10:02 -0700 (PDT)
From: kicho <golijat at gmail.com>
Subject: Re: [rules-users] running brl rules - error
To: rules-users at lists.jboss.org
Message-ID: <1276513802820-894097.post at n3.nabble.com>
Content-Type: text/plain; charset=us-ascii


Hi,

you should have a look at PackageBuilder javadoc. There is a method for
adding brl's:

public void addPackageFromBrl(Resource resource)
                       throws DroolsParserException,
                              IOException

    Throws:
        DroolsParserException
        IOException


--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/running-brl-rules-error-tp889521p894097.html
Sent from the Drools - User mailing list archive at Nabble.com.


------------------------------

Message: 2
Date: Mon, 14 Jun 2010 13:24:05 +0200
From: Raf <r.ventaglio at gmail.com>
Subject: [rules-users] Error using change-set
To: rules-users at lists.jboss.org
Message-ID:
        <AANLkTik-vro4abvyCYyt2Wtjud7utoEOQentIfvCl5_u at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi,
I am trying to use a change-set file to load my DSL and DSLR resources, but
I am not able to get it working.

My first attempt was based on the snippet I found here:
http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html/ch03.html#d0e933

<?xml version="1.0" encoding="UTF-8"?>
<change-set xmlns='http://drools.org/drools-5.0/change-set'
            xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
            xs:schemaLocation='http://drools.org/drools-5.0/change-set.xsd'
>
   <add>
      <resource source='file:classification.dsl' type='DSL' />
      <resource source='file:classification.drl' type='DSLR' />
   </add>
</change-set>

but I received the following error:
(null: 4, 78): SchemaLocation: schemaLocation value = '
http://drools.org/drools-5.0/change-set.xsd' must have even number of URI's.
(null: 4, 78): cvc-elt.1: Cannot find the declaration of element
'change-set'.

Then, I found the following old post in the mailing list:
http://drools-java-rules-engine.46999.n3.nabble.com/changset-xml-error-when-running-Knowledge-Agent-td182469.html
where it was suggested to
"Just replace *xs:schemaLocation='**http://drools.org/drools-5.0/change-set.
xsd* <http://drools.org/drools-5.0/change-set.xsd>*'* by *xs:schemaLocation
='http://drools.org/drools-5.0/change-set drools-change-set-5.0.xsd'*"

So I changed my file to:
<?xml version="1.0" encoding="UTF-8"?>
<change-set xmlns='http://drools.org/drools-5.0/change-set'
            xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
            xs:schemaLocation='http://drools.org/drools-5.0/change-setdrools-change-set-5.0.xsd'
>
   <add>
      <resource source='file:classification.dsl' type='DSL' />
      <resource source='file:classification.dslr' type='DSLR' />
   </add>
</change-set>

but now I receive the following errors:
(null: 4, 100): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>.
(null: 4, 100): cvc-elt.1: Cannot find the declaration of element
'change-set'.
(null: 5, 9): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>.
(null: 6, 63): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>.
(null: 7, 65): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>.

What am I missing?

Thanks.
Raf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100614/50f99fee/attachment-0001.html

------------------------------

Message: 3
Date: Mon, 14 Jun 2010 08:50:28 -0300
From: Esteban Aliverti <esteban.aliverti at gmail.com>
Subject: Re: [rules-users] Error using change-set
To: Rules Users List <rules-users at lists.jboss.org>
Message-ID:
        <AANLkTimdokqxuVyhcCem7PAsCxRc7mCUXsybMRpRaDT8 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi,
The "null: 4, 78): SchemaLocation: schemaLocation value = '
http://drools.org/drools-5.0/change-set.xsd' must have even number of URI's.
(null: 4, 78): cvc-elt.1: Cannot find the declaration of element
'change-set'."  error is harmless. The agent should work anyway.
Please take a look at https://jira.jboss.org/browse/JBRULES-2377. Maybe you
are experiencing that error. I need to take a look at this issue.

Best,

2010/6/14 Raf <r.ventaglio at gmail.com>

> Hi,
> I am trying to use a change-set file to load my DSL and DSLR resources, but
> I am not able to get it working.
>
> My first attempt was based on the snippet I found here:
> http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html/ch03.html#d0e933
>
> <?xml version="1.0" encoding="UTF-8"?>
> <change-set xmlns='http://drools.org/drools-5.0/change-set'
>             xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
>             xs:schemaLocation='http://drools.org/drools-5.0/change-set.xsd'
> >
>    <add>
>       <resource source='file:classification.dsl' type='DSL' />
>       <resource source='file:classification.drl' type='DSLR' />
>    </add>
> </change-set>
>
> but I received the following error:
> (null: 4, 78): SchemaLocation: schemaLocation value = '
> http://drools.org/drools-5.0/change-set.xsd' must have even number of
> URI's.
> (null: 4, 78): cvc-elt.1: Cannot find the declaration of element
> 'change-set'.
>
> Then, I found the following old post in the mailing list:
> http://drools-java-rules-engine.46999.n3.nabble.com/changset-xml-error-when-running-Knowledge-Agent-td182469.html
> where it was suggested to
> "Just replace *xs:schemaLocation='**http://drools.org/drools-5.0/change-
> set.xsd* <http://drools.org/drools-5.0/change-set.xsd>*'* by *xs:
> schemaLocation='http://drools.org/drools-5.0/change-set drools-change-set
> -5.0.xsd'*"
>
> So I changed my file to:
> <?xml version="1.0" encoding="UTF-8"?>
> <change-set xmlns='http://drools.org/drools-5.0/change-set'
>             xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
>             xs:schemaLocation='http://drools.org/drools-5.0/change-setdrools-change-set-5.0.xsd' >
>    <add>
>       <resource source='file:classification.dsl' type='DSL' />
>       <resource source='file:classification.dslr' type='DSLR' />
>    </add>
> </change-set>
>
> but now I receive the following errors:
> (null: 4, 100): schema_reference.4: Failed to read schema document
> 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
> document could not be read; 3) the root element of the document is not
> <xsd:schema>.
> (null: 4, 100): cvc-elt.1: Cannot find the declaration of element
> 'change-set'.
> (null: 5, 9): schema_reference.4: Failed to read schema document
> 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
> document could not be read; 3) the root element of the document is not
> <xsd:schema>.
> (null: 6, 63): schema_reference.4: Failed to read schema document
> 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
> document could not be read; 3) the root element of the document is not
> <xsd:schema>.
> (null: 7, 65): schema_reference.4: Failed to read schema document
> 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
> document could not be read; 3) the root element of the document is not
> <xsd:schema>.
>
> What am I missing?
>
> Thanks.
> Raf
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100614/21331258/attachment-0001.html

------------------------------

Message: 4
Date: Mon, 14 Jun 2010 14:35:38 +0200
From: Raf <r.ventaglio at gmail.com>
Subject: Re: [rules-users] Error using change-set
To: Rules Users List <rules-users at lists.jboss.org>
Message-ID:
        <AANLkTinMrQwFO8J9djCUyDQ7B_-YhyHEAPAFUuDT6z6v at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi Esteban, thanks for your answer.
I thought that the error was due to change-set declaration so I didn't
investigate further before.

After reading your answer, I made some other experiments and I have found
that the problem is the use of a "relative path".
If I modify the change-set declaration using the absolute path of the two
resources, it works.

So the question is: may I use a relative path declaration in my change-set
file? How?
My change-set.xml file and the two resources are all in the same directory.

Thanks.
Bye

Raf

2010/6/14 Esteban Aliverti <esteban.aliverti at gmail.com>

> Hi,
> The "null: 4, 78): SchemaLocation: schemaLocation value = '
> http://drools.org/drools-5.0/change-set.xsd' must have even number of
> URI's.
> (null: 4, 78): cvc-elt.1: Cannot find the declaration of element
> 'change-set'."  error is harmless. The agent should work anyway.
> Please take a look at https://jira.jboss.org/browse/JBRULES-2377. Maybe
> you are experiencing that error. I need to take a look at this issue.
>
> Best,
>
> 2010/6/14 Raf <r.ventaglio at gmail.com>
>
>>  Hi,
>> I am trying to use a change-set file to load my DSL and DSLR resources,
>> but I am not able to get it working.
>>
>> My first attempt was based on the snippet I found here:
>> http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html/ch03.html#d0e933
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <change-set xmlns='http://drools.org/drools-5.0/change-set'
>>             xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
>>             xs:schemaLocation='
>> http://drools.org/drools-5.0/change-set.xsd' >
>>    <add>
>>       <resource source='file:classification.dsl' type='DSL' />
>>       <resource source='file:classification.drl' type='DSLR' />
>>    </add>
>> </change-set>
>>
>> but I received the following error:
>> (null: 4, 78): SchemaLocation: schemaLocation value = '
>> http://drools.org/drools-5.0/change-set.xsd' must have even number of
>> URI's.
>> (null: 4, 78): cvc-elt.1: Cannot find the declaration of element
>> 'change-set'.
>>
>> Then, I found the following old post in the mailing list:
>> http://drools-java-rules-engine.46999.n3.nabble.com/changset-xml-error-when-running-Knowledge-Agent-td182469.html
>> where it was suggested to
>> "Just replace *xs:schemaLocation='**http://drools.org/drools-5.0/change-
>> set.xsd* <http://drools.org/drools-5.0/change-set.xsd>*'* by *xs:
>> schemaLocation='http://drools.org/drools-5.0/change-set drools-change-set
>> -5.0.xsd'*"
>>
>> So I changed my file to:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <change-set xmlns='http://drools.org/drools-5.0/change-set'
>>             xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
>>             xs:schemaLocation='http://drools.org/drools-5.0/change-setdrools-change-set-5.0.xsd' >
>>    <add>
>>       <resource source='file:classification.dsl' type='DSL' />
>>       <resource source='file:classification.dslr' type='DSLR' />
>>    </add>
>> </change-set>
>>
>> but now I receive the following errors:
>> (null: 4, 100): schema_reference.4: Failed to read schema document
>> 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
>> document could not be read; 3) the root element of the document is not
>> <xsd:schema>.
>> (null: 4, 100): cvc-elt.1: Cannot find the declaration of element
>> 'change-set'.
>> (null: 5, 9): schema_reference.4: Failed to read schema document
>> 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
>> document could not be read; 3) the root element of the document is not
>> <xsd:schema>.
>> (null: 6, 63): schema_reference.4: Failed to read schema document
>> 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
>> document could not be read; 3) the root element of the document is not
>> <xsd:schema>.
>> (null: 7, 65): schema_reference.4: Failed to read schema document
>> 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
>> document could not be read; 3) the root element of the document is not
>> <xsd:schema>.
>>
>> What am I missing?
>>
>> Thanks.
>> Raf
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
>
> --
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>
> Esteban Aliverti
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100614/216d6810/attachment.html

------------------------------

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


End of rules-users Digest, Vol 43, Issue 68
*******************************************
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com

****************************************************

Note:  The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure.  If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.  If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system.  Thank you.  NYSE Euronext.




------------------------------

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


End of rules-users Digest, Vol 43, Issue 69
*******************************************
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com

****************************************************

Note:  The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure.  If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.  If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system.  Thank you.  NYSE Euronext.





More information about the rules-users mailing list