Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Java - COM DLL

Posted on 2000-03-10
5
Medium Priority
?
591 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 150 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

715 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