java.lang.IllegalArgumentException: URI is not absolute

24,866 views
Skip to first unread message

Filomena Elia

unread,
Apr 10, 2012, 11:36:34 AM4/10/12
to open...@googlegroups.com

I have this problem , in my project i have one package, called include, where there is a file Enviroment.csv and other file Excel.

In my project there are this lines of code :

String fileName = "Enviroment.csv";

Decision decision = new Decision("Decision",fileName);

decision.execute();



Caused by: java.lang.IllegalArgumentException: URI is not absolute

at java.net.URI.toURL(URI.java:1079)

at com.openrules.datasource.URLDataSourceFactoryHandler.fromURI(URLDataSourceFactoryHandler.java:34)

at com.openrules.datasource.DataSourceFactory.fromURI(DataSourceFactory.java:163)

at com.openrules.datasource.DataSourceFactory.fromString(DataSourceFactory.java:153)

at com.openrules.ruleengine.OpenRulesEngine.getDataSource(OpenRulesEngine.java:441)

at com.openrules.ruleengine.OpenRulesEngine.initialize(OpenRulesEngine.java:212)

at com.openrules.ruleengine.OpenRulesEngine.<init>(OpenRulesEngine.java:151)

at com.openrules.ruleengine.OpenRulesEngine.<init>(OpenRulesEngine.java:158)

at com.openrules.ruleengine.Decision.<init>(Decision.java:24)

OpenRules Support

unread,
Apr 10, 2012, 1:48:17 PM4/10/12
to open...@googlegroups.com
The fileName should follow the URL convention such as  such as "file:", "classpath:", "http://", "ftp://", "db:" - see  http://openrules.com/rulesrepository.htm. Typically we use something like

String fileName = "file:rules/DecisionPatientTherapy.xls";

You should follow this convention.

Filomena Elia

unread,
Apr 10, 2012, 4:15:34 PM4/10/12
to open...@googlegroups.com
It's the same, in this case, when i used the convention "file:include/Enviroment.csv" , i have this exceptions :

Caused by: java.io.FileNotFoundException: include/Enviroment.csv (No such file or directory)

at java.io.FileInputStream.open(Native Method)

at java.io.FileInputStream.<init>(FileInputStream.java:120)

at java.io.FileInputStream.<init>(FileInputStream.java:79)

at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)

at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)

at java.net.URL.openStream(URL.java:1010)

at com.openrules.datasource.URLDataSource.getInputStream(URLDataSource.java:54)

at com.openrules.datasource.DataSourceCodeModule.getByteStream(DataSourceCodeModule.java:33)

Filomena Elia

unread,
Apr 10, 2012, 4:16:37 PM4/10/12
to open...@googlegroups.com
It's the same, in this case, when i used the convention "file:include/Enviroment.csv" , i have this exceptions :

Caused by: java.io.FileNotFoundException: include/Enviroment.csv (No such file or directory)

at java.io.FileInputStream.open(Native Method)

at java.io.FileInputStream.<init>(FileInputStream.java:120)

at java.io.FileInputStream.<init>(FileInputStream.java:79)

at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)

at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)

at java.net.URL.openStream(URL.java:1010)

at com.openrules.datasource.URLDataSource.getInputStream(URLDataSource.java:54)

at com.openrules.datasource.DataSourceCodeModule.getByteStream(DataSourceCodeModule.java:33)


Filomena Elia

unread,
Apr 10, 2012, 4:31:35 PM4/10/12
to open...@googlegroups.com


I seem to have solved the FileNotFound exception, but now I have another problem:

Caused by: org.apache.commons.lang.exception.NestableRuntimeException: java.io.IOException: Invalid header signature; read 0x6E6F7269766E4522, expected 0xE11AB1A1E011CFD0

at org.openl.util.RuntimeExceptionWrapper.wrap(RuntimeExceptionWrapper.java:22)

at com.openrules.lang.xls.XlsLoader.preprocessWorkbook(XlsLoader.java:197)

at com.openrules.lang.xls.XlsLoader.parse(XlsLoader.java:241)

at com.openrules.lang.xls.XlsParser.parseAsModule(XlsParser.java:62)

at org.openl.OpenL.compileModule(OpenL.java:233)

at com.openrules.ruleengine.RuleEngine.<init>(RuleEngine.java:61)

at com.openrules.ruleengine.OpenRulesEngine.initialize(OpenRulesEngine.java:231)

at com.openrules.ruleengine.OpenRulesEngine.<init>(OpenRulesEngine.java:151)

at com.openrules.ruleengine.OpenRulesEngine.<init>(OpenRulesEngine.java:158)

at business.consultOpenRules.Consultazione.startConsultation(Consultazione.java:78)

at business.consultOpenRules.Consultazione.nextQuestion(Consultazione.java:133)

at business.consultOpenRules.ConsultFacade2.nextQuestion(ConsultFacade2.java:75)

at business.build.TabulaBD.nextQuestion(TabulaBD.java:616)

... 29 more

Caused by: java.io.IOException: Invalid header signature; read 0x6E6F7269766E4522, expected 0xE11AB1A1E011CFD0

at org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.java:107)


Case relates to the fact that the excel file does not have to a good form for openrules?

support

unread,
Apr 10, 2012, 4:36:51 PM4/10/12
to open...@googlegroups.com
Please send us your Excel files to analyze. We also need to know how these files are allocated in your folders. You may email them to sup...@openrules.com

support

unread,
Apr 11, 2012, 12:35:09 PM4/11/12
to open...@googlegroups.com
All your files have with extension "csv" use ";" as a separator. By default, even Excel does not open them correctly. Are the any reasons why you cannot use the standard ".xls" format?

Your latest file Rules.xls uses the keyword "Rules" instead of "DecisionTable". It has different meaning and expects Java two more rows with snippets. Please switch to  "DecisionTable" and it should work.
Reply all
Reply to author
Forward
0 new messages