BUG: Using Java Servers and DCOMLast reviewed: March 16, 1998Article ID: Q162164 |
The information in this article applies to:
SYMPTOMSThere are various problems that you may experience when you try to use an Automation Server written in Java as a DCOM server. These can include hanging, timeouts, out of memory errors, interface not found errors, and other errors. These errors are generally caused by not registering the Java COM object properly on both the client and DCOM server machines. There are several known bugs with the javareg DCOM surrogate and the DCOM configuration utility DCOMCNFG that make it difficult to set up Java DCOM servers and clients.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThis article explains how to use the COMCallingJava sample shipped with Visual J++ 1.0 and 1.1 as a DCOM server. First you should build the sample and run it as a conventional (InProcess) automation server. Do this by following the instructions outlined in the readme.html that is installed with the sample. Once you have the sample running normally, use the following steps to use the sample via DCOM. NOTE: The DCOM support now in Windows 95 and Windows NT 4.0 with Service Pack 2 and Service Pack 3 supports surrogate as part of the system, so the surrogate support with JavaReg1.0 has been dropped. JavaReg2.0 is a new tool that ships with the Microsoft SDK for Java 2.0x. This tool fixes the bugs associated with JavaReg1.0 and supports remote access to a Java/COM object using the system provided surrogate process. There is also a Knowledge Base article listed in the REFERENCES section below that discusses the use of DllSurrogate.
DCOM Client StepsFollow these steps on the client machine so that you can use the COMCallingJava sample via DCOM:
<<<<<<<<<<<<<<<<start of client side reg file>>>>>>>>>>>>>>>>> REGEDIT4 [HKEY_CLASSES_ROOT\AppID\{33B0ECE2-E706-11cf-A0C2-00AA00A71DD8}] @="Java Class: CEuclid" "RemoteServerName"="MYSERVER" [HKEY_CLASSES_ROOT\CLSID\{33B0ECE2-E706-11cf-A0C2-00AA00A71DD8}] @="Java Class: CEuclid" "AppID"="{33B0ECE2-E706-11cf-A0C2-00AA00A71DD8}" [HKEY_CLASSES_ROOT\CLSID\{33B0ECE2-E706-11cf-A0C2- 00AA00A71DD8}\Implemented Categories] [HKEY_CLASSES_ROOT\CLSID\{33B0ECE2-E706-11cf-A0C2- 00AA00A71DD8}\Implemented Categories\{BE0975F0-BBDD-11CF-97DF- 00AA001F73C1}] [HKEY_CLASSES_ROOT\Interface\{33B0ECE1-E706-11CF-A0C2-00AA00A71DD8}] @="IGCD" [HKEY_CLASSES_ROOT\Interface\{33B0ECE1-E706-11CF-A0C2- 00AA00A71DD8}\ProxyStubClsid] @="{00020420-0000-0000-C000-000000000046}" [HKEY_CLASSES_ROOT\Interface\{33B0ECE1-E706-11CF-A0C2- 00AA00A71DD8}\ProxyStubClsid32] @="{00020420-0000-0000-C000-000000000046}"<<<<<<<<<<<<<<<<end of client side reg file>>>>>>>>>>>>>>>> To use this file, copy the text to notepad and save it as CEuclidClient.reg. Double-click CEuclidClient.reg from the client machine to import the registry entries into the client machine registry. Note that this sample reg file has the "RemoteServerName" key set to "MYSERVER" (this entry is created by dcomcnfg). You can either change the MYSERVER text to the name of your DCOM server, or use the DCOMCNFG utility on the client machine to change the DCOM server name after importing the reg file.
DCOM Server StepsYou need to follow these steps on the DCOM server machine in order to use the COMCallingJava sample via DCOM. Note that the Java VM must be installed on the Server machine in order to use a Java class file as a DCOM object. The latest Java VM can be downloaded from http://www.microsoft.com/java.
Note that all of the registry modifications can be done with a setup program, or by importing a .reg file. You will still need to make sure that the CEuclid.class file that was created by Jvc.exe is copied to the java\trustlib directory (step 1). And that the euclid package created by JAVATLB exists. Here is a sample reg file that can be utilized on the DCOM server machine to enable the use of the COMCallingJava automation server via DCOM (Note that the explicit path to Javareg.exe in the LocalServer32 key below may need to be changed depending upon where you have copied Javareg.exe to on your DCOM Server machine): <<<<<<<<<<<<<<<<start of server side reg file>>>>>>>>>>>>>>>>>> REGEDIT4 [HKEY_CLASSES_ROOT\AppID\{33B0ECE2-E706-11cf-A0C2-00AA00A71DD8}] @="Java Class: CEuclid" [HKEY_CLASSES_ROOT\CLSID\{33B0ECE2-E706-11cf-A0C2-00AA00A71DD8}] @="Java Class: CEuclid" "AppID"="{33B0ECE2-E706-11cf-A0C2-00AA00A71DD8}" [HKEY_CLASSES_ROOT\CLSID\{33B0ECE2-E706-11cf-A0C2- 00AA00A71DD8}\Implemented Categories] [HKEY_CLASSES_ROOT\CLSID\{33B0ECE2-E706-11cf-A0C2- 00AA00A71DD8}\Implemented Categories\{BE0975F0-BBDD-11CF-97DF- 00AA001F73C1}] [HKEY_CLASSES_ROOT\CLSID\{33B0ECE2-E706-11cf-A0C2- 00AA00A71DD8}\InprocServer32] @="msjava.dll" "ThreadingModel"="Apartment" "JavaClass"="CEuclid" [HKEY_CLASSES_ROOT\CLSID\{33B0ECE2-E706-11cf-A0C2- 00AA00A71DD8}\LocalServer32] @="c:\\program files\\devstudio\\vj\\bin\\JAVAREG.EXE /clsid:{33B0ECE2- E706-11cf-A0C2-00AA00A71DD8} /surrogate" [HKEY_CLASSES_ROOT\Interface\{33B0ECE1-E706-11CF-A0C2-00AA00A71DD8}] @="IGCD" [HKEY_CLASSES_ROOT\Interface\{33B0ECE1-E706-11CF-A0C2- 00AA00A71DD8}\ProxyStubClsid] @="{00020420-0000-0000-C000-000000000046}" [HKEY_CLASSES_ROOT\Interface\{33B0ECE1-E706-11CF-A0C2- 00AA00A71DD8}\ProxyStubClsid32] @="{00020420-0000-0000-C000-000000000046}"<<<<<<<<<<<<<<<<<<end of client side reg file>>>>>>>>>>>>>>>>> You should now be able to run the Vbdriver.exe sample program installed with the COMCallingJava sample application on the client machine and have the CEuclid Java COM object run on the DCOM server machine (Use the Windows NT Task Manager to view the startup and shutdown of the Javareg DLL surrogate on the Server machine).
REFERENCESFor additional information on using the DllSurrogate support for Java/DCOM servers, please refer to the following Knowledge Base article:
ARTICLE-ID: Q173790 TITLE: HOWTO: Using DllSurrogate Support for Java/DCOM servers.For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, see the following page on the Microsoft Technical Support site:
http://support.microsoft.com/support/visualj/ http://support.microsoft.com/support/java/ |
Additional query words: DCOM Out of Memory
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |