Solved

RMI Applet/server communication and connecting to a database

Posted on 2002-04-20
9
230 Views
Last Modified: 2013-12-29
I am using RMI between an applet and a server. The RMI server is located on a machine called sun4 and part of what I needed to do was to allow a user to query, through the applet in a browser , a database located on another machine called macneill.

I kept getting security exceptions and couldn't understand why.  Eventually on "guess" advice from someone who suggested that the problem might be the second connection (ie the connection to macneill) since an applet can only connect to a server from which it is downloaded.

I relocated my RMI server to macneill and sure enough all is working. I don't understand why this should be.  This implies that the applet was trying to connect to macneill but I understood the whole point of RMI was that the server would carry out such connections and therefore working around the problem of an applet not being able to make a separate connection.

Why should it be a problem for the server to connect to a separate machine? Was I doing something wrong or is this to be expected? Unfortunately I need to clarify this for a detailed write up on the project

any help would be really appreciated.
thanks
Liz
0
Comment
Question by:Cleare
9 Comments
 
LVL 92

Expert Comment

by:objects
Comment Utility
Liz,

Were you making your db queries thry the RMI server, or were you making them directly? If you're making them directly then RMI is not even involved.
0
 

Author Comment

by:Cleare
Comment Utility
All the code to submit the queries was in the Implementation which admittedly was a separate class to the Server.  How could RMI not be involved if i have a server, client and have rmi compiled them?  
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
RMI is only used to talk to the RMI server.
JDBC and RMI are totally unrelated.
0
 

Author Comment

by:Cleare
Comment Utility
i know they're unrelated but the problem is why can the server not carry out the JDBC stuff from a machine that is not necessarily the same machine as where the databse is?  I don't want or need the applet to connect directly to the database I understood that all that could be done on the server side.

What has happened implies to me that the implementation code is downloaded to the applet as well as the appletcode.  This would raise the problem that the applet cannot talk both to the server on one machine and the databse on another machine.

Is this the way RMI is supposed to work?

I thought the point of it was that the real implementation was carried out on the server side therefore eliminating any problems with the applet trying to connect to more than one machine.

I'm need to establish exactly where the implementation is being carried out.  Is it on the machine the applet is being downloaded to or is it on the server regardless of where the applet is?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 92

Expert Comment

by:objects
Comment Utility
Are your JDBC calls being made by the applet or the RMI server?
0
 

Author Comment

by:Cleare
Comment Utility
All the JDBC code is in the server.  But now that you say it the methods that contain all the JDBC stuff are called on the interface in the applet.

For example the applet would contain the following:

private SInterface interface;
...
//set up GUI
//take in headword parameter from user
...

interface.findword(headword);

The method findword(String headword) is in the Implemetation and contains JDBC code.

I have 4 principle classes: the Server, the Implemetatio (all JDBC code is in here) the Interface and the applet.

I understood that calling those methods on an object of the interface means that they methods aren't beinng carried out on the applet side but remotely i the server.  Am I understanding that correctly?

thanks for replying so often this is really important....
Liz


0
 
LVL 92

Expert Comment

by:objects
Comment Utility
Can you post the stack trace for the security exception uo are getting.
0
 
LVL 9

Expert Comment

by:Venci75
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
PAQ'd and pts removed
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venci75
EE Cleanup Volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
Comment Utility
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.

772 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

10 Experts available now in Live!

Get 1:1 Help Now