Something new about jsmile in Netbeans?

The engine.
Post Reply
albertof
Posts: 2
Joined: Wed Sep 01, 2010 7:36 pm

Something new about jsmile in Netbeans?

Post by albertof »

Hello everybody!
My name is alberto and I'm newbie using jsmile. I'm used to work with Netbeans IDE but I'm not sure if I can use jsmile with it. I started programming and when I called to the readFile(String src) method, it says the following message:

"Exception in thread "AWT-EventQueue-0" smile.SMILEException: SMILE error -103 in function ReadFile. Logged information: Error at 0, 0 while loading D:/Dir/QuienEsQuien2.xdsl: Can't open file D:/Dir/QuienEsQuien2.xdsl"

Part of the program is the following:

// Show up menu to get the file .xdsl
JFileChooser jf = new JFileChooser();
jf.setFileSelectionMode(JFileChooser.FILES_ONLY);
jf.showOpenDialog(jPanel11);
File dir = jf.getSelectedFile();

//Create the net with the previous xdsl file
this.net = new Network();
net.readFile(dir.getPath());


Is the problem in the java code? .... or because of using Netbeans? Thanks you
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Something new about jsmile in Netbeans?

Post by shooltz[BayesFusion] »

albertof wrote:when I called to the readFile(String src) method, it says the following message:

"Exception in thread "AWT-EventQueue-0" smile.SMILEException: SMILE error -103 in function ReadFile. Logged information: Error at 0, 0 while loading D:/Dir/QuienEsQuien2.xdsl: Can't open file D:/Dir/QuienEsQuien2.xdsl"
The message from the SMILEException is self-explanatory - check if D:/Dir/QuienEsQuien2.xdsl actually exists and your program has the privileges required to access it.
albertof
Posts: 2
Joined: Wed Sep 01, 2010 7:36 pm

Re: Something new about jsmile in Netbeans?

Post by albertof »

shooltz thanks for your answer, but the address is the right one.

and what about jsmile in Netbeans? Does anyone try to work with jsmile in Netbeans?

Thanks in advance
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Something new about jsmile in Netbeans?

Post by shooltz[BayesFusion] »

and what about jsmile in Netbeans? Does anyone try to work with jsmile in Netbeans?
I don't know if jSmile was used with Netbeans, but don't see any reasons it should fail either. jSmile is a thin Java wrapper which calls into native code using plain JNI. The exception you're getting is caused by an error return from fopen() call in core C++ SMILE library, so evidently your program can call into native code and classpath is set correctly.

Common reasons for fopen failures are:
- file not found (but you seem to be sure it's there, actually)
- application not having access rights to the file (maybe you're running in a sandbox with limited privileges)
- file being exclusively open by another program (can you open it in notepad, vi or any text editor?)

The actual contents of your .xdsl are not read yet when this exception is thrown, so it's certainly not a parser error.
Post Reply