HELP: Running Applications that use OLE/ActiveX through JAVA
I'm developping testing software that mostly involves automation. Although I would prefer to write all the testing code myself, I have been asked to use some existing utilities. One of these utilities runs some database queries and then creates a COM object for the program I'm supposed to test. I calls a method in that program ( that performs an action on some databases ), and then exits. The utility is a very simply exe. When I run the utility from the command line, it starts a thread that runs for about 10 seconds, after which it is finished and the thread exits.
Now, I have a testing suite program that's built with Java. I've tried to have the program call the utility through Runtime.getRuntime().exec(...), but when I do this, the utility never terminates. I can see CPU usage spike and then go flat. The utility process is still running in Task Manager, and it isn't until I reset the virtual machine or exit my program that the process spikes CPU usage again (it writes the changes to the database) and finally terminates.
I've had this problem a few times before. I'll have an exe that uses some sort of automation through COM objects, and whenever I try to run that exe from Java, it chokes and never finishes. Do I have to register my Java program somehow? Maybe change a setting in Windows?
OS: Windows 2000
Java Version: 1.5.0_06
I don't know if this matters or not, but I have used a Java-COM bridge called JACOB to do automation from Java, and whenever I do it straight from Java using JACOB (instead of an exe), the automation works perfectly fine. It's only when I use the middle-man exe that things go wrong.