public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Damien MATTEI <Damien.Mattei@unice.fr>
To: Kawa mailing list <kawa@sourceware.org>
Subject: calling external classes method from kawa
Date: Thu, 02 Jun 2016 14:12:00 -0000	[thread overview]
Message-ID: <201606021612.24180.Damien.Mattei@unice.fr> (raw)

Hi,

all is in the title, i want to call external classes method from kawa, 
i have a kawa class from which i want to call a method of a java class compiled not in kawa but javac, i tried many way but the class and method is unknow 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 

   (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.ResultatGeneralFKawa)
ResultatGeneralFKawa.scm:178:5: warning - no known slot 'helloStatic' in java.lang.Object
ResultatGeneralFKawa.scm:178:5: warning - no declaration seen for eu.oca.DataBase

the problem is that the documention say i can use -J option to pass java arguments 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 ResultatGeneralFKawa.scm or in eu/oca where is the module (originally the module is in NetBeansProjects/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.html

find no suitable solution...

errors is now at runtime:

Etat HTTP 500 - ResultatGeneralFKawa.scm:178:5: unbound location: eu.oca.DataBase

type Rapport d''exception

message ResultatGeneralFKawa.scm:178:5: unbound location: eu.oca.DataBase

description Le serveur a rencontré une erreur interne qui l''a empêché de satisfaire la requête.

exception

javax.servlet.ServletException: ResultatGeneralFKawa.scm:178:5: unbound location: eu.oca.DataBase
	org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:392)
	org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:382)
	org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:345)
	org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:220)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

cause mère

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.<init>(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(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:497)
	org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
	org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:151)
	org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:171)
	org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:195)
	org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)
	org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:402)
	org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:349)
	org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.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.java:1010)
	org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:373)
	org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:382)
	org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:345)
	org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:220)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

note La trace complète de la cause mère de cette erreur est disponible dans les fichiers journaux de Apache Tomcat/8.0.27.
Apache Tomcat/8.0.27

Regards,

Damien

-- 
Damien.Mattei@unice.fr, Damien.Mattei@oca.eu, UNS / OCA / CNRS

             reply	other threads:[~2016-06-02 14:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-02 14:12 Damien MATTEI [this message]
2016-06-02 14:34 ` Per Bothner
2016-06-02 14:53   ` Damien MATTEI
2016-06-02 15:07   ` Damien MATTEI
2016-06-02 16:20     ` Per Bothner
2016-06-03  8:18       ` Damien MATTEI
2016-06-03  8:34         ` Damien MATTEI
2016-06-03 12:55         ` Per Bothner
2016-06-03 13:21           ` Damien MATTEI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201606021612.24180.Damien.Mattei@unice.fr \
    --to=damien.mattei@unice.fr \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).