Return-Path: Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 40349 invoked by uid 500); 1 Jul 2003 06:24:21 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 40337 invoked from network); 1 Jul 2003 06:24:21 -0000 Message-ID: <095f01c33f99$768268b0$02c8a8c0@lankabook2> From: "Sanjiva Weerawarana" To: References: <1056971180.12057.69.camel@HarryWS1.ksg.co.at> Subject: Re: Axis / JNI once more Date: Tue, 1 Jul 2003 12:24:16 +0600 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Try changing the catch around jd.getDate() to catch (Throwable) .. maybe its throwing something you're not catching. Sanjiva. ----- Original Message ----- From: "Harald Pollak" To: Sent: Monday, June 30, 2003 5:06 PM Subject: Axis / JNI once more > Hy everybody! > > I try to use JNI within a Axis-Service. I try since weeks to bring it to > work, but my result is every time the same: > > > > > soapenv:Server.userException > > java.lang.reflect.InvocationTargetException > > > > > > my enviroment: > Linux: SuSE 8.2 > Tomcat 5 ( 5.0.3 Alpha ) ( allso tried with Tomcat 4.1.24 ) > Axis 1.1 ( final ) ( allso tried with 1.1rc2 ) > Client: Mozzila 1.4 > > Invocation: > I call the function getDate with 2 Parameters via: > > http://localhost:8080/axis/services/services?method=getDate&in0=10.146.3.42& in1=1800 > > The Code: > ----------- > > The Implementation: > > public class ServicesSoapBindingImpl implements SMS.JNIWS{ > > public java.lang.String getDate(java.lang.String in0, int in1) > throws java.rmi.RemoteException { > String s = new String(); > System.err.println(LibPath); > > try { > System.err.println("init Class"); > > JNIDate jd = new JNIDate(); > System.err.println("call methode: "); > s = jd.getDate(in0, in1); > System.err.println("finnished: " + s); > } catch (Exception ex) { > System.err.println(ex.getStackTrace().toString()); > ex.printStackTrace(); > } > > return s; > } > > public java.lang.String getVersion() throws java.rmi.RemoteException > { > return "1.0"; > } > > public java.lang.String getEnv() throws java.rmi.RemoteException { > // return System.getProperty("java.library.path"); > return AxisProperties.getProperty("java.library.path"); > } > > } > > the Class-JNIDate: > > class JNIDate { > > static { System.loadLibrary("JNIDate"); } > > public native String getJNIDate(String Server, int Port ); > > public String getDate(String Server, int Port) { > String s; > try { > System.err.println("call"); > s= getJNIDate(Server,Port); > System.err.println(s); > return s; > } catch (Exception e) { > System.err.println("Exeption!!!!"); > e.printStackTrace(); > return (String)(e.getMessage() + "\n : > "+e.getCause().toString()); > } > } > } > > > the output on Tomcat-console: > init class > call methode > call > > there is no exception in logs or on console > > > when i call the getEnv - Methode: > The path with my library-dir is shown. > > What i allso tried: > To outcommend the Nativecall and return a simpel string from > JNIDate.getJNIDate -> works fine. > > To write a servlet using the JNIDate.class and call it. -> works > fine! > > So my questions: > > 1.) has anybody allready written a Axis-Service using his own JNI-Class? > 2.) has anybody seen a misstake in the upper code ( maybe i'm > "codeblinde" - and it's a simple error, so I read over it many times )? > 3.) Has anyone a sample - I can try in my enviroment? > > Thanks > Harry >