Steven Johnson

Greenhorn
+ Follow
since Jul 25, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Steven Johnson

I've been in the same boat - a lot of the tutorials seem to overcomplicate things. They add unnecessary features that obscure the basic functionality.

When you are ready to try the next step, such as a simple chat server, I'd recommend this tutorial:

RMI Chat tutorial

It is dead simple, explains things clearly, and has the bonus of showing how the server gets to communicate back to the client using the client's own remote methods. Plus it worked - although I did need to add the "anything goes" security policy from the Sun tutorial, in the server startup command.
18 years ago
Thanks for the feedback!

I got the connection working finally. The info on how to view the java Console was a great help, thanks.

I'm seeing some differences between IE and the other browsers I'm testing with, but I'm not going to ask for help on that until I've had some more time to experiment. (I only get abot 30 minutes a day to work this issue, so it takes me a while to get anywhere).

Thanks for all the suggestions!
18 years ago
Thanks for the feedback!

Yes, I eventually figured out I wasn't supposed to set up a SecurityManager in an applet. I've made more progress, but I must still be missing something wrt security. I am using a policy that leaves everything open (for testing only, of course) and I find that some clients can run the applet and access the remote methods, and others can't. This is with java enabled on all clients.

I hope I'm doing something wrong, because if RMI is really this flakey i've wasted a lot of work.

Here are the relevant sections of the code I am using for a simple chat server.

When I run it, I do the usual rmi registry command, and start the server with this command:



Does anyone see an obvious blunder?

Thanks,
18 years ago
It occurs to me that if I'm going to ask for some help I ought to provide some code detailing the problem.

I've got a server that includes this security code as the first lines in the main method:



When run the applet which tries to access the server, I get this error:



So I'm guessing my applet is having trouble accessing the server, but what I don't know is how to set up the secueity in the server? or in the applet? to allow access.

Any suggestions?

Thanks,
18 years ago
Hi - I'm working through an OLD RMI example of a chat window, running from an applet and communicating back to the server

(http://webmonkey.wired.com/webmonkey/97/28/index2a.html?tw=programming)

and it runs fine on my own machine -- I can start up several different browser windows (using my sever IP address, not localhost), type in text, and see it show up on all the other chat windows. However, it doesn't work from remote machiines. It looks like the connection is not getting back to the server running on my machine.

I know there is supposed to be some sort of security setting, but I'm not sure how to set it. As I mentioned, this is an OLD example and doesn't cover security save to say there is a way to set it. I checked Sun's documentation, but didn't find what I needed.

Any suggestions - or suggestions for a good tutorial?

thanks,
18 years ago
Thanks for the feedback!

No, I had no particular reason to use RMI, except that I thought it would be the easiest way to pass custom objects from the game code running on the server to the JApplet GUI. If I can do the same thing with a socket or URL connection that is fine with me. And if RMI slows performance, I don't want to use it.

One more elementary question, if you don't mind - I'm a bit confused about the JApplet code. Assume the JApplet html file, and the JApplet class file, is hosted on the webspace provided by my ISP.

Then, the JApplet code, when it tries to make a connection to my PC (to get to the game logic code running on my machine), has to have a hardcoded address, right? Something like



The problem with this is that I don't have a permanent IP address for my machine. I get a new IP address from my ISP every time I start up. So wouldn't I have to recode that hardcoded IP address and redeploy the compiled applet code to my ISP webspace every time? Or am I missing something obvious?

Maybe I want to keep the JApplet class file on my own machine, and then use something like:

?

I'm sure this is a problem that real game programmers have solved a long time ago, but I'm new at this.

Thanks!
18 years ago
I'm an intermediate Java programmer, and I'm trying to create a fairly simple (not graphics-intensive) multi-party card game. The whole gaming environment is new to me, so please forgive the dumb questions.

My idea was to use an MVC model. The user interface would be via a JApplet, that communicated back to a server-side controller. I'm having a problem with that communication.

I originally looked into JSP and Servlets, but they only handle String data. I could live with that, but I couldn't see how to pass the data into the JApplet, in the interactive way I needed.

Then I tried Sockets, which work, but it is such a low-level interface that to pass complex data or objects across it seemed more trouble than it was worth.

I've been working on RMI tutorials for the last few days, which looks good. RMI allows me to do remote method invocations, and pass objects back and forth. But now I'm stuck, at the server implementation/security implementation point, hence my questions.

A. Is RMI a reasonable method for passing data back and forth to a server-side controller? Is there something better?

B. Does the Apache Tomcat server support RMI, or should I try to write my own server?

C. Can anyone recommend a good tutorial or book on this subject?

Thnaks!
18 years ago