Solved

Java - COM DLL

Posted on 2000-03-10
5
582 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now