Solved

Java - COM DLL

Posted on 2000-03-10
5
587 Views
Last Modified: 2008-02-26
Developing an javaApplet(s) which invokes com DLL (Developed using VJ++)
every thing works fine on a single machine. We want that application to be accessed over the intranet so we put all the applets classes(Zipped) and HTML files in the IIS
InetPub/WWWRoot directory and set all the necessary system(Environmental) variables (ie the classpath) and registered the Dll in the NT Server. It is working in the Server.

Now when type the index page of this application from an browser(IE) within our network the page loads the login applet, but after entering username password and pressing ok it fails (In ok
actionevent we are accessing the com dll which does all the dATabase validation and others) the actual error in the console is

com.ms.com.ComError: Failed creation of datastorecomp/UserStoreClass because CoCreateInstance of CLSID {0A4E7845-F506-11D3-94E3-0050BAD6948F} failed: Class not registered  

But when you register those required dlls in the client machine it works fine.
Do we have to put and register all the dlls in all the machines ??
Or any other way out ..
Do we have to configure something in the server or necessarily have to put the dlls in the MTS or ???
Please be in detail as I'm very new to these fields. Hoping for a "DETAILED"
earlier replies.
Thanks
0
Comment
Question by:hariharann
  • 2
  • 2
5 Comments
 
LVL 16

Expert Comment

by:heyhey_
ID: 2604126
>> Do we have to put and register all the dlls in all the machines ??


yes.

btw. this is COM / Windows question (not a Java one) - you'd better repost it on some other forum
0
 
LVL 2

Expert Comment

by:muraliram
ID: 2604155
dear hariharann,

Since you are using applets to do the validation and since you are using the com dll you should register the dll in all the machine. Since this is done in Intranet this will be easy to do.It  should be registered. Another way is you can use the servlet or asp to do the validation and pass the result back to the client so that the dll should be registerd only in the server. I think there is no other way. Another way is you should check for the comm dll in the client machine and if it is not there you should download it from the server and then do the validation. But this is time consuming and u need signed applets to access the client machine. What I understood is its better to register the dll in all the machines since it is intranet. If you have further doubts (including using  signed applets) please tell me. i will help you.

Bye..all the best

Murali

0
 

Author Comment

by:hariharann
ID: 2604242
Thanks muraliram & HeyHey!!!
            Registering the Dlls in all the machines is okay within the Intranet,consider if we deceide to go over the internet!! Where does DCom play in this! Anyhow if you can say how to detect whether the Dll is there in or not in the Client machine and how to download it in the machine and then Register it also...
Since this is within the intranet hope this won't be timeconsuming.
Any help (With some code..)
Thanks!

0
 

Author Comment

by:hariharann
ID: 2604253
Hello Muraliram!
 Thanks! Yes I would like to know more about applet security and signing, like how to give extra access feature if the applet is from an known source or so...
0
 
LVL 2

Accepted Solution

by:
muraliram earned 50 total points
ID: 2604613
Dear Hariharan,

        I don't know much about Dcom. But I can tell you ow to sign an applet and how to detect a particular dll.
You should sign the applet for both IE and Netscape seperately. Since you are using it in the Intranet you can probable do this with a test certificate.However if you want to use it in a commercial environment you should get a certificate from an authority. However you should follow the links below to know how to sign an applet.

www.ddj.com/articles/1999/9902/9902h/9902.htm

www.suitable.com/CodeSigningBoth.shtm

www.suitable.com/CodeSigningCerts.shtml

www.suitable.com/CodeSigningSignExp.shtml
www.suitable.com/CodeSigningSignNav.shtml

Also inorder to know whether a dll is registered you can use the following code after signing the applet

com.ms.security.PolicyEngine.assertPermission
                     (com.ms.security.PermissionID.REGISTRY);


RegKey rkey = new RegKey(RegKey.LOCALMACHINE_ROOT,             "System\\youdllpositioninthe registry");

RegQueryInfo rq=rkey.queryInfo();

if(rq.values>0)then dll is present                  

path=rkey.getStringValue("Path");                  

Try.

All the best.
 
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SHA2 certs for IIS AND Java? 2 122
Adding multiple JVM environments to RedHat 6 7 69
Java 8 to Java 6 8 32
How to fix  socket closed error 11 27
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question