Hello, I'm using PB 12.1 build 6639 on Windows 7 Pro 64bit I used the sample from http://www.rgagnon.com/pbdetails/pb-0224.html to try this out. The problem is, that a call to createjavainstance() is not working well. The call to the JavaVM-Class version forces PB to crash immediately, the call to the EJBConnetion-Class (deprecated) returns -1. I copied the class files (Simple.class and SimpleHome.class) to the same directory where the my calling pbl resides. Could this have to do with the blank in my pbl-path (c:\eigene dateien\pb12\kmt) The Java VM is loaded without problems before and the Messagebox shows, that the original version of JDK 1.6.0_02 shipped with PB is used. The classes don't include a package name. I'm looking over days for solving this without success, hope someone can help me! Here's the code: //constant string CLASSPATH = ".;C:\Eigene Dateien\pb12\kmt\pb_java\out\production\pb_java" //constant string CLASSPATH = "C:\Eigene Dateien\pb12\kmt" string classpath = ".;C:\Eigene Dateien\pb12\kmt" //string classpath = "C:\Program Files (x86)\Java\jre1.8.0_66\bin\client" //string classpath = "" boolean lb_err long ll_rc string ls_msg, ls_cp, ls_version JavaVM ln_java_vm EJBConnection ln_ejb_conn Simple ln_simple do ln_java_vm = create JavaVM ll_rc = ln_java_vm.createjavavm( CLASSPATH, true) if ll_rc < 0 then Messagebox(gs_app_tit, "createjavavm: " + string(ll_rc)) lb_err = true exit end if ls_cp = ln_java_vm.getjavaclasspath() ls_version = ln_java_vm.getjavaVMversion() Messagebox(gs_app_tit, "java version: " + string(ls_version) + " class_path: " + ls_cp) // createjavainstance via JavaVM Class // ll_rc = ln_java_vm.Createjavainstance(ln_simple, "Simple") //-> PB crashes here // createjavainstance via EJBConnection Class (deprecated!) ln_ejb_conn = create EJBConnection ll_rc = ln_ejb_conn.createjavainstance(ln_simple, "simple") // return value is -1 (failed to create java class) Messagebox(gs_app_tit, "createjavainstance:" + string(ll_rc)) try Messagebox("", "before sayHello") ls_msg = ln_simple.sayHello() Messagebox("", "3") catch (CreateException ce) Messagebox(gs_app_tit, "Create Exception: " + ce.getMessage()) catch (Throwable t) Messagebox(gs_app_tit, "Other Exception: " + t.getMessage()) end try Messagebox("", ls_msg) loop while 1 = 0 destroy ln_java_vm return 1
↧