HOWTO: Using DllSurrogate Support for Java/DCOM ServersLast reviewed: January 29, 1998Article ID: Q173790 |
The information in this article applies to:
SUMMARYThis article explains how to use a Java COM object as a Distributed COM (DCOM) server using the system surrogate provided by DCOM in Windows 95 and Windows NT 4.0 with SP2 or SP3.
MORE INFORMATIONDCOM allows COM objects to be activated on remote machines. It allows clients to create and invoke the methods of objects on other machines. Java objects can be used remotely using DCOM. One way to remotely use a Java object is by using the system surrogate support (DllSurrogate) in DCOM for Windows 95 and Window NT 4.0 with SP2 or SP3 along with the Microsoft Virtual Machine (VM) for Java. JAVAREG is a tool that supports remote access to a COM class implemented in Java. It is a command-line tool that is used for registering Java classes as COM components in the registry. In fact many of JAVAREG's options are intended for use only with DCOM. The JAVAREG (version 1.0) that shipped with Microsoft Visual J++, versions 1.0 and 1.1 implemented a surrogate process itself, but it had some bugs making it difficult to set up Java DCOM servers and clients. There is also a Knowledge Base article listed in the REFERENCES Section below that addresses this problem. The DCOM support now in Windows 95 and Windows NT 4.0 with SP2 and SP3 supports a surrogate as part of the system, so the surrogate support with JAVAREG 1.0 has been dropped. JAVAREG 2.0 is a new tool that ships with SDK for Java 2.0. This tool fixes the bugs associated with JAVAREG 1.0 and supports remote access to a Java COM object using the system provided surrogate process. The following steps explain how to set up a Java/COM object as a DCOM server using the new JavaReg2.0 tool.
Server Side StepsThe following sample makes use of the AutoIDispatch mechanism where you do not need to create an IDL file for your Java COM object. This method does not require tools like JAVATLB or JACTIVEX that ship with the SDK for Java 2.0. For more information on the use of the AutoIDispatch mechanism, see the REFERENCES section below.
Client Side Steps
Other TipsWhenever you attempt to get a DCOM solution to work, it is useful to know when processes are starting and stopping on a machine. One very effective way to do this is to enable the "Process Start" and "Process Stop" sounds in the Sounds Control Panel applet. With these sounds enabled (and set to two distinguishable noises), you will be able to tell whenever a process starts or stops on your machine. This is useful in tracking down problems where DCOM's launch security has allowed a client to launch the server process, but access security is disallowing access (you'll hear the process start sound, but the client will get E_ACCESSDENIED from the activation request). Of course, this requires that your server machine have a sound card installed with appropriate drivers. Use OLEVIEW to test that your components are installed and registered correctly. Always test new components first in-process (CLSCTX_INPROC_SERVER checked in OLEVIEW), then cross-process-same-machine (CSLCTX_LOCAL_SERVER), then remotely (CLSCTX_REMOTE_SERVER with no LocalServer32 key). By doing this you reduce the number of variables (things that can go wrong) as you do your testing.
REFERENCESDownload the new SDK for Java 2.0 from http://www.microsoft.com/java/. For additional information on downloading DCOM for Windows 95, please see http://www.microsoft.com/oledev/. For additional information on the issues involved with JAVAREG 1.0's surrogate support please refer to the following Knowledge Base article:
ARTICLE-ID: Q162164 TITLE : BUG: Using Java Servers and DCOMFor additional information on the usage of AutoIDispatch mechanism, please refer to the following Knowledge Base article:
ARTICLE-ID: Q172202 TITLE : Implementing Java Automation Objects using AutoIDispatchFor 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: Java DCOM surrogate
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |