File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Carls   Trusiak -post  " Watch "Carls   Trusiak -post  " New topic
Author

Carls Trusiak -post

sunil choudhary
Ranch Hand

Joined: Nov 10, 2000
Posts: 141


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.)


"Learning is weightless, a treasure you can always carry easily." -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
 
GeeCON Prague 2014
 
subject: Carls Trusiak -post