Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: engOpen() always returns 0
Date: Fri, 7 Nov 2008 16:10:18 +0000 (UTC)
Organization: Boeing
Lines: 40
Message-ID: <gf1p9a$puk$1@fred.mathworks.com>
References: <gf15od$8ij$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1226074218 26580 172.30.248.38 (7 Nov 2008 16:10:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 7 Nov 2008 16:10:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 756104
Xref: news.mathworks.com comp.soft-sys.matlab:499531


"Thomas Van Parys" <thpar@plantsystemsbiology-abbreviatethis-.ugent.be> wrote in message <gf15od$8ij$1@fred.mathworks.com>...
> My aim is to call Matlab from a java plugin I'm writing.
> I was already able to do this some time ago, but since a recent re-install, the very same application just stopped working.
> 
> The java application always returns 'Can't open engine' as the native function engOpen(char*) returns 0.
> 
> I now tried several approaches:
> - calling engOpen("\0") from a simple enginedemo.c program
> - calling engOpen(null) from java, using JNA mapped to libeng.so
> - calling engine.engOpen() from java, using JMatLink (which uses JNI).
> 
> Every time getting an engine pointer = 0
> I didn't get any errors compiling enginetest.c or compiling libJMatLink.so.
> 
> compiling C example:
> gcc $(MIN) $(MLIB) -leng -lmx enginetest.c -o enginetest.out
> 
> LD_LIBRARY_PATH points to $(MATLAB)/bin/glnx86
> So I'm not getting any linking errors, not when compiling, not when running... but engOpen() just fails to open a matlab engine. It simply returns 0, apparently without any further errors.
> 
> What could I be missing here?
> Matlab itself works fine when I enter 'matlab' on the command line.
> 
> My system:
> Fedora 9
> gcc 4.3.0
> Sun Java 1.6.0_10
> Matlab 7.6.0 (R2008a)
> 
> Thanks for every hint about what could be going wrong here... I've already lost several days on this problem.
.
If you are on Windows, try opening a Command Window (Start, All Programs, Accessories, Command Window), and then enter the following:
.
matlab /regserver
.
Then try your engine app again.
.
James Tursa
.