GithubHelp home page GithubHelp logo

jav8's People

Contributors

flier avatar

jav8's Issues

invokeMethod failed, fixed myself

see code below:

engine.eval("var obj = {name : 'tom'}");
engine.eval("obj.test = function() { out.println(this.name)}");
engine.eval("obj.test()");
((Invocable)engine).invokeMethod(engine.eval("obj"), "test");


i have resolve this problem as below:

src/lu/flier/script/V8Function.java : LN 24 append new function 

public Object invoke(long thizObj, Object... args) {
    Object result = internalInvoke(this.obj, thizObj, args);
    return result == null ? null : this.ctxt.bind(result);
}

/src/lu/flier/script/V8ScriptEngine.java : LN 171 replace with :

    V8Function fun = ((V8Function) ((V8Object) thiz).get(name));
    return fun.invoke(((V8Object)thiz).obj, args);

now it's work fine, i am not sure this is the best way, hope your official new 
version.



Original issue reported on code.google.com by [email protected] on 17 Oct 2013 at 10:20

This not set on invokeMethod OSX (not working also with invokeInterface)

test case :

ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("jav8");
Invocable invocable = (Invocable) engine;

engine.eval(
          "function Person(me) { this.me = me };"+
          "Person.prototype.say =  function (you) {" +
          "  return this.me + ' say, hello ' + you; "+
          "}; "+
          "var me = new Person('Flier'); "
    );


V8Context ctxt = ((V8ScriptEngine) engine).getV8Context();

V8Object me = (V8Object) ctxt.getGlobal().get("me");
String result = ( (String) invocable.invokeMethod(me, "say", "francois")); 
///[object Object] say, hello francois

Original issue reported on code.google.com by [email protected] on 22 Jul 2013 at 8:29

__thread is not supported by Android

TLS is not supported by NDK. The following code in Utils.h freezes application:
static __thread caches_t *s_caches;

I removed __thread and it started working, but I can not assess the impact of 
this hack.

Original issue reported on code.google.com by novikov on 20 Mar 2012 at 3:10

ReferenceTable overflow

Hi i'am trying to use jav8 on android. After a few issues i was able to get it 
running on android.

Now I have one major issue. If I expose some java code to javascript, after 
many call to a java method from JavaScript (max is arround 500 calls) my app 
crash with a "ReferenceTable overflow"

I found that some ref wasn't deleted in Wrapper.cpp CJavaFunction::Caller (for 
exemple params var, and arguments passed to SetObjectArrayElement). After 
fixing it, I was able to make more call to java method, but I still get a 
ReferenceTable overflow.

I think there still a "leak" in Utils.cpp Cache::GetMember() when calling 
GetObjectClass()

members_t::iterator iter = CacheMembers(env->GetObjectClass(obj));

If i replace this with  : 

jclass foo = env->GetObjectClass(obj);
members_t::iterator iter = CacheMembers(foo);
env->DeleteLocalRef(foo);

I no longer have a ReferenceTable overflow but my code crash randomly. Any idea 
on how to fix this? 

The easiest way to reproduce this bug is :

1) Create a java class with a method and expose it to javascript
2) In your JavaScript code : 
for (var i = 0; i < 1024; i++) {
    //Call java method here
}
3) Wait for crash 

I'am using jav8-03. 

Thanks.

Original issue reported on code.google.com by [email protected] on 30 Nov 2011 at 7:03

Compilation errors in unit test

What steps will reproduce the problem?
1. Download jar jav8-jsr223-win-x86-0.3.jar  
2. Download unit test from 
http://code.google.com/p/jav8/source/browse/trunk/test/lu/flier/script/V8ScriptE
ngineTest.java revision 66
3. Create a java project and add unit jar to class path.
4. Create unit tests 

What is the expected output? What do you see instead?
The unit test should compile but getting several errors. FOr example: Undefined 
functions: eng.createFunction & voidFunc.invokeVoid(); & arr.setElements

What version of the product are you using? On what operating system?
Win xp


Original issue reported on code.google.com by [email protected] on 9 Dec 2012 at 6:44

Add support for the latest stable v8 engine

What steps will reproduce the problem?
1. Run "new V8ScriptEngineFactory().getEngineVersion()"

What is the expected output? What do you see instead?
I expect 3.19.18 (according to 
https://code.google.com/p/v8/source/browse/trunk/src/version.cc#35). Instead I 
see 1.8.5.


What version of the product are you using? On what operating system?
This one: 
https://code.google.com/p/jav8/downloads/detail?name=jav8-jsr223-linux-amd64-0.6
.jar&can=2&q=

Original issue reported on code.google.com by [email protected] on 24 Jun 2013 at 4:54

Supporting Mac JKD6 jnilib system library file extension

What steps will reproduce the problem?
1. Build jav8 trunk version as documented.
2. Run any stand-alone test program that loads the "jav8" ScriptEngine on JDK6. 
Here is a test program:

import javax.script.ScriptEngine;
import javax.script.ScriptEngineFactory;
import javax.script.ScriptEngineManager;

public class Test {

    public static void main(String [] args) {

        ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
        for (ScriptEngineFactory scriptEngineFactory : scriptEngineManager.getEngineFactories()) {
            System.out.println(">>>>> "+scriptEngineFactory.getEngineName());
        }
        ScriptEngine scriptEngine = scriptEngineManager.getEngineByName("jav8");
        System.out.println(">>>>>>>>>>> engine: "+(scriptEngine != null));
    }
}

What is the expected output? What do you see instead?

One would expect the following output:

>>>>> AppleScriptEngine
>>>>> Google V8
>>>>> Mozilla Rhino
>>>>>>>>>>> engine: true

Instead, the following error is returned:

Exception in thread "main" java.lang.UnsatisfiedLinkError: missing JNI library 
- libjav8.jnilib
    at lu.flier.script.V8ScriptEngineFactory.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at sun.misc.Service$LazyIterator.next(Service.java:271)
    at javax.script.ScriptEngineManager.initEngines(ScriptEngineManager.java:109)
    at javax.script.ScriptEngineManager.access$000(ScriptEngineManager.java:37)
    at javax.script.ScriptEngineManager$1.run(ScriptEngineManager.java:80)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.script.ScriptEngineManager.init(ScriptEngineManager.java:78)
    at javax.script.ScriptEngineManager.<init>(ScriptEngineManager.java:51)
    at Test.main(Test.java:17)

The reason is that JDK6 on the mac returns this system library file extension: 
".jnilib". JDK7 on the mac returns: ".dylib". The current version of build.xml 
supports JDK7 by including libjav8.dylib in the jar artifact. JDK6 is not 
supported.

What version of the product are you using? On what operating system?

Trunk version, (69), of jav8.

JVM:
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)

System: Darwin 501158-mac.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 
00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64

Please provide any additional information below.

Attached is a patch to build.xml that copies libjav8.dylib to libjav8.jnilib on 
the mac. This supports JDK6.

Original issue reported on code.google.com by [email protected] on 13 Mar 2013 at 5:44

Attachments:

LINK : fatal error LNK1257: code generation failed; error C4716: 'Java_lu_flier_script_V8Array_internalToBooleanArray' : must return a value

What steps will reproduce the problem?

1. Build v8 for win32
1. Try to build the current source code, call "ant" on the jav8 folder
---> change build.xml to point to visual studio v8 output directory:
<property name="libv8.path" value="${env.V8_HOME}/build/Release/lib"/>


What is the expected output? What do you see instead?

Expected a Succesfull build.
But got an Link error, because of missing return values in the jav8.cpp.


What version of the product are you using? On what operating system?

Subversion Revision 68
Operationsystem Win7x64 but build for Win32.
JNI Header of jdk1.6.0_29_x32.


Please provide any additional information below.

This is the ant output:

Buildfile: c:\data\coding\Own\jav8\build.xml

prepare:

compile:

jni:
     [echo] Generating JNI header ...
     [echo] Building JNI library with release mode ...
       [cc] Starting dependency analysis for 3 files.
       [cc] 3 files are up to date.
       [cc] 0 files to be recompiled from dependency analysis.
       [cc] 0 total files to be compiled.
       [cc] Starting link
       [cc] LINK : warning LNK4224: /INCREMENTAL:YES is no longer supported;  ignored
       [cc] jav8.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
       [cc] LINK : warning LNK4224: /INCREMENTAL:YES is no longer supported;  ignored
       [cc] LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
       [cc]    Creating library jav8.lib and object jav8.exp
       [cc] Generating code
       [cc] c:\data\coding\own\jav8\jni\jav8.cpp(1041) : error C4716: 'Java_lu_flier_script_V8Array_internalToBooleanArray' : must return a value
       [cc] c:\data\coding\own\jav8\jni\jav8.cpp(1023) : error C4716: 'Java_lu_flier_script_V8Array_internalToFloatArray' : must return a value
       [cc] c:\data\coding\own\jav8\jni\jav8.cpp(1003) : error C4716: 'Java_lu_flier_script_V8Array_internalToDoubleArray' : must return a value
       [cc] c:\data\coding\own\jav8\jni\jav8.cpp(983) : error C4716: 'Java_lu_flier_script_V8Array_internalToShortArray' : must return a value
       [cc] c:\data\coding\own\jav8\jni\jav8.cpp(963) : error C4716: 'Java_lu_flier_script_V8Array_internalToLongArray' : must return a value
       [cc] c:\data\coding\own\jav8\jni\jav8.cpp(943) : error C4716: 'Java_lu_flier_script_V8Array_internalToIntArray' : must return a value
       [cc] c:\data\coding\own\jav8\jni\jav8.cpp(1059) : error C4716: 'Java_lu_flier_script_V8Array_internalToStringArray' : must return a value
       [cc] c:\data\coding\own\jav8\jni\jav8.cpp(1076) : error C4716: 'Java_lu_flier_script_V8Array_internalToDateArray' : must return a value
       [cc] c:\data\coding\own\jav8\jni\jav8.cpp(546) : error C4716: 'Java_lu_flier_script_V8Array_internalSet' : must return a value
       [cc] LINK : fatal error LNK1257: code generation failed

Original issue reported on code.google.com by [email protected] on 11 Feb 2013 at 10:27

V8 fatal error when runing in a multithreaded environment

Hi,

   I have a problem while using the jav8 lib in a multithreaded environment. I describe the problem below.

Best regards and thanks in advance for your help,
Marco Vaz

What steps will reproduce the problem?
1. create a pool of threads
2. create a script engine with the following instructions (from the main thread 
or a thread from the pool):
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName("jav8");
3. from a thread from the pool call engine.eval("javascript:file.js");

What is the expected output? What do you see instead?
I expect that the javascript file is correctly evaluated by V8 engine. It is 
produced a fatal error. I attach the error trace.

What version of the product are you using? On what operating system?
I tested with the version 0.3 that I downloaded from the "Downloads" section 
and with a version compiled by myself. I tested it in a linux machine (RHEL 
6.3).

Original issue reported on code.google.com by [email protected] on 13 Apr 2013 at 7:27

Attachments:

Exception in thread "main" java.lang.UnsupportedClassVersionError: lu/flier/script/V8ScriptEngineFactory : Unsupported major.minor version 51.0

Hi,

I've installed the jav8 as a maven dependency and tried the exemple.

I get the following error. I suppose that I do not have the gooed V8 version, 
but what is the supported version.

Best.

Exception in thread "main" java.lang.UnsupportedClassVersionError: 
lu/flier/script/V8ScriptEngineFactory : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at sun.misc.Service$LazyIterator.next(Service.java:271)
    at javax.script.ScriptEngineManager.initEngines(ScriptEngineManager.java:109)
    at javax.script.ScriptEngineManager.access$000(ScriptEngineManager.java:37)
    at javax.script.ScriptEngineManager$1.run(ScriptEngineManager.java:80)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.script.ScriptEngineManager.init(ScriptEngineManager.java:78)
    at javax.script.ScriptEngineManager.<init>(ScriptEngineManager.java:51)
    at jab8Test.Main.main(Main.java:9)

Original issue reported on code.google.com by [email protected] on 4 Aug 2013 at 10:07

Cannot pass an exposed java function to a new variable.

What steps will reproduce the problem?
Simplified Test case:

    ScriptEngine eng = new ScriptEngineManager().getEngineByName("jav8"); 
    MyObject myObj = new MyObject(); // Some object with a function, f(), to expose
    eng.put("myObj", myObj); // Expose myObj to javascript.
    eng.eval("myObj.f()"); // This line works as expected.
    eng.eval("var f = myObj.f;"); // This line runs silently.
    eng.eval("f()"); // This line errors.

What is the expected output? What do you see instead?

Expected the same result as if  eng.eval("myObj.f()");  was run.
Instead get the stack trace:

Exception in thread "main" javax.script.ScriptException: 
javax.script.ScriptException: java.lang.NullPointerException
    at lu.flier.script.V8ScriptEngine.eval(Unknown Source)
    at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
    at page.freddie.melonheads.Test.main(Test.java:14)
Caused by: javax.script.ScriptException: java.lang.NullPointerException
    at lu.flier.script.V8CompiledScript.eval(Unknown Source)
    ... 3 more
Caused by: java.lang.NullPointerException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at lu.flier.script.V8CompiledScript.internalExecute(Native Method)
    ... 4 more



What version of the product are you using? On what operating system?

Using jav8-0.3 on Ubuntu 12.04 64bit compiled from source for amd64.


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 22 Aug 2012 at 8:48

Not able to run jav8 on RHEL

What steps will reproduce the problem?
1. Built v8 as mentioned in the wiki. Ran "d8" to verify.
2. Tried to use the pre-packaged JAR (jav8-jsr223-linux-amd64-0.6.jar) but 
encountering "ELF file OS ABI invalid"
3. Tried to build Jav8 code as mentioned in the wiki. Getting a lot of errors, 
it might be possible that the code has not been updated with the latest V8. 

What is the expected output? What do you see instead?
Reported above.

What version of the product are you using? On what operating system?
jav8 on Linux RHEL 5.5
# uname -r
2.6.18-194.el5
# uname -i
x86_64

Please provide any additional information below.
Need urgent help. If there is a new source, please forward the same. I observed 
that others have been able to use the pre-packaged JAR as-it-is. any pointers 
will be helpful.

Original issue reported on code.google.com by [email protected] on 10 Oct 2013 at 11:27

JVM crashed when use jav8 in windows 2003 and some win 7

Unhandled exception
Type=Segmentation error vmState=0x00000000
J9Generic_Signal_Number=00000004 ExceptionCode=c0000005 
ExceptionAddress=5C5D922A ContextFlags=0001003f
Handler1=01C5A0C0 Handler2=0033C000 InaccessibleAddress=00000013
EDI=54F1A028 ESI=050CE021 EAX=00000001 EBX=54E467CD
ECX=54E73DB0 EDX=00000000
EIP=5C5D922A ESP=5FEDFC08 EBP=5FEDFC44 EFLAGS=00010202
GS=002B FS=0053 ES=002B DS=002B
Module=c:\yourlibpath\jav8.dll
Module_base_address=5C5B0000 Offset_in_DLL=0002922a
Target=2_40_20110203_074623 (Windows 7 6.1 build 7600)
CPU=x86 (4 logical CPUs) (0xf7d9d000 RAM)
----------- Stack Backtrace -----------
_JNI_OnUnload@8+0xd90a (0x5C5D922A [jav8+0x2922a])
_JNI_OnUnload@8+0x17c44 (0x5C5E3564 [jav8+0x33564])
_JNI_OnUnload@8+0x16f3f (0x5C5E285F [jav8+0x3285f])
_JNI_OnUnload@8+0x9d0e6 (0x5C668A06 [jav8+0xb8a06])
_JNI_OnUnload@8+0x12670 (0x5C5DDF90 [jav8+0x2df90])
_Java_lu_flier_script_V8Function_internalInvoke@28+0x16796 (0x5C5C9036 
[jav8+0x19036])
setTagSumCheck+0x10 (j9memtag.c:60, 0x00334100 [J9PRT24+0x4100])
wrapBlockAndSetTags+0x65 (j9memtag.c:90, 0x00334175 [J9PRT24+0x4175])
j9mem_allocate_memory+0x87 (j9memtag.c:165, 0x003342B7 [J9PRT24+0x42b7])
J9HookDispatch+0x8a (hookable.c:175, 0x001910BA [J9HOOKABLE24+0x10ba])
j9sig_protect+0x41 (j9signal.c:144, 0x0033C161 [J9PRT24+0xc161])
(0x001D8450)
(0x13C516A0)
(0x13C52020)

1. Create a sample web project
2. Use jav8 jar download from this site to process less files
3. Jvm crashed

Same jar works fine in Mac and some of linux OS
Please let use know what's the root cause of this issue.
Thanks,
Yong

Original issue reported on code.google.com by [email protected] on 20 Aug 2012 at 8:34

The "Hello, world!" example is not working.

I copy the example you have on the home page and set the library 
jav8-jsr223-linux-i386-0.3.jar. 
When I run the the program.

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

public class test
{
    public static void main(String[] arg)
    {
        ScriptEngineManager factory = new ScriptEngineManager();
        ScriptEngine engine = factory.getEngineByName("jav8");

        try {
            engine.eval("print('Hello, world!')");
        } catch (ScriptException ex) {
            ex.printStackTrace();
        }
    }
}

I got the next exception

Exception in thread "main" java.lang.ExceptionInInitializerError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at sun.misc.Service$LazyIterator.next(Service.java:271)
    at javax.script.ScriptEngineManager.initEngines(ScriptEngineManager.java:109)
    at javax.script.ScriptEngineManager.access$000(ScriptEngineManager.java:37)
    at javax.script.ScriptEngineManager$1.run(ScriptEngineManager.java:80)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.script.ScriptEngineManager.init(ScriptEngineManager.java:78)
    at javax.script.ScriptEngineManager.<init>(ScriptEngineManager.java:51)
    at test.main(test.java:9)
Caused by: java.lang.NullPointerException
    at lu.flier.script.V8ScriptEngineFactory.loadLibrary(Unknown Source)
    at lu.flier.script.V8ScriptEngineFactory.<clinit>(Unknown Source)
    ... 10 more

Do I missing something?
Thanks for your help.

Original issue reported on code.google.com by [email protected] on 5 Apr 2012 at 1:55

Memory access issue when loading jav8 from a second thread

Test case:

    @Test
    public void testThreads() throws java.lang.InterruptedException, ScriptException {
        new ScriptEngineManager().getEngineByName("jav8");
        System.gc();

        new Thread(new Runnable() {
            public void run() {
                new ScriptEngineManager().getEngineByName("jav8");
            }
        }).start();

        Thread.sleep(1000);
    }

Produces output:

    [junit] Invalid memory access of location 0x10 rip=0x10dd18cbe

I've traced it back to line 178 of jav8.cpp, the call to 

  jni::V8Env env(pEnv);

Inside of 

jlong JNICALL Java_lu_flier_script_V8Context_internalCreate(JNIEnv *pEnv, 
jobject pObj)

Thanks for your help!

Original issue reported on code.google.com by [email protected] on 23 Feb 2012 at 10:44

invalid ELF header

What steps will reproduce the problem?
1. Copied over the example code from the projects' page
2. Created a simple App, included the jar dependency
3. Built and executed the app with: java -cp 
"target/classes:target/classes/jav8-jsr223-Darwin-amd64-0.4.jar" 
com.mycompany.jav8test.App

What is the expected output? What do you see instead?
Here is the full error log:

ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: 
Provider lu.flier.script.V8ScriptEngineFactory could not be instantiated: 
java.lang.UnsatisfiedLinkError: /tmp/libjav83438421088985770011.so: 
/tmp/libjav83438421088985770011.so: invalid ELF header (Possible cause: 
endianness mismatch)
Exception in thread "main" java.lang.NullPointerException
    at com.mycompany.jav8test.App.main(App.java:18)

What version of the product are you using? On what operating system?
OS: Ubuntu 12.04, 64 bit
Java: "1.6.0_27"

Original issue reported on code.google.com by [email protected] on 7 Apr 2013 at 8:08

Can't build the project

A build of project has been failed with the following error:

  [junit] Testcase: testV8ScriptEngineFactory took 0.04 sec
    [junit]     Caused an ERROR
    [junit] /media/work/distrib/tmp/libjav830410477471826359.so: /media/work/distrib/tmp/libjav830410477471826359.so: undefined symbol: _ZN2v88internal7Isolate12isolate_key_E
    [junit] java.lang.UnsatisfiedLinkError: /media/work/distrib/tmp/libjav830410477471826359.so: /media/work/distrib/tmp/libjav830410477471826359.so: undefined symbol: _ZN2v88internal7Isolate12isolate_key_E
    [junit]     at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    [junit]     at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
    [junit]     at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
    [junit]     at java.lang.Runtime.load0(Runtime.java:770)
    [junit]     at java.lang.System.load(System.java:1003)
    [junit]     at lu.flier.script.V8ScriptEngineFactory.loadLibrary(Unknown Source)
    [junit]     at lu.flier.script.V8ScriptEngineFactory.<clinit>(Unknown Source)
    [junit]     at java.lang.Class.forName0(Native Method)
    [junit]     at java.lang.Class.forName(Class.java:247)
    [junit]     at sun.misc.Service$LazyIterator.next(Service.java:271)
    [junit]     at javax.script.ScriptEngineManager.initEngines(ScriptEngineManager.java:109)
    [junit]     at javax.script.ScriptEngineManager.access$000(ScriptEngineManager.java:37)
    [junit]     at javax.script.ScriptEngineManager$1.run(ScriptEngineManager.java:80)
    [junit]     at java.security.AccessController.doPrivileged(Native Method)
    [junit]     at javax.script.ScriptEngineManager.init(ScriptEngineManager.java:78)
    [junit]     at javax.script.ScriptEngineManager.<init>(ScriptEngineManager.java:51)
    [junit]     at lu.flier.script.V8ScriptEngineTest.createScriptEngine(Unknown Source)
    [junit]     at lu.flier.script.V8ScriptEngineTest.setUp(Unknown Source)

V8 build has been completed successfull with no errors.

Original issue reported on code.google.com by [email protected] on 17 May 2012 at 2:41

Error building from source LNK2001

I try to build jav8 pour windows x64.

I get jav8.dll : fatal error LNK1120: 94 unresolved externals

I'm not used to C, so I imagine this must come from a difference of version of 
v8 lib.

Which version of v8 have you used to successfully compile jav8 ?

Thanks

P.S. some more details from my error :
1>jav8.obj : error LNK2001: unresolved external symbol "public: bool __cdecl 
v8::TryCatch::HasCaught(void)const " (?HasCaught@TryCatch@v8@@QEBA_NXZ)
1>jav8.obj : error LNK2001: unresolved external symbol "public: __cdecl 
v8::TryCatch::~TryCatch(void)" (??1TryCatch@v8@@QEAA@XZ)
etc...


Original issue reported on code.google.com by [email protected] on 15 Jul 2012 at 8:52

Add Support for Apache JMeter

Apache JMeter does not run with jav8 currently.

There are several issues preventing jav8 working with JMeter
1. jav8 Bindings does not follow JSR 223 spec
2. jav8 does not have multi-threaded support

The use case is that we often want to use client side javascript code for load 
testing.  Since Rhino is slow, limited in script size (no more than 64k 
functions or 64k per function) and does not actually run any browser using v8 
would be ideal to solve these problems.

Installing jav8 to JMeter is simple.  Just copy the jar into the lib directory 
and create a JSR223 Element with a jav8 type.  Unfortunately things go downhill 
from there.


Bindings 
--------
The JSR223 Bindings passed by JMeter's JSR223TestElement.java are not passed to 
the V8 environment.  This is because v8 assumes that calls are like
...
Bindings g = this.eng.getBindings(ScriptContext.ENGINE_SCOPE);

        g.put("array", array2);
...

whereas JMeter JSR223TestElement.java sets up bindings with
...
        if (bindings == null) {
            bindings = scriptEngine.createBindings();
        }
        populateBindings(bindings);
...
    protected void populateBindings(Bindings bindings) {
...
        final Logger logger = LoggingManager.getLoggerForShortName(getClass().getName());
        bindings.put("log", logger);
...

then call the bindings with
...
                return compiledScript.eval(bindings);
...


A hack/patch is to update V8CompiledScript.java eval method to have
...
    @Override
    public Object eval(ScriptContext context) throws ScriptException
    {
        try {
            // Messy hack to import in from context
            for (Map.Entry<String,Object> entry : context.getBindings(ScriptContext.ENGINE_SCOPE).entrySet())
            {
                this.engine.put(entry.getKey(),entry.getValue());
            }

            return this.engine.getV8Context().bind(this.internalExecute(this.data, context));
        } catch (Exception e) {
            throw new ScriptException(e);
        }
    }
...

However there is probably a cleaner solution.


Multithreading  
--------------
The two cases that need to be supported are compiled scripts and eval'ed 
javascript.  JMeter blows up immediately using compiled scripts and runs with 
memory leaks and eventual blow ups when running eval'ed code.
* Need to use Locker

Unfortunately I'm not a C++ person so I haven't been able to get this to work.





Original issue reported on code.google.com by [email protected] on 20 Jun 2013 at 3:54

EXCEPTION_ACCESS_VIOLATION with pre-built JAR on Windows XP

What steps will reproduce the problem?
1. Create instance of JS engine using prebuilt JAR for windows XP
2.
3.

What is the expected output? What do you see instead?
Expected output is a simple script execution, instead I get an 
EXCEPTION_ACCESS_VIOLATION

What version of the product are you using? On what operating system?
0.3 on Win x86


Please provide any additional information below.
frame: C [jav8.dll+0x5ed8]

Original issue reported on code.google.com by [email protected] on 8 Dec 2011 at 3:21

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.