Can't create JVM from JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);

I'm new in using JNI. When i compile the C program that invoke the JAVA program, everthing goes fine. I can obtain the the "exe" from the compilation.
But when i run the "exe" file it display "can't create Java VM". Here is the part of the code in C program:
........//other code
JNI_VERSION_1_2
JavaVMInitArgs vm_args;
JavaVMOption options[1];
options[0].optionString =
"-Djava.class.path=" USER_CLASSPATH;
vm_args.version = 0x00010002;
vm_args.options = options;
vm_args.nOptions = 1;
vm_args.ignoreUnrecognized = JNI_TRUE;
/* Create the Java VM */
res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
if (res < 0) {
fprintf(stderr, "Can't create Java VM\n");
exit(1);
.......//other code
I'm using JDK1.3, and windows ME.
Can anyone tell me the problem?

I think you need to get the address of the create function from the jvm.dll at runtime and call that: this works for me:
     HINSTANCE handle;
     JavaVMOption options[5];
     char JREHome[MAX_PATH];
     char JVMPath[MAX_PATH];                                        
     char classpathOption[MAX_PATH];
     char librarypathOption[MAX_PATH];
     if(!GetPublicJREHome(JREHome, MAX_PATH))
          LogError("Could not locate JRE");
          abort();
     strcpy(JVMPath,JREHome);
     strcat(JVMPath,"\\bin\\client\\jvm.dll");
    if ((handle=LoadLibrary(JVMPath))==0)
          LogError("Error loading: %s", JVMPath);
          abort();
    CreateJavaVM_t pfnCreateJavaVM=(CreateJavaVM_t)GetProcAddress(handle,"JNI_CreateJavaVM");
    if (pfnCreateJavaVM==0)
          LogError("Error: can't find JNI interfaces in: %s",JVMPath);
          abort();
     strcpy(classpathOption,"-Djava.class.path=");
     strcat(classpathOption,dir);
     strcat(classpathOption,";");
     strcat(classpathOption,JREHome);
     strcat(classpathOption,"\\lib");
     strcat(classpathOption,";");
     strcat(classpathOption,JREHome);
     strcat(classpathOption,"\\lib\\comm.jar");
     strcpy(librarypathOption,"-Djava.library.path=");
     strcat(librarypathOption,JREHome);
     strcat(librarypathOption,"\\lib");
     OutputDebugString("classpath option=");
     OutputDebugString(classpathOption);
     OutputDebugString("\n");
     OutputDebugString("librarypath option=");
     OutputDebugString(librarypathOption);
     OutputDebugString("\n");
     options[0].optionString=classpathOption;     
     options[1].optionString=librarypathOption;     
     options[2].optionString="vfprintf";
     options[2].extraInfo=_vfprintf_;
     options[3].optionString="exit";
     options[3].extraInfo=_exit_;
     options[4].optionString="abort";
     options[4].extraInfo=_abort_;
    vmArgs.version  = JNI_VERSION_1_2;
    vmArgs.nOptions = 5;
    vmArgs.options  = options;
    vmArgs.ignoreUnrecognized = false;
    if(pfnCreateJavaVM(&jvm,(void**)&env, &vmArgs)!=0)
          LogError("Could not create VM");
          abort();
     }

Similar Messages

  • Cannot link JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);

    Hi,
    I use win2000 und MS. Net Dev-Studio 7.1. I do not find the link info for
    JNIEnv *env;
    JavaVM *jvm;
    JDK1_1InitArgs vm_args;
    jint res;
    jclass cls;
    jmethodID mid;
    jstring jstr;
    jobjectArray args;
    char classpath[1024];
    // IMPORTANT: specify vm_args version # if you use JDK1.1.2 and beyond
    vm_args.version = 0x00010001;
              JNI_GetDefaultJavaVMInitArgs(&vm_args);
    There was once a javai.lib, but where? Aktuallay I link to the lib-Dir of my VM but it fails.

    Maybe you should link to jvm.lib in $jdk/lib folder ?

  • Can't create PDFs from Word due to Cambria font. Help.

    I'm using win 7 32 bit office 2010 acrobat pro 9. I can't create pdfs from word because of problems with cambria. I've ttried all the fixes I can find but none worked. Any more ideas?
    [thread title updated by moderator]

    How are you trying to create the PDF? With AA9 you have to print to the Adobe PDF printer or use the MS plugin.
    When you say you cannot create PDFs because of Cambria, what error messages are you getting and copy them here? At this point we really do not know what you are having problems with or how you are trying to create PDFs.
    In the future, please provide a topic to help folks that are stepping through all of the posts. A blank topic almost led me to simply skip your post.

  • Java.sql.SQLException: can't create statement from closed connection

    java.sql.SQLException: can't create statement from closed connection.
    at com.caucho.sql.QPooledConnectionImpl.prepareStatement(QPooledConnecti onImpl.java:411)
    I am getting this error with my JSP's, i am running on Resin on Win2k, and MySql as backend.
    Has anyone else also faced this issue ?
    Looking for someone to help me to solve this issue.
    rc

    Looking for someone to help me to solve this issue.Maybe you are closing the connections. You might want to verify that you are not doing that. Or if you are that that is the correct way to return the connection to the pool.
    Or you could have stale connections. Some databases will time out connections if the connection is no used in a while. (This is a good thing.) But this means connection pools must do something with connections that are not used for a while. The pools usually have a configuration option(s) which allows you to set up a keep alive message which keeps the database from closing the connection.

  • Can't create PDFs from Acrobat or Word?

    Downloaded the 8.1.4 update and now I can't create PDFs from Acrobat or Word.  If I try to create a PDF from the print menu, I get a message indicating that there are no print drivers for this...any ideas?

    Thanks for responding.  Yep, I tried repairing it...no dice.  Then I realized that I'd re-installed AA Pro 8 (having completely given up on the AA Pro 9 upgrade that crashed my system) but not the updates.  So I went through and re-installed each update.  Still no dice. Then I did another repair. Nope.  When I try to create a PDF via the print menu, I get a "Windows cannot print due to a problem with the current printer setup."  This tells me that I have driver problem. But everything else prints fine, and I'm pretty sure Acrobat doesn't have drivers.  I'm stumped...

  • DACF,BC4J: How can i create RowSetInfo from VO generated by createViewObjectFromQuery

    How can i create and publish RowSetInfo from VO generated by applicationModule.createViewObjectFromQuery()?
    And how can i set named AttributeInfo for
    that RowSetInfo?
    I can't use VO w/o Entity object generated by wisard becouse in generated code my query will be enclosed to SELECT * FROM (...), and rowsetInfo.setQueryCondition
    will add WHERE clause to enclosed select.
    (i need to access to inner WHERE clause)
    null

    I got next exception
    oracle.dacf.dataset.DataSourceOperationException: ResultSetInfo: ResultSet TestRS could not be opened because of problems opening one or more attributes.
    with next message box:
    JBO-25002: Definition SimpleJobber.TestVO of type View Definition not found
    Details:
    DAC-502: ResultSetInfo: ResultSet TestRS could not be opened because of problems opening one or more attributes.
    JBO-25002: Definition SimpleJobber.TestVO of type View Definition not found
    for next test code:
    private void test() {
    final String sql = "SELECT 1+1 X, 1+2 XX FROM dual";
    final ColumnInfo x = new ColumnInfo(java.sql.Types.INTEGER),
    xx = new ColumnInfo(java.sql.Types.INTEGER);
    //at this point session allready has been published
    final ViewObject vo = sessionInfo1.getApplicationModule().createViewObjectFromQueryStmt("TestVO",sql);
    final RowSetInfo rsi = new RowSetInfo();
    vo.remove();
    x.setName("X");
    xx.setName("XX");
    rsi.setAttributeInfo( new ColumnInfo[] {x,xx} );
    rsi.setQueryInfo(new QueryViewInfo("TestVO"));
    rsi.setName("TestRS");
    rsi.setSession(sessionInfo1);
    rsi.publishRowSet();
    null

  • Can't create PDF from Word file

    I may be missing some functionality or that functionality may not exist.
    I'm running Acrobat Pro 9.2 and MS Word 2004 (11.5) on OSX Leopard 10.5.8. I want to create a PDF from a Word file but NOT using the Print dialog. I want to either create it in Acrobat using File > Create PDF > From File or create it from within Word using the Acrobat menu/toolbar. This is so that it will end up as a tagged PDF.
    However, I don't have an Acrobat menu or toolbar in Word. I thought Acrobat was supposed to have installed these into MS Office when I installed Acrobat. And when within Acrobat if I select File > Create PDF > From File and choose a Word file, I get a message "Acrobat could not open 'filename.doc' because it is either not a supported file type or because the file has been damaged". This happens for all Word files.
    Looking in Acrobat > About Adobe Plug-Ins... under Convert2AdobePDF it says 'Loaded: no'.
    Are these two methods of converting Word files to PDFs something that can only be done in the Windows version of Acrobat? Or is there a plug-in or update I can download to install this missing functionality?
    Thanks for your help,
    Mark

    Keep your Office2004. But Office 2008 does have a way to create PDF's from within  the word and excel Programs.
    It works better than through the AdobePDF Printer, or through the Apple Print menus save as PDF. (Unless you have X.6.x Snow leopard)
    One thing it gets around is a long standing Problem Acrobat has had with word and excel since Word 6.0.1.a/Excel 5.0.1a. Acrobat doesn't know how to interpert Word Page section Breaks. Chopping up a word/excel document in to multiple PDFs that have to be merged back together. MS came up with their own PDF Converter that gets around that problem.

  • Can't Create PDF "from file" using any MS Office files

    Acrobat 8.1.1 Pro. (OS = XP), as part of the CS3 premium edition.
    I can no longer get Acrobat to recognize any of the MS Office applications extensions (.doc, .ppt, etc...) for use with either Create PDF "From File" or when using the Combine Files feature to Merge or Package. The extensions are no longer even listed as an option in the dialog box, or in the Preference settings under "Convert to PDF".
    FYI- I can still use the PDF Maker functionality from within the MS Office application to create a PDF.
    Any Idea what could have happened, or more importantly how to fix?
    ***Update***
    I have re-installed the Acrobat 8 application, and the problem still exists.
    I'm truly puzzled.

    I get this with my PC and I ran detect-repair and reinstalled. Some PDF's I can open and other's I cannot. I can send the email to a cohort and they can open fine.
    "Can't create file: Right-click the folder you want to create the file in and then click Properties on the shortcut menu to check your permissions for the folder"
    Any ideas would be great.
    Thanks!

  • Can't create VM from template on iSCSI

    Hello,
    I'm trying to create new VM from original Oracle template "OVM_EL5U3_X86_64_PVM_4GB" on iSCSI device without a success.
    Steps to reproduce:
    1) /OVS is mounted as iSCSI block device
    2) Original Oracle template is copied into /OVS/seed_pool/OVM_EL5U3_X86_64_PVM_4GB
    3) Oracle VM Manager - Import template (no problem)
    4) Oracle VM Manager - Create VM from template
    Result: Files are copied into running_pool, vm.cfg is updated, new VM is visible in VM Manager but with this message:
    failed: <Exception: Error updating the image.> StackTrace: File "/opt/ovs-agent-2.2/OVSSiteVM.py", line 471, in config_vm raise Exception("Error updating the image.")
    5) Oracle VM Manager - Start new VM
    Result:
    Status in VM is Running
    I can connect using VNC console
    But the VM is constantly rebooting with these messages on the console:
    Registering block device major 202
    xvda: xvda1 xvda2 xvda3
    xvda: p2 exceeds device capacity
    xvda: p3 exceeds device capacity
    Waiting for driver initialization.
    xvda: rw=0, want=101530648, limit-12707414
    attemp to access beyond end of device
    switchroot: mount failed: No such file or directory
    Kernel panic - not syncing: Attempted to kill init!
    Looks like there is a problem with partition sizes within the VM image file (xvda: p2 exceeds device capacity)
    I've tried to mount iSCSI formated with ocsf2 and ext3 - I'm getting the same error.
    However there is no problem when I mount /OVS as NFS or local drive and repeat the steps above.
    Any suggestion would be highly appreciated,
    Honza

    It's all sorted now.
    What I've learnt: OVS/Xen hypervisor doesn't seem to handle 4kB iSCSI block sizes.
    I had to change it to 512 bytes (configuration on the iSCSI storage - nothing on the Oracle VM side) and re-create all volumes.
    Just in case you experience something similar.
    Honza
    Edited by: Honza on Jul 21, 2009 3:00 PM

  • Can't creat PDF from .DWG file

    Using the world's most popular CAD program. Can't create a PDF from Adobe 3D. Apparently Adobe 3D wants to open the file using my AutoCAD, but thinks AutoCAD is not on my computer???

    Hi SWS,
    Didn't find it here, but found the answer by Googling and getting pointed to an AECBytes article from Feb '06, which had updated Revit 3D Capture settings (settings more updated than what Adobe gives you!).
    It's too bad the rotation tool is so unweildy and that the walkthru isn't right there with rotation, pan & zoom (crazy - no idea why that is). I need these to work in Reader for regular people, not computer/cad savvy types. Adobe 3D seems to have just great potential, but doesn't seem ready for prime-time yet on the PDF recipient end yet. Maybe version 8 is more polished/joe-regular-user friendly (which is what it's billed as if it's for use in Reader.
    Thanks again for your help.

  • I can't create table from another table?

    Hi everyone!
    I have a problem that I don't known the reason why?
    I'm using Oracle version 8i and I want to create a table from another table, such as:
         CREATE TABLE a_backup as SELECT * FROM a => It's OK, table a_backup is created.
    But there is only a table that I can't created like that, such as:
         CREATE TABLE b_backup AS SELECT * FROM b;
    When I run over command, SQL Plus is not responding... and clients are can't access to DB or Executing forever
    This is the first time I met this problem.
    Can Anyone help me to resolved it?
    Thanks in advance!

    xi`tin wrote:
    Hi everyone!
    I have a problem that I don't known the reason why?
    I'm using Oracle version 8i and I want to create a table from another table, such as:You realize, of course, that 8i is completely out of support .... Is your OS and hardware just as old as your rdbms software, or is it only the rdbms that your company refuses to upgrade?
         CREATE TABLE a_backup as SELECT * FROM a => It's OK, table a_backup is created.
    But there is only a table that I can't created like that, such as:
         CREATE TABLE b_backup AS SELECT * FROM b;
    When I run over command, SQL Plus is not responding... and clients are can't access to DB or Executing forever
    This is the first time I met this problem.
    Can Anyone help me to resolved it?
    Thanks in advance!

  • Can't create Project from the Template or access project template

    Dear Experts,
    We are facing a issue while trying to access the project template/create the project from project template.
    we have 4 project template in place and of these two are working perfectly fine but
    From remaining two we are not being able to create project and even templates are not accesible , whenever we are trying to access the project template system rotates a circle for some time and keeps us on the same page.
    Even when we are trying to create project from the same template, system does the same again rotates the circle for some time and keeps us on the same screen.
    And System is not throwing any error for the same (we have checked in the log as well) just not letting us in and not allowing us to create project.
    Any Help Will be Highly Appreciated.
    Regards,
    Rakesh Daiya

    Dear Experts,
    We were able to find out the issue,
    We added 3 groups to the template with "Reviewer" access with "Document Only" Type in the project template.
    When we changed the type to "Template and Document" from "Document Only" and  system started allowing us to create projects from the template.
    Can anyone please help me with one query,
    Can we add a group(which includes all the buyers) with reviewer access and with Document only type?
    Does this really be a reason behind projects are not getting created from template?
    Any help will be appreciated
    Regards,
    Rakesh Daiya

  • Can't create invoice from the delivery

    Hello.
    Ship out the trade order then i created the delivery and PGI successfully.
    But when i went to VF01 to invoice the delivery i can´t create it.
    I take a look to the LOG and this is what i found:
    Error Log
                 6910517662 000010 The item is blocked for billing
    I double click the item and in the configuration of Financial processing there is a field called "Block" but there is nothing selected over there. Do you have any suggestion?
    I appreciate your help

    The item is blocked for billing
    Apart from the suggestions, if that particular material is kept open in some other system, then also, system will throw this error.  Also ensure that in material master Sales Org.1 view, this material is not blocked against the field "X-distr.chain status"
    thanks
    G. Lakshmipathi

  • Can't create system from par in Portal 7.3

    Hello experts,
    lately I have insatlled the new Netweaver 7.3 Portal AS Java. Now I want to create a new system to make email-connectivity like described on help.sap.com. Following the instructions I get stuck at the point choosing new system from par. This option is not given...
    Can somebody help? How can I create a connectivity to our exchange without that option? Or is there a note poitning to to this case?
    Thanks in advance.
    Kind regards
    Lu Huynh

    Hi,
    In Netweaver 7.3, you have a tool called
    SystemFromParConverter to achieve this requirement. Please follow the below help link for more details.
    http://help.sap.com/saphelp_nwce711/helpdata/en/45/26d6a3522b4c2de10000000a1553f6/frameset.htm
    PS: Please  do the  steps mentioned in the above help link from the EP server itself and not from your own local system. Browse the EP server folders to locate the Par file.
    you have to place the par file in the EP server.
    Thanks and Regards,
    Sowmya K

  • Can Reader create PDF from XLS

    A few weeks ago, I had the ability to create PDF files from my Excel Spreadsheets.  I do not remember how I set this up but it worked fine.  Then I realized that I had both Reader V6 and V7 installed so I uninstalled V6.  Now I can't create the PDF files as before.  What happened and how can I fix it?
    Thanks,

    I did not think so.  But I DID have the functionality.  The only thing I could think of that might have changed was that I uninstalled Reader V6 but kept V7. When I first set it up, I was thinking that it was part of Excel.  How could I have gotten the functionality?

Maybe you are looking for

  • Vendor Down Payment issue

    Dear Expert             While doing F-48 Vendor Down Payment am getting below Error Customer 450822 is not defined in company code 1000 Message no. F5102 Diagnosis No master record was created in company code "1000" for customer number "450822". Syst

  • Urgent Help in java accross the UNIX platform

    If I develop an application using Java in SCO Unix, Is it possible to port the same application to HP Unix or AT & T Unix. Please kindly give me the infomation/details where it is available or how to do it. Need urgent Thanks in Advance Jyothi

  • Display image from table!

    Hi, I have in my aplication a table user, where we can save is image: t_user{id_user, name , adress..., foto(blob),foto_size(number),foto_name,foto_mime_type}; An user can upload his imageand save it in his table! I wanted to display his image, but i

  • HTTP Service XML to ArrayCollection

    Hi, How do I convert the results from a remote XML List file called using the HTTPService method into an arrayCollection for sorting filtering etc. ??? (I assume it is the arrayCollection please feel free to suggest a better method) I have this worki

  • ADOBE CS6 AND MAVERICKS

    Hello, i am with  Macbookpro mac os x 10.7.5 and i am going to update to Mavericks. I have adobe creative suit 6 (AE, PS, PR etc.) My question is-> When i updato to mavericks will all these programs and actually any program i have on my mac run as it