my dog learned polymorphism
The moose likes Sockets and Internet Protocols and the fly likes Carls   Trusiak -post  Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "Carls   Trusiak -post  " Watch "Carls   Trusiak -post  " New topic
Author

Carls Trusiak -post

sunil choudhary
Ranch Hand

Joined: Nov 10, 2000
Posts: 138

while I was trying to run Carls post at http://www.javaranch.com/ubb/Forum8/HTML/000181.html
I did get the MyServer and MyClient working but the client catches an exception while running this is how I went about ----
First I run the MyServer.java // o/p-server listening to port 2000
then I run MyClient //the appletviewer window does show two textfields and a connect button.
I fill a garbage value in empty textfield
and press contect
the client is giving a Null pointer exception.
Can Carl or someone else may point out what am I doing wrong??
Please ...
Sunil
(if you wish, I can send you the code by mail.)


----------------------------------<br />"Learning is weightless, a treasure you can always carry easily."<br />-Chinese Proverb
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
You have to run this using a browser. AppletViewer doesn't implement the CodeBase so, the getCodeBase() causes a null pointer exception.
If you wish to use appletviewer, get the IP address where you are runnung the server app and replace the call to getCodeBase with that. If your running it on the same machine, it's usually 127.0.0.1

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: Carls Trusiak -post
 
Similar Threads
A good site to find White Papers???
Applet can make Socket Connection.
deploying using weblogic 5.1
Thread processing
change it into frame, kindly see the source code.