how to import long from java into polyglot => java.lang.Long cannot be cast to com.oracle.truffle.api.interop.TruffleObject [was Re: Graal embed documentation not in place]

Jerven Tjalling Bolleman jerven.bolleman at sib.swiss
Tue Aug 8 13:48:23 UTC 2017


I am using 0.26 from OTN and Daniele writes it is a known bug fixed in 
0.27 (for next public release)



On 08/08/2017 02:34 PM, Jaroslav Tulach wrote:
> On úterý 8. srpna 2017 11:54:17 CEST Jerven Tjalling Bolleman wrote:
>> Hi All,
>>
>> Next question, How can I import a java.lang.Long into the js space
>> inside the context. I am now working around it by passing it in as a
>> parameter e.g.
>>
>> Value function = context.eval("js", "function(x,out){out.print(x)}");
>> function.execute(out, 1000_000_000_000L);
>>
>> Works
>>
>> However,
>>
>> context.exportSymbol("x",1000_000_000_000L);
>> context.exportSymbol("out", response.getOutoutStream());
>> Value function = context.eval("js",
>> "x=Interop.import('x');out=Interop.import('out);out.print(x)");
>>
>> Does not with the following exception.
>>
>> java.lang.Long cannot be cast to
>> com.oracle.truffle.api.interop.TruffleObject
> 
> What's the stacktrace?
> -jt
> 
> PS: What version are you using?
> 

-- 
-------------------------------------------------------------------
Jerven Bolleman                        Jerven.Bolleman at sib.swiss
SIB Swiss Institute of Bioinformatics  Tel: +41 (0)22 379 58 85
CMU, rue Michel Servet 1               Fax: +41 (0)22 379 58 58
1211 Geneve 4,
Switzerland     www.sib.swiss - www.uniprot.org
Follow us at https://twitter.com/#!/uniprot
-------------------------------------------------------------------


More information about the graal-dev mailing list