All Examples COM Examples
This package uses a DLL file to illustrate how to invoke COM objects using
the WebLogic COM Compiler.
- public class ServerSideDLLClient
- extends Object
Included in this package is the beeper.dll file. The beep()
method of this DLL causes the host computer to beep.
The WebLogic COM compiler is used to generate the necessary
Java classes from the COM object. The generated implementation
class is then deployed as a startup class in your WebLogic Server. Once the
COM object is compiled and deployed, it becomes accessible from the network to
any client via any of WebLogic's supported protocols. In this example, a simple
Java client looks up the deployed beeper object and invokes the beep() method, causing
the server computer to beep.
Build the example:
Configure the server:
Make sure that Microsoft SDK 3.1 (or later) for Java is installed and set
up a development shell to use the Miscrosoft SDK, as described in
Place beeper.dll in a directory that is in the PATH of the WebLogic Server process.
This can be any directory that is listed in the PATH variable in the Environment tab of the
System Properties dialog. For this example, you place beeper.dll in
the "c:\winnt\" directory.
Compile beeper.dll using the WebLogic COM compiler with the following command.
This is a single command and should be typed on one command line.
$ jview weblogic.comc -nothreads -register c:\winnt\beeper.dll
In the above command, the
indicates that this DLL is not
multithreaded. The -register option registers the DLL with Windows.
Place the resulting classes, weblogic.com.beeper.Beeper,
weblogic.com.remote.beeper.Uitilities and their associated directory structure
into the weblogic\myserver\serverclasses
Compile the ServerSideDLLClient.java file as shown in this example for Windows NT.
$ jvc /d %CLIENT_CLASSES% ServerSideDLLClient.java
Run the example:
Add an entry for the beeper implementation class to the weblogic.properties file.
The following entry registers the implementation class
to become available at startup and binds the object in the WebLogic registry to the
Start the WebLogic Server using the Microsoft JVM (JView) in a new command shell.
In your development shell, start the client application using the following command.
$ jview examples.com.ServerSideDLLClient t3://hostname:port
If the argument is ommitted, "t3://localhost:7001" is assumed. If the machine
hosting WebLogic Server does not beep, you may need to turn up the volume settings on
- Host name of the WebLogic Server
- Port where the WebLogic Server is listening for connections
- Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.
- Runs this examle from the command line.
public static void main(String args)
- Runs this example from the command line.
All Examples COM Examples