From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15697 invoked by alias); 2 Jun 2016 14:12:38 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 14866 invoked by uid 89); 2 Jun 2016 14:12:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.2 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=disponible, H*Ad:U*kawa, UD:work, D*eu X-HELO: smtps-n.oca.eu Received: from smtps-n.oca.eu (HELO smtps-n.oca.eu) (192.54.174.167) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 02 Jun 2016 14:12:27 +0000 Received: from [192.168.109.88] (natoca100-13.unice.fr [134.59.100.13]) by smtps-n.oca.eu (Postfix) with ESMTPSA id 8B2E380256 for ; Thu, 2 Jun 2016 16:12:24 +0200 (CEST) From: Damien MATTEI To: Kawa mailing list Subject: calling external classes method from kawa Date: Thu, 02 Jun 2016 14:12:00 -0000 User-Agent: KMail/1.9.6 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201606021612.24180.Damien.Mattei@unice.fr> X-IsSubscribed: yes X-SW-Source: 2016-q2/txt/msg00021.txt.bz2 Hi, all is in the title, i want to call external classes method from kawa,=20 i have a kawa class from which i want to call a method of a java class comp= iled not in kawa but javac, i tried many way but the class and method is un= know at runtime and i got wrning at compilation: the kawa class is ResultatGeneralFKawa.scm with this inside: (module-name "eu.oca.kawafunct.ResultatGeneralFKawa") (require 'regex) (define-simple-class ResultatGeneralFKawa () [code cut] ((work) ::int=20 (eu.oca.DataBase:helloStatic) 0) the java DataBase class has some method such as: public class DataBase { [code cut] public static void helloStatic() { System.out.println("Sidonie : DataBase : helloStatic : Hello !"); } when compiling i have of course wrnings: java -jar /usr/local/share/java/kawa-2.1.jar -C ResultatGeneralFKawa.scm (compiling ResultatGeneralFKawa.scm to eu.oca.kawafunct.ResultatGeneralFKaw= a) ResultatGeneralFKawa.scm:178:5: warning - no known slot 'helloStatic' in ja= va.lang.Object ResultatGeneralFKawa.scm:178:5: warning - no declaration seen for eu.oca.Da= taBase the problem is that the documention say i can use -J option to pass java ar= guments such as defining classpath but it does not works: kawa -J Unrecognized option: -J Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. i tried to copy DataBase.class definition in same place as ResultatGeneralF= Kawa.scm or in eu/oca where is the module (originally the module is in NetB= eansProjects/Sidonie/build/web/WEB-INF/classes/eu/oca/DataBase.class but nothing worked.... just want to call method of an external classes in kawa? is it possible? already read the doc: http://www.gnu.org/software/kawa/Method-operations.ht= ml find no suitable solution... errors is now at runtime: Etat HTTP 500 - ResultatGeneralFKawa.scm:178:5: unbound location: eu.oca.Da= taBase type Rapport d''exception message ResultatGeneralFKawa.scm:178:5: unbound location: eu.oca.DataBase description Le serveur a rencontr=E9 une erreur interne qui l''a emp=EAch= =E9 de satisfaire la requ=EAte. exception javax.servlet.ServletException: ResultatGeneralFKawa.scm:178:5: unbound loc= ation: eu.oca.DataBase org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:392) org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.jav= a:382) org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.jav= a:345) org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.jav= a:220) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) cause m=E8re ResultatGeneralFKawa.scm:178:5: unbound location: eu.oca.DataBase gnu.mapping.SharedLocation.get(SharedLocation.java:22) gnu.mapping.DynamicLocation.get(DynamicLocation.java:28) eu.oca.kawafunct.ResultatGeneralFKawa.work(ResultatGeneralFKawa.scm:178) eu.oca.kawafunct.ResultatGeneralFKawa.(ResultatGeneralFKawa.scm:120) eu.oca.ResultatGeneralF.postHandler(ResultatGeneralF.java:107) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:= 62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm= pl.java:43) java.lang.reflect.Method.invoke(Method.java:497) org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandler= Factory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispa= tcher$1.run(AbstractJavaResourceMethodDispatcher.java:151) org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispa= tcher.invoke(AbstractJavaResourceMethodDispatcher.java:171) org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherPro= vider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:1= 95) org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispa= tcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104) org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMet= hodInvoker.java:402) org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMeth= odInvoker.java:349) org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMeth= odInvoker.java:106) org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:259) org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) org.glassfish.jersey.internal.Errors.process(Errors.java:315) org.glassfish.jersey.internal.Errors.process(Errors.java:297) org.glassfish.jersey.internal.Errors.process(Errors.java:267) org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope= .java:318) org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:236) org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.j= ava:1010) org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:373) org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.jav= a:382) org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.jav= a:345) org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.jav= a:220) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) note La trace compl=E8te de la cause m=E8re de cette erreur est disponible = dans les fichiers journaux de Apache Tomcat/8.0.27. Apache Tomcat/8.0.27 Regards, Damien --=20 Damien.Mattei@unice.fr, Damien.Mattei@oca.eu, UNS / OCA / CNRS