File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes Carls   Trusiak -post  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Carls   Trusiak -post  " Watch "Carls   Trusiak -post  " New topic

Carls Trusiak -post

sunil choudhary
Ranch Hand

Joined: Nov 10, 2000
Posts: 141

while I was trying to run Carls post at
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 // 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 ...
(if you wish, I can send you the code by mail.)

"Learning is weightless, a treasure you can always carry easily." -Chinese Proverb
Carl Trusiak

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

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
I agree. Here's the link:
subject: Carls Trusiak -post
It's not a secret anymore!