Management of large projects using JNI

I've got some code written in C and I want to interact with these code using JNI. But these code comprehends lots of c and h files, spreaded in lots of directories. To compile all of these, I have some makefiles. My question is: how can I start managing all of these code using JNI, I mean, what could it be my start point? Should I try to change the c code that calls everything?
Where can I put my new generated java, c and h files, in order not to generate a great mess?
Thanks!
Gilmar

Where can I put my new generated java, c and h files,
in order not to generate a great mess?In a directory besides the one that contains all of your other C/H code.

Similar Messages

  • Managing a large Flash project

    I work for a game development studio in London. We are prototyping using Autodesk Scaleform and building our game UI using Flash. We will need to be able to run a large project with a team of 3-4 artists and 10+ programmers. We use Perforce source control system for storage of all code and assets. We need to be able to manage a project with multiple shared resources and multiple people (artists & programmers) working on screens and controls.
    Our problem is as follows:
    We want to be able to create skinned graphical custom components, such as buttons, sliders, checkboxes as well as more complex controls such as tables and game specific elements.
    We want to be able to share graphics assets in a single location and allow multiple artists and coders to work on shared components simultaneously. We need all of this to be stored in a Perforce source control repository.
    For AS3 code this is all fairly straight forward. It works like any other codebase and we have set up FlashBuilder and FlashDevelop projects.
    Now, the options seem to be as follows:
    - Create a flash project or projects. The problem here is that all of the assets are copied into AuthortimeSharedAssts.fla. This means that, because FLA is a binary format, our source control cannot allow more than one person to edit any shared resource at the same time.
    - Set up manual authortime sharing. This will allow work on multiple shared components because individuals can update a small discrete FLA file and this will automatically update a larger shared librar. The problem is that this does not allow sharing of graphics assets, which means that, if an artist updates a graphic, this does not filter down to individual flash files.
    - Use the XFL format. This would allow us to merge files when checking in to source control as they are plain text and it saves out individual assets as separate files, which looks perfect. The problem is that I can't see how to make a project, which entirely uses XFL files (i.e. makes something like AuthortimeSharedAssets.xfl).
    At the moment I can't see any obvious, sensible way of running a large project  in Flash. We cannot be the first to do this sort of thing though.
    Can anyone help or explain how we should do it?

    Just an $0.02 that is probably the hardest solution to implement, you really need a good project manager. You can't expect great results from tossing a bunch of autonomous bodies in motion on shared resources with no human control mechanism. Software can help but your format is ultimately binary, so outside Smart Objects (which haven't worked well in a networked multi-OS environment for me), you're not going to gain the benefits of traditional diff for source code.
    Consider implementing either a project manager or even better, a project manager with decent project management software. It can be as cheap as Copper Project. You're given a hud with tasks and it's up to the Project Manager to assign the tasks so nothing overlaps and collisions are avoided from the start. It's even a large challenge in the binary world for a high quality Project Manager.
    If you really need a garage level setup, you may simply have to employ locking network files that are in use. Anyone trying to use something won't be able to, it will stifle progress but you won't run into overlaps or impossible merges. It's just brute force and inefficient.

  • How can i call a VB6 project from my java application using JNI

    hi
    can anyone tell me the procedure of calling a VB6 project from any java application using JNI
    if anyone does know then tell me the detail procedure of doing that. I know that i have to create a dll of that VB6 project then to call it from the java application.
    if anyone know that procedure of creating dll file of an existing VB6 project please reply
    please if anyone know then let me know

    Ahh, kind of a duplicate thread:
    http://forums.java.sun.com/thread.jspa?threadID=631642
    @OP. You could have clarified your original post and the relationship of your question to java. You did not need a new thread.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Export format for clips to be used in larger project.

    Back in the PE2 days, I used to capture and trim a clip and "export movie"  which resulted in a "DV-AVI" file.  This is what I understood PE "liked" and the best format to use for import to a larger project (and it worked nicely every time).  Now, in PE11, I don't see that option.  This method is handy, not only for trimming stuff you don't want, but naming the clips to help with content id.  What option should I use that preserves quality and cooperates with PE best?

    BobSomr wrote:http://www.lynda.com/Premiere-Elements-tutorials/Up-Running-Premiere-Elements-11/109763-2. html
    Hey Steve,
    Will there be a PrE11/PSE11 book?
    Bob
    http://www.amazon.com/Muvipix-Guide-Premiere-Elements-version/dp/1479311200/ref=sr_1_2?s=b ooks&ie=UTF8&qid=1358603413&sr=1-2&keywords=muvipix
    http://www.amazon.com/Muvipix-com-Guide-Photoshop-Elements-Premiere/dp/1480209392/ref=sr_1 _10?s=books&ie=UTF8&qid=1358603413&sr=1-10&keywords=muvipix
    For less than the book, watch Steve in a 3 hour course here:  http://www.lynda.com/Premiere-Elements-tutorials/Up-Running-Premiere-Elements-11/109763-2. html

  • How to use solution manager in upgrade projects

    Hi,
    How to utilize/use the solution manager in upgrade project like R/3,BW,CRM or entire landscape.
    if we are upgrading the r/3 4.6c to ecc6 and bw3.5 to bi7.0 how to use the solution manager
    please help and thanks in advance.
    Edited by: MAHIPAL REDDY on Jan 1, 2009 1:28 PM

    Hi,
    Check [this document|https://websmp208.sap-ag.de/~sapdownload/011000358700002696532005E/310_320_SOLMAN_URMP_EN.doc]. This will help you to proceed further.
    This is a detailed documentation on using Solution Manager for your upgrade project.
    This will solve your problem.
    [This Pdf |https://websmp208.sap-ag.de/~sapdownload/011000358700000208052007E/Upgrade_FAQ_SolMan_70.pdf]of FAQs on upgrade project is rich in information.
    Feel free to revert back.
    --Ragu
    Edited by: Raguraman C on Jan 3, 2009 5:27 PM

  • Managing Tasks in large projects

    I'd like to create DAQmx tasks inside the folder structure of my project (.lvproj).
    If I right-click on folder 'beamPath' and create a New DAQmx task, it results in the above.
    However, when I close the project and re-open, it's gone.
    If I right-click on 'My Computer' create task, close project and re-open, it's still there:
    Where does the task exist? is it a file I can view when looking at the file structure.
    I have a very large project divided into sub-systems that I test individually, I'd like the tasks for each sub-system stored within a folder called "tasks" inside the autopopulating folder structure of the Project.

    The task and all other DAQmx stuff is stored in the project (*.lvproj) auto-pop folders don't work because there is no file on disk for the task besides that xml file with the .lvproj extension.  Try opening the project with Internet Explorer- you'll see exactly what I mean and learn a lot about how DAQmx tasks live.
    Which brings up another "Nice-to-Know" tidbit of information.  Auto-populating folders were invented by the devil's mother.  Have you ever seen a shipping example that used them?  Did you know that project templates can't use them? (today, but I saw a CAR show up to change that)  Don't use them.  They were helpful to build projects out of llbs and get you going with projects but, they have limitations.  The project explorers's files view is a much more powerful tool to use to sync your file structure on disk with your virtual folder structure (If you want that that) Virtual folders hold things just as effectively since you can really only hurt yourself messing with the files on disk without using the project explorer anyway (Thats how you get conflicts.)
    Jeff

  • Very large project management - need advice?

    I am editing a 6 one hour episode series. I am doing this with a single library and about 20 events. Each event holds the footage keywords for the original Prores source files. I have the 6 major episode timelines created and also about 20 more timelines for interviews (I have 80 interviews that are subtitled). My FCP library files is 1.82TB size.
    I am running a new Mac Pro and a new 8TB Raid 0 drive (2x4Tb). This started to freeze once or twice a day while editing.
    I am now thinking to make this into 6 libraries - one for each episode and with just 3 or 4 timelines needed (sequences) for each episode. Would this help? I read that FCPX cannot handle a large project like mine and long timelines?
    Thanks.

    Jon Braeley wrote:
    My source files are 99% Prores, so I leave the files in place and do not optimize.
    Just to point out that FCP X should not allow optimizing of  iFrame media, which of cours Pro Res is,
    Have you seen any info on splitting into smaller libraries - not seen anything on this?
    I just recently did this to reverse course on an early organizational decision I'd come to regret. Basically created new libraries and moved events to them from within the app.
    But I would definitely consider Luis' suggestion about consolidating and working with external media.
    Russ

  • Visarc generates dirty project using SVN source control

    Hi,
    I've read in different topics some issues related to the visarc file, but unfortunately, none of them helped me out. I was wondering if any of you came across this issue and found a solution or workaround to it.
    The problem relates to a LabVIEW project which opens dirty, as you commonly say, under some circunstances. Below I will explain some of the problems I encountered as I tried to track this problem down.
    1. I'm running a large LabVIEW Run-Time project using a PXI with several FPGA - cRIO.
    2. I found that when opening the project file, this is perfectly clean and no asterisk shows in the title bar. I close the project and no saving is needed.
    3. I open the project again and I open a sub-VI which contains the following code:
    4. Straight away, the file visarc shows up under the Dependencies tree of the Real-Time PXI and the asterisk shows now on the title bar of the project (not the VI).
    5. The VI closes without needed to be saved but the project says that an item was added, removed and added, and it has to be saved (as soon as I close the subVI above, the visarc file dissapears from the Dependencies section).
    6. What I do next is to add this file visarc (located in Program Files\National Instruments\LabVIEW 2012\resource) to the project under the PXI tree. I then save the project and close it.
    7. I open the project again, and it keeps being clean (not dirty, as you say).
    8. I open the same sub-vi than before and everything keeps being clean and no saving is needed neither on the sub-VI nor the project. Everything goes smooth in my local computer from now on.
    However, the issue that I can not resolve follows:
    9. We are two people working on this project, and we're using SVN as source version control. Everything works fine in my computer, but when my partner update the files on his computer, the project opens dirty as soon as it opens (only the project, the sub-VI is no needed to be saved).
    10. My partner just save the project and close it, and it becomes clean straight away in his computer. The files which are saved are the aliases file (I expected that), the labview project file, and the LVLPS File of the project.
    This issue will happen again as soon as any of us downloads the SW committed by the other.
    I hope any of you can help me out with this issue. Any suggestion or idea are welcome.
    Thank you very much in advanced.
    Best regards,
    danidpr

    As far as I know, the resource manager does not support version control. If you map the version control folder to a local folder, you can use that in RoboHelp. But I'm afraid that any changes in the resource manager files will require you to manually check them out first. This is how I'm doing it anyway.
    Kind regards,
    Willam

  • What is the best way to manage the large FinalCutProX files

    We are continously running out of space on our desktop with the FinalCutProX files being so large. We have moved most of the files (events & projects) to an external server and working off the single video projects from our desktop. How are you working and what is you set up to manage these large files.?
    Computers we are using  new Mac Pro:
    Memory  16 GB 1600 MHz DDR3
    Processor  2.7 GHz Intel Core i7
    OS X 10.8.5
    What type of external servers?
    Are both the events and projects stored  together
    Do you keep the video you are currently working on your desktop?
    Thanks,
    Ang

    I have a MacBook Pro 17", 2.2 Ghz i7, 16 GB of RAM, 960 GB internal SSD (2 platters RAID 0). I have about 250 GB free on the internal drive, where I keep my current project. I also have a 3 TB external Thunderbolt desktop drive where I store the completed projects. I backup both drives to multiple drives that are stored away between daily backups.
    If my current project takes up a lot of space, I work it on the 3 TB external. I also have a 750 GB Seagate Momentus XT hybrid HD/SSD Thunderbolt bus powered portable just in case I need it in the field.

  • Memory Allocation problem when using JNI

    For a Project we need to interface Labwindows-CVI/ Teststand with an application written in Java. we are using JNI. The code uses JNI_CreateJavaVM to start a JVM to run the Java interface code. The code did run for some time , but now ( without any obvious change nor on the CVI side neither on the Java side) JNI_CreateJavaVM fails with -4 error code, that means that the start of the JVM failed due to memory allocation failure. First investigation showed, that even if Windows Task Manager shows about 600M free physical memory, you can allocate in CVI only about 250M as a single block at the time we are calling  JNI_CreateJavaVM. That might be a little bit to less as we need to pass -Xmx192m to the JVM to run our code. Unfortunately just increasing the physical memory of that machine from 1.5G to 2G doesn't change anything. The free memory showed by Task Manager increases, but the allocatable memory block size does not. Are the any trick to optimize CVI/Teststand for that use case ?  Or maybe known problems with JNI ?
    Solved!
    Go to Solution.

    hi,
    have you tried other functions to allocate memory?
    the -Xmx command only sets the maximum heap size. You can try to use -Xms. This command sets the initial Java heap size. 

  • Eclipse vs. Netbeans for large projects

    I've been getting a bit fed up with Netbeans this last year, to tell the truth. The main bugbear is all the "project scanning" that goes on when you make the least change to libraries etc.. It's also got some very nasty habits, like I'm typing a method name and the auto-completion suddenly substitutes a completely different method, presumably on the basis of what I was typing a second ago, and I'm still having debugger problems on my largest program.
    And the metadata database all this project scanning produces is unreliable, about once a week I have to delete the whole thing and let it be built again. Several releases have gone past without these fundamentals being fixed, the developers have more fun adding facilities for the next language I'm never likely to use.
    Anyway, enough ranting. The question in my mind is, should I finally give up and switch to eclipse, am I going to find it has it's own problems just as annoying? So this question is addressed to people who have used both on large projects. Is the grass really greener on the other side?
    I'm irritated that there's no open source plug-in for mattise. I have several forms created under Netbeans. If we're going to MyEclipse does this mean I should consider the other commercial Java IDEs?

    Malcolmmc,
    Through my career I've had to support users in real life that have issues just as you describe, but with Product X, while I'm not saying this is what is ailing you--because I've not seen anything about what you are doing or running--here are some of my findings:
    1 - (and this is the #1 cause that I've run across for this type of thing) How much stuff are you running in memory at startup? Those little icons down in the tray actually represent programs running in memory that each take up a finite and distinct part of your available memory, and some of them stream information or access the internet and other rerources frequently. I once answered a ticket from a person that had a huge box, for the time, he had 30--yes, that is right 30--programs loading on startup. His complaint was that the machine took a long time to start and then was sluggish. I unloaded everything and had him run his apps--amazingly, he was delighted with the speed and wanted to know what I had done. I then had to tell him the bad news: he couldn't monitor the stock exchange, weather, recieve up to the minute nascar happenings, and etc. He didn't like it, but it fixed his problem. I later went back to find he had 20 of them reloaded--20 seemed to him a happy compromise between instant information and speed.
    2 - Virtual memory--none or too small. I've found a few people that run without a swap file... it runs great until memory gets full, then bad things happen.
    3 - Other programs competing for resources. I see this all the time, one program is trying to do I/O and being blocked by another.
    4 - Hardware issures. Often the hardware just wares out. For instance: a fan stops or slows down on a video card and the whole system slows down as the GPU overheats--not enough to shut everything off, but maybe just enough that your super fast system become a dog.
    5 - Hardware conflicts--this is not nearly as frequent a problem as in the Standardization Era post '96, but it does still happen. Check your hardware manager and the drivers being used.
    6 - Out of date driver issues... enough said there, we've all had them.
    7 - HD fragmentation--this is not so common, but does happen still.
    8 - Low Memory (this should be moved up to #2) People still persist in undervaluing the worth of extra memory. There isn't an amount of RAM supported on a computer that represents too much RAM. RAM is cheap, RAM is good, MAX RAM is even best. (btw--with 3 GB you shouldn't have problems running NetBeans.)
    9 - Installation issues. Not everything installs properly and when it doesn't install properly it's not always a reported error.
    10 - Configuration problems. Sometimes new features can be very annoying and can be turned off.
    11 - Believe it or not, OS's are not perfect and they need to be tuned up from time to time. If you are running Windows, then clean out your temporary files area, not just your Internet Temporary Files Area, but the system temporary files area. If you've been running heavily, then I guarantee you have 1000's of temporary files that are choking your performance as Windows tries to keep track of them. Delete them.
    12 - Part of your program or resource your program uses may have become corrupt. This happens more that we like to admit.
    There are tons of other things, but these at the big 12 that I usually go looking for when I get a call saying computer problems are beating them up.

  • FCP 7.0 problems opening a large project.

    My FCP 7.0 suddenly got slow in opening. Took forever to open despite it having always opened quickly. I have a large project (about 115 minutes) but it still was opening OK until yesterday when it slowed down.
    I have done the following:
    1) Threw away my preferences and caches using Preference Manager
    2) repaired permissions (utility etc)
    3) Checked my Hard Drive - its OK.
    4) Re installed FCP 7.0
    Suddenly it didn't open at all. I get an error code  - 1712
    What the heck is going on? Can anyone explain please?
    Im using Snow Leopard, MacBook Pro
    HELP PLEASE?
    Thanks in advace
    William

    Hi
    Me just thinking.
    Error -1712 = errAETimeout Apple event timed out
    • How much free space is there on Your Main Start-Up (Mac OS) Hard disk ?
    • Other external hard disks connected ? and formatted as how ?
    Yours Bengt W

  • We are using jni.h but its getting errors, please check it this

    We are using jni.h but its getting errors, please check it this
    Calling from a .dll using Java and JNI - by Borland Developer Support Staff
    Abstract:Basic JNI example: making a Win32 API call
    Making Native Windows API calls from within a Java Application
    One of the main points of Java is to be completely platform independent. However, sometimes it will occur that the developer of an
    application will know that his or her application is only going to be run on a specific platform, for example, Win32.
    NOTE: This example assumes that you are using JDK 1.2 or later.
    Below are the steps for writing a Java application that makes a Win32 API call. The application generates a Swing Jframe and makes it
    system modal, or gives it the �Always On Top� functionality, similar to that of the Windows NT Task Manager.
    Steps to follow:
    1. Write the Java code for the application
    2. Run javah.exe on your .class file to generate a C header file
    3. write the implementation of your native methods
    4. create the shared library
    5. run the application
    1. Write the Java code for the application
    import java.awt.*;
    import sun.awt.*;
    import sun.awt.windows.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class Frame1 extends JFrame {
    int windowHWND = 0;
    JButton jButton1 = new JButton();
    public Frame1() {
    //windowHWND = this.getHwnd();
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    public int getHwnd() {
    DrawingSurfaceInfo w = (DrawingSurfaceInfo) ((DrawingSurface) getPeer()).getDrawingSurfaceInfo();
    w.lock();
    WDrawingSurfaceInfo win32 = (WDrawingSurfaceInfo) w;
    int hwnd = win32.getHWnd();
    w.unlock();
    return hwnd;
    static {
    System.loadLibrary("windowOnTop");
    public static native void WindowAlwaysOnTop(int hwnd, boolean flag);
    public static void main(String[] args) {
    Frame1 frame11 = new Frame1();
    frame11.setSize(400,400);
    frame11.setVisible(true);
    private void jbInit() throws Exception {
    jButton1.setText("jButton1");
    this.addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowOpened(WindowEvent e) {
    this_windowOpened(e);
    public void windowClosing(WindowEvent e) {
    this_windowClosing(e);
    this.getContentPane().add(jButton1, BorderLayout.NORTH);
    void this_windowOpened(WindowEvent e) {
    windowHWND = this.getHwnd();
    System.out.println("the value is: " + this.getHwnd());
    this.WindowAlwaysOnTop(windowHWND, true);
    void this_windowClosing(WindowEvent e) {
    System.exit(0);
    Once the code is written, compile it with Jbuilder or the command line javac.exe tool which will result in a generated .class file. You will use
    this .class file in the next step.
    2. Run javah.exe on your .class file to generate a C header file
    The following line represents the basic syntax for running javah.exe:
    javah Frame1
    where Frame1 is the name of the argument class.
    When you run javah.exe, it will generate a header file by the same name as your implementation but with a .h file extension. For this
    example the .h file that was generated from the above Java code will be emitted being that it is quite large.
    NOTE: Make sure that when you run javah.exe, it is the javah.exe that came with the same JDK that you will be compiling with as there may
    be some issues with using a version of javah.exe that is different from that of the JDK you are using to compile.
    3. write the implementation of your native methods
    Now that you have your Java source and your C header file, it is time to write the implementation of your native methods.
    Following is the C code that corresponds to the native methods declared in the Java code listed in step 1:
    #include "jni.h"
    #include "Frame1.h"
    #include <stdio.h>
    #include<windows.h>
    JNIEXPORT void JNICALL Java_Frame1_WindowAlwaysOnTop(JNIEnv *env, jclass obj, jint hwnd, jboolean flag)
    if (flag)
    SetWindowPos((HWND) hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
    else
    SetWindowPos((HWND) hwnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
    return;
    You will notice several things: one is that the function signature has �Java_Frame1_� preceeding the name of the function. If there was a
    package statement in the Java source, it would appear after ��Frame1_� in the function signature.
    Second, you will notice the #include �jni.h�. Normally this would be #include<jni.h>, depending on how you have your libraries set up within
    your C compiler.
    4. create the shared library
    Now you are ready to create the shared library. Using your C compiler, create a .dll file with the code from the C implementation file. Refer
    to the doccumentation of the C compiler for details on creating a .dll file.
    For those interested in using Borland C++ Builder:
    If you have got it installed, you could use Borland C++ Builder 3 or C++ Builder 4 to create your DLL file. If this is the case, you would use
    File | New... | DLL C++ Builder will then generate some code for you, and you will just need to add your implementation code to the code
    which was generated.
    Remember in the Java code in step one there is a line:
    static {
    System.loadLibrary("windowOnTop");
    �windowOnTop� is the name of the .dll file. You can name it whatever you want, just make sure that you specify the appropriate name when
    loading the library.
    5. run the application
    Finally you are ready to run the application. From the command line use java.exe and as the argument specify the name of the class that
    you compiled in step one. Once the system loads your DLL, the window that the VM creates should mimic the �Always On Top�
    functionality.
    We are getting errors like this
    �Compiling JNI.H:
    Error JNI_MD.H 23: , expected
    Error JNI.H 115: Declaration missing
    Error JNI.H 200: ) expected
    Error JNI.H 202: ) expected

    #include "jni.h"
    #include "Frame1.h"
    #include <stdio.h>
    #include<windows.h>
    JNIEXPORT void JNICALL Java_Frame1_WindowAlwaysOnTop(JNIEnv *env, jclass obj, jint hwnd, jboolean flag)
    if (flag)
    SetWindowPos((HWND) hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
    else
    SetWindowPos((HWND) hwnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
    return;
    We are getting errors like this
    �Compiling JNI.H:
    Error JNI_MD.H 23: , expected
    Error JNI.H 115: Declaration missing
    Error JNI.H 200: ) expected
    Error JNI.H 202: ) expected

  • Media Manager - "batching" several projects possible??

    Anyone have a solution to "batch" several FCP projects with Media Manager.. I have several editors who are in need to move many large projects off the Xsan on to external drives for archive.
    Because it takes so long to Media Manage each project, I'm looking for a way to "batch" several projects over the weekend.. Hoping for a "set it and forget it" work flow!!

    regardless of whether you figure out how to do the "batch," I hope you realize that you need to confirm the success of the media manage. A few things that can (but don't necessarily) cause problems, multiclips, nests, imported digital files (as opposed to files brought in using log and transfer and log and capture). Over the years, I've seen fewer and fewer problems, but forewarned is forearmed. Just did a media manage of a 4 minute sequence and there was a problem with one audio file from a collapsed multiclip.

  • JVM Crash When Using JNI and COM

    I'm trying to call a DLL compiled from VB6 source code that I do not have access to. The VB6 code simply retrieves data from a DB2 database using ADO and my client code grabs that data and marshals it to my Java code. I'm attempting to achieve this using JNI and COM (without a third-party bridge). It works 75% of the time, but the other 25% of the time, the JVM crashes with the usual Hotspot crash log containing an access violation exception. However, I don't know what in my C++ code (VC++ 8) could be causing this except for passing a "wild" pointer to the code lying underneath the COM object interface. If that is the case, I don't know how I am doing that.
    The Java code that is calling my native method is running on Tomcat 5.5.25 and just to be safe, I am not allowing multiple threads to concurrently call the method in my JNI DLL (though I realize that this will kill performance). Once I can get past this problem, I'll do the COM interfacing on a worker thread in my native code so I don't screw up CoInitialize and CoUninitialize calls in the case the same thread is concurrently executing multiple calls to my native code.
    I've noticed that in most cases, the JVM crashes during my call to the pClsAccount->OpenConnection method. However, my DLL isn't what is listed on the top of the call stack, which is why I suspect the passing of a wild pointer, though I'm just taking a guess at that. Does anyone have an idea as to what's going on ?
    JNIEXPORT jobject JNICALL Java_CustomerInfo_nGetCustomerAccountInfo(JNIEnv *env, jobject customerInfo, jstring accountNumber, jstring iniFileName)
    jboolean isCopy;
    // Account info class and instance to be instantiated
    jclass accountInfoCls = NULL;
    jobject accountInfoObj = NULL;
    // The constructor ID of the accountInfoCls
    jmethodID ctorID = NULL;
    // Pointer to the interface for the ClsAccount COM object
    _clsAccount *pClsAccount = NULL;
    HRESULT hr;
    BSTR bstrIniFileName(L"");
    try
    const char *nativeAccountNumber = NULL;
    if (accountNumber != NULL)
    nativeAccountNumber = env->GetStringUTFChars(accountNumber, &isCopy);
    else
    jclass newExcCls;
    env->ExceptionDescribe();
    env->ExceptionClear();
    newExcCls = env->FindClass("java/lang/IllegalArgumentException");
    env->ThrowNew(newExcCls, "accountNumber passed in was null !");
    return NULL;
    // Initialization
    variantt varConnectionSucceeded = variantt(false);
    variantt varGetAccountInfoSucceeded = variantt(false);
    variantt varAccountNumber = variantt(nativeAccountNumber);
    bstrt bstrLastPaymentDate = bstrt();
    bstrt bstrLastErrorMessage = bstrt();
    bstrt bstrLastErrorNumber = bstrt();
    jlong jTotalDue = NULL;
    jlong jEstablishedDueDay = NULL;
    jlong jLastPaymentAmount = NULL;
    jstring jLastPaymentDate = NULL;
    jstring jLastErrorMessage = NULL;
    jstring jLastErrorNumber = NULL;
    jthrowable jException = NULL;
    const char *chLastPaymentDate = NULL;
    const char *chLastErrorMessage = NULL;
    const char *chLastErrorNumber = NULL;
    long long totalDue;
    long long lastPaymentAmount;
    long establishedDueDateDay;
    //Convert string from Java string to C string to VB string
    const char *nativeIniFileName = NULL;
    if (iniFileName != NULL)
    nativeIniFileName = env->GetStringUTFChars(iniFileName, &isCopy);
    else
    jclass newExcCls;
    env->ExceptionDescribe();
    env->ExceptionClear();
    newExcCls = env->FindClass("java/lang/IllegalArgumentException");
    env->ThrowNew(newExcCls, "iniFileName passed in was null");
    return NULL;
    bstrIniFileName = comutil::ConvertStringToBSTR(nativeIniFileName);
    CoInitialize(NULL);
    // Create an instance of the COClass with the interface over it
    hr = CoCreateInstance(__uuidof(clsAccount), NULL, CLSCTX_INPROC_SERVER, __uuidof(_clsAccount), (void **)&pClsAccount);
    if (hr == S_OK)
    varConnectionSucceeded.boolVal = pClsAccount->OpenConnection(&bstrIniFileName);
    &#12288;
    if (varConnectionSucceeded.boolVal == -1)
    varGetAccountInfoSucceeded.boolVal = pClsAccount->GetAccountPaymentInformation(&(varAccountNumber.GetVARIANT()));
    env->ReleaseStringUTFChars(accountNumber, nativeAccountNumber);
    // Extract all available account information from the ClsAccount object
    if (varGetAccountInfoSucceeded.boolVal == -1)
    totalDue = pClsAccount->TotalDue.int64;
    establishedDueDateDay = pClsAccount->EstablishedDueDateDay;
    lastPaymentAmount = pClsAccount->LastPaymentAmount.int64;
    bstrLastPaymentDate = pClsAccount->LastPaymentDate;
    chLastPaymentDate = comutil::ConvertBSTRToString(bstrLastPaymentDate.GetBSTR());
    jTotalDue = (jlong)totalDue;
    jEstablishedDueDay = (jlong)establishedDueDateDay;
    jLastPaymentAmount = (jlong)lastPaymentAmount;
    jLastPaymentDate = env->NewStringUTF(chLastPaymentDate);
    delete[] chLastPaymentDate;
    pClsAccount->CloseConnection();
    // Populate error fields if any errors occur
    bstrLastErrorMessage = pClsAccount->LastErrMessage;
    chLastErrorMessage = comutil::ConvertBSTRToString(bstrLastErrorMessage.GetBSTR());
    bstrLastErrorNumber = pClsAccount->LastErrNumber;
    chLastErrorNumber = comutil::ConvertBSTRToString(bstrLastErrorNumber.GetBSTR());
    jLastErrorMessage = env->NewStringUTF(chLastErrorMessage);
    jLastErrorNumber = env->NewStringUTF(chLastErrorNumber);
    delete[] chLastErrorMessage;
    delete[] chLastErrorNumber;
    const char* clsName = "com/nuance/merchantsmutual/businessentities/CustomerAccountInfo";
    // Find the Java class and the ID of its constructor
    accountInfoCls = env->FindClass(clsName);
    ctorID = env->GetMethodID(accountInfoCls, "<init>", "(JJJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
    jException = env->ExceptionOccurred();
    if (jException != NULL)
    env->ExceptionDescribe();
    env->ExceptionClear();
    //Release all resources associated with the ClsAccount instance
    pClsAccount->Release();
    //Instantiate the class with the given parameters
    accountInfoObj = env->NewObject(accountInfoCls, ctorID, jTotalDue, jEstablishedDueDay, jLastPaymentAmount, jLastPaymentDate, jLastErrorMessage, jLastErrorNumber);
    jException = env->ExceptionOccurred();
    if (jException != NULL)
    env->ExceptionDescribe();
    env->ExceptionClear();
    else if (hr == REGDB_E_CLASSNOTREG)
    cout << "COM class not registered" << endl;
    else if ( hr == CLASS_E_NOAGGREGATION)
    cout << "COM class can't be aggregated" << endl;
    else if (hr == E_NOINTERFACE)
    cout << "No interface for COM class clsAccount" << endl;
    else if (hr == E_POINTER)
    cout << "*ppv pointer was NULL !" << endl;
    else
    cout << "Error occurred while creating COM object. HR is [" << hr << "]" << endl;
    // Free the BSTR because a new one was returned with a call to comutil::ConvertStringToBSTR
    SysFreeString(bstrIniFileName);
    // Release the string when it's no longer needed. MUST call if string won't be used
    // anymore or else a memory leak will occur
    env->ReleaseStringUTFChars(iniFileName, nativeIniFileName);
    CoUninitialize();
    &#12288;
    catch (_com_error &e)
    cout << "Encountered an exception in GetCustomerAccountInfo: Error was " << e.ErrorMessage();
    pClsAccount->Release();
    catch (...)
    pClsAccount->Release();
    return accountInfoObj;
    Edited by: Cthulhu76 on Jan 5, 2010 9:18 AM

    0x49202400 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_blocked, id=5340, stack(0x49bf0000,0x49c40000)]
    0x48a7e800 JavaThread "Thread-1" [_thread_in_native, id=5976, stack(0x48f00000,0x48f50000)]
    0x48a0dc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3072, stack(0x48c60000,0x48cb0000)]
    0x48a09000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=4988, stack(0x48c10000,0x48c60000)]
    0x48a07c00 JavaThread "Attach Listener" daemon [_thread_blocked, id=3124, stack(0x48bc0000,0x48c10000)]
    0x48a07000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2572, stack(0x48b70000,0x48bc0000)]
    0x489f5c00 JavaThread "Finalizer" daemon [_thread_blocked, id=5752, stack(0x48b20000,0x48b70000)]
    0x489f4c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=2596, stack(0x48ad0000,0x48b20000)]
    0x003c6000 JavaThread "main" [_thread_in_native, id=4252, stack(0x00820000,0x00870000)]
    Other Threads:
    0x489f0400 VMThread [stack: 0x48a80000,0x48ad0000] [id=5624]
    0x48a18800 WatcherThread [stack: 0x48cb0000,0x48d00000] [id=1192]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 36288K, used 12762K [0x02940000, 0x050a0000, 0x07800000)
    eden space 32256K, 34% used [0x02940000, 0x0343af58, 0x048c0000)
    from space 4032K, 37% used [0x04cb0000, 0x04e2ba28, 0x050a0000)
    to space 4032K, 0% used [0x048c0000, 0x048c0000, 0x04cb0000)
    tenured generation total 483968K, used 7518K [0x07800000, 0x250a0000, 0x42940000)
    the space 483968K, 1% used [0x07800000, 0x07f57958, 0x07f57a00, 0x250a0000)
    compacting perm gen total 14080K, used 14016K [0x42940000, 0x43700000, 0x46940000)
    the space 14080K, 99% used [0x42940000, 0x436f0320, 0x436f0400, 0x43700000)
    No shared spaces configured.
    Dynamic libraries:
    0x00400000 - 0x0040f000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\tomcat5.exe
    0x7c800000 - 0x7c8c0000      C:\WINDOWS\system32\ntdll.dll
    0x77e40000 - 0x77f42000      C:\WINDOWS\system32\kernel32.dll
    0x77380000 - 0x77411000      C:\WINDOWS\system32\USER32.dll
    0x77c00000 - 0x77c48000      C:\WINDOWS\system32\GDI32.dll
    0x77f50000 - 0x77feb000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77c50000 - 0x77cef000      C:\WINDOWS\system32\RPCRT4.dll
    0x76f50000 - 0x76f63000      C:\WINDOWS\system32\Secur32.dll
    0x77ba0000 - 0x77bfa000      C:\WINDOWS\system32\MSVCRT.dll
    0x7c8d0000 - 0x7d0cf000      C:\WINDOWS\system32\SHELL32.dll
    0x77da0000 - 0x77df2000      C:\WINDOWS\system32\SHLWAPI.dll
    0x76290000 - 0x762ad000      C:\WINDOWS\system32\IMM32.DLL
    0x77420000 - 0x77523000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.3959_x-ww_D8713E55\comctl32.dll
    0x6d7c0000 - 0x6da10000      C:\Program Files\Java\jre1.6.0_07\bin\client\jvm.dll
    0x76aa0000 - 0x76acd000      C:\WINDOWS\system32\WINMM.dll
    0x7c340000 - 0x7c396000      C:\WINDOWS\system32\MSVCR71.dll
    0x6d270000 - 0x6d278000      C:\Program Files\Java\jre1.6.0_07\bin\hpi.dll
    0x76b70000 - 0x76b7b000      C:\WINDOWS\system32\PSAPI.DLL
    0x6d770000 - 0x6d77c000      C:\Program Files\Java\jre1.6.0_07\bin\verify.dll
    0x6d310000 - 0x6d32f000      C:\Program Files\Java\jre1.6.0_07\bin\java.dll
    0x6d7b0000 - 0x6d7bf000      C:\Program Files\Java\jre1.6.0_07\bin\zip.dll
    0x6d570000 - 0x6d583000      C:\Program Files\Java\jre1.6.0_07\bin\net.dll
    0x71c00000 - 0x71c17000      C:\WINDOWS\system32\WS2_32.dll
    0x71bf0000 - 0x71bf8000      C:\WINDOWS\system32\WS2HELP.dll
    0x71b20000 - 0x71b61000      C:\WINDOWS\system32\mswsock.dll
    0x5f270000 - 0x5f2ca000      C:\WINDOWS\system32\hnetcfg.dll
    0x71ae0000 - 0x71ae8000      C:\WINDOWS\System32\wshtcpip.dll
    0x76ed0000 - 0x76efa000      C:\WINDOWS\system32\DNSAPI.dll
    0x76f70000 - 0x76f77000      C:\WINDOWS\System32\winrnr.dll
    0x76f10000 - 0x76f3e000      C:\WINDOWS\system32\WLDAP32.dll
    0x76f80000 - 0x76f85000      C:\WINDOWS\system32\rasadhlp.dll
    0x4a6a0000 - 0x4a6ac000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\CustomerInfoProxy.dll
    0x77670000 - 0x777a9000      C:\WINDOWS\system32\ole32.dll
    0x77d00000 - 0x77d8b000      C:\WINDOWS\system32\OLEAUT32.dll
    0x7c420000 - 0x7c4a7000      C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_E6967989\MSVCP80.dll
    0x78130000 - 0x781cb000      C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_E6967989\MSVCR80.dll
    0x777b0000 - 0x77833000      C:\WINDOWS\system32\CLBCatQ.DLL
    0x77010000 - 0x770d6000      C:\WINDOWS\system32\COMRes.dll
    0x77b90000 - 0x77b98000      C:\WINDOWS\system32\VERSION.dll
    0x75da0000 - 0x75e5d000      C:\WINDOWS\system32\SXS.DLL
    0x75e60000 - 0x75e87000      C:\WINDOWS\system32\apphelp.dll
    0x4dc30000 - 0x4dc5e000      C:\WINDOWS\system32\msctfime.ime
    0x4b0d0000 - 0x4b395000      C:\WINDOWS\system32\xpsp2res.dll
    0x71bb0000 - 0x71bb9000      C:\WINDOWS\system32\WSOCK32.dll
    0x4bbe0000 - 0x4bbea000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\ClearTranProxy.dll
    0x745e0000 - 0x7489e000      C:\WINDOWS\system32\msi.dll
    0x71c40000 - 0x71c97000      C:\WINDOWS\system32\NETAPI32.dll
    0x4bc50000 - 0x4bc6c000      C:\WINDOWS\system32\DBNETLIB.DLL
    0x71f60000 - 0x71f64000      C:\WINDOWS\system32\security.dll
    0x76c90000 - 0x76cb7000      C:\WINDOWS\system32\msv1_0.dll
    0x76cf0000 - 0x76d0a000      C:\WINDOWS\system32\iphlpapi.dll
    0x761b0000 - 0x76243000      C:\WINDOWS\system32\crypt32.dll
    0x76190000 - 0x761a2000      C:\WINDOWS\system32\MSASN1.dll
    0x4bcf0000 - 0x4bcff000      C:\Program Files\Common Files\System\Ole DB\SQLOLEDB.RLL
    0x4a8a0000 - 0x4a8aa000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\MIGI.DLL
    0x73570000 - 0x736c2000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\MSVBVM60.DLL
    0x4a950000 - 0x4a9e2000      C:\Program Files\Common Files\System\ado\msado15.dll
    0x74a50000 - 0x74a6a000      C:\WINDOWS\system32\MSDART.DLL
    0x4c850000 - 0x4c8c9000      C:\Program Files\Common Files\System\Ole DB\oledb32.dll
    0x4dbb0000 - 0x4dbc1000      C:\Program Files\Common Files\System\Ole DB\OLEDB32R.DLL
    VM Arguments:
    jvm_args: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 5.5 -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\logging.properties -Djava.library.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib vfprintf -Xms512m -Xmx1024m
    java_command: <unknown>
    Launcher Type: generic
    Environment Variables:
    JAVA_HOME=C:\Program Files\Java\jdk1.6.0_07
    [error occurred during error reporting (printing environment variables), id 0xc0000005]
    --------------- S Y S T E M ---------------
    OS: Windows Server 2003 family Build 3790 Service Pack 2
    CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 7 stepping 6, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3
    Memory: 4k page, physical 2097151k(2097151k free), swap 4194303k(4194303k free)
    vm_info: Java HotSpot(TM) Client VM (10.0-b23) for windows-x86 JRE (1.6.0_07-b06), built on Jun 10 2008 01:14:11 by "java_re" with MS VC++ 7.1
    time: Mon Dec 28 15:24:00 2009
    elapsed time: 600 seconds

Maybe you are looking for

  • OID can not display some users - java.lang.ArrayIndexOutOfBoundsException:0

    We have set up AD to OID synchronization for users and groups using Import connector, and it worked fine. The users in OID can log into applications protected by OAM. But recently I found that some users that could be displayed in OID before can not

  • After updating to iOS 5.0.1, I no longer receive notifications

    So I've recently updated to iOS 5.0.1. Everything was going great until my iPod stopped giving me push notifications for an unknown reason, and soon after, iMessages stopped sending/receiving messages. I've tried turning off apps in the notification

  • More and more money every month

    Been having problems with BT account for months now tried to set up a direct debit as had a problem with bank account and had to cancel and re set up, every time I try this it tells me I need to make a payment first which I do, this was £73 the first

  • Reinstalation does not work

    Hi, When I did buy my computer it came with Mac Os X 10,4 But feel weeks later came out the new Os10,5 And the strore gave me the Dvd upload. So I was Running if Mac Os 10.5 The problem came today when I tryed to reinstall every thing. Whit the updat

  • OTM can not open attachment with Word Document(*.docx)

    With more and more use of Word Document(*.docx) (version 2007). OTM (Oracle Test Manager) can create an attachment with it, but can not open attachment with Word Document(*.docx). Is this a problem for anyone else? Any wok around? Thanks Katherine