• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do I create a COM+ object with Java?

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I currently have an application which was originally written in Visual Basic using COM+. Eventually I will replace the application with a pure Java solution but for now I want to extend the application using Java and use the Java code as a COM+ object. I stumbled across the Sun ActiveX Bridge, however it did not provide example code on how to communicate between the various Java/COM objects that I will have.

For example I have an ASP page which calls a COM object, the COM object needs to communicate to another COM object how do I do that? The ActiveX Bridge Developer Guide basically states that I write a Javabean, then I jar the bean files and run packager.exe (part of the Sun JRE) to generate a DLL. Then it states that I place the DLL in a directory (for instance; COM_Bean\bin) and place the jar file into another directory (for instance; COM_Bean\lib) and register the DLL.

Can anyone help?
 
Randall Stevens
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have seen lots of examples on how to invoke COM objects from within Java and know that some vendors such as BEA have tools that support using COM objects in a Java environment. I want to be able to utilize my investment in the Java components to add functionality to a legacy COM+ application while I redesign the application.

Current configuration:
Windows 2000
256 Meg RAM
AMD 600Mhz processor
Oracle 8i database
IIS 5.0
JRE 1.4.2_07
IE 6.0
11 COM components
ODBC

Future Configuration:
Lindows
256 Meg RAM
AMD 600 Mhz processor
Oracle 8i database
JDBC
Tomcat
Netscape 7.2
JRE 1.4.2_07
J2EE
25 Javabeans (most likely will be EJBs)

I would appreciate any explanation on how to make my Java class files run as COM+ components would be helpful. I have heard of several tools to do this, however most of them were designed to run COM components in Java applications and not the other way around. JIntegra looks like it might be useful, however for my current needs it is not a cost effective solution.

SOMEBODY PLEASE HELP!!!
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Google for Java Com Bridge. There are a handful of expensive commercial solutions and a few open source and free ones. If you have the C++ chops you might want to make your own object-specific JNI interface.
 
Randall Stevens
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have looked at many of the so-called Java-COM bridges, and most of them are too expensive for the need (who can afford to spend $2000 (server license) for something that will only be needed for 6 months), do not perform in the manner I need (many are designed to allow COM objects to run in a Java container, I need to run Java objects in a COM+ environment), or they are really Java-to-Socket layers that require you to write a COM-to-Socket object to communicate.

COM+ is supposed to be language independent, however the only Java version that works with COM as far as I can tell is the Microsoft version & VM. I do not use Visual J++, nor do I wish to try to purchase a copy since Microsoft no longer supports it (which means getting them to answer any questions is impossible).

I have experience in writing JNI, I wrote a tool four years ago called JNIBuilder that would create Java/JNI code and create the C++ headers but that does not solve the problem as I would still have to write additional support code.

As I have stated I already have Java code (Javabeans) that already have the functionality that I need to add to my existing COM-based application. The objective is to be able to take the code and generate the TLB and DLL files from the Java code and get them to be able to communicate with the existing COM objects in the appropriate context. The Sun website referenced an ActiveX Bridge, but the documentation did not go into enough detail and when I followed the instructions, several of the COM object properties were not registered (such as MTS enabled, MultiUse, and Multi-Threaded Apartment). Even when I modified the registry entries with those properties I was unable to get the functionality to work. It is my understanding that the ActiveX Bridge was designed for what I am attempting to do, but I am unable to utilize it properly for eny true interfaces (I was able to get the HelloWorld example to work, but not able to get my credit-check code to work). The credit-check Javabean works fine in my Java application and in my JSP/Servlet application so I know the problem is not the Java code.

The way that particular module works is I call the credit check interface with the SSN, FirstName, Lastname and several other parameters and it calls a Web Service to communicate the data to the appropriate Credit Bureau Service, the interface will return an CreditScore object that gets passed back to the UI informing the user of the credit score.

From what I can tell, my ASP pages make the COM+ calls but I do not seem to get any interaction with the Java code. The process times out and the Java code did not log anything. I can take the same Java code and call it directly through a JSP page and I receive the credit score as well as the logging of each interaction.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

very intresting your writing, but I'm new at this area and can't help you at the moment.
May be that you can give me a short tip for my problem:
I have a java and a VB6 Program. The VB should invoke functions of Java and the other way round.
I have both Sourcecodes.

Is this possible and what would be a good solution for this.
(With JavaBeans or COM+ or CORBA...??)
 
Randall Stevens
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have a java and a VB6 Program. The VB should invoke functions of Java and the other way round. I have both Sourcecodes.
Is this possible and what would be a good solution for this.
(With JavaBeans or COM+ or CORBA...??)



Most of the tools that I have run into allow COM objects to run within the Java Application Server. I personally try to stay away from CORBA, early versions of CORBA between different languages were not always compatible and made communication unreliable. I tend to prefer using serial connections or Web services when communicating between unlike languages, but both of those add the overhead of parsing the message before processing it.
 
Tim Struppi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mean that I should use something like SOAP?
Is this the easiest way also when both programs runs at the same time on the same mashine?
The performance is no problem because I send only some data (maybe 500 Byte) and want to start methods.
Have I a security problem using SOAP?
 
Randall Stevens
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tim Struppi:
You mean that I should use something like SOAP?
Is this the easiest way also when both programs runs at the same time on the same mashine?
The performance is no problem because I send only some data (maybe 500 Byte) and want to start methods.
Have I a security problem using SOAP?



I mean that I prefer to use SOAP or a custom serial interface. You should not have a security problem with SOAP on the same system, and if you were using SOAP between multiple systems I would encrypt the data.
 
Ranch Hand
Posts: 781
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have used JACOB for simple Java-COM but I don't know if it does what you want. It must be worth a look.

http://danadler.com/jacob/
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic