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

Fnu Mahalakshmi FMahalakshmi at nyx.com
Mon Jun 14 09:23:33 EDT 2010


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.





More information about the rules-users mailing list