Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Sockets and Internet Protocols and the fly likes  java.lang.NullPointerException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark " java.lang.NullPointerException " Watch " java.lang.NullPointerException " New topic
Author

java.lang.NullPointerException

nagraj patel
Greenhorn

Joined: Feb 16, 2013
Posts: 18
hello experts ,

I have socket related problem.
How to resolve this???


Server Thread started to listen for socket connection requests
TcpServer::Start: java.lang.NullPointerException
TcpServer::Start: java.lang.NullPointerExceptionMar 04, 2013 4:33:19 PM com.s5.server.watch724.HttpProcessMessage init
INFO: in INIT() config is=org.apache.catalina.core.StandardWrapperFacade@11498ba

TcpServer::Start: java.lang.NullPointerException
TcpServer::Start: java.lang.NullPointerException
TcpServer::Start: java.lang.NullPointerException
TcpServer::Start: java.lang.NullPointerException
TcpServer::Start: java.lang.NullPointerException


nagraj patel
Greenhorn

Joined: Feb 16, 2013
Posts: 18
nagraj patel wrote:hello experts ,

I have socket related problem.
How to resolve this???

TcpServer::TcpServer: java.net.BindException: Address already in use: JVM_Bind
Server Thread started to listen for socket connection requests
TcpServer::Start: java.lang.NullPointerException
TcpServer::Start: java.lang.NullPointerException
Mar 04, 2013 4:43:27 PM com.s5.server.watch724.HttpProcessMessage init
INFO: in INIT() config is=org.apache.catalina.core.StandardWrapperFacade@4cb73c

TcpServer::Start: java.lang.NullPointerException
TcpServer::Start: java.lang.NullPointerException
TcpServer::Start: java.lang.NullPointerException
TcpServer::Start: java.lang.NullPointerException
TcpServer::Start: java.lang.NullPointerException


Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

The stack trace will tell you what line of code is causing the exception, as well as where it was called from (and where that was called from, etc. ...). Look at that line and find out what's null. Add println() calls to help you see what values are getting shoveled around if you can't figure out the cause just by looking at your code.
nagraj patel
Greenhorn

Joined: Feb 16, 2013
Posts: 18
@Jeff Verdegan:Problem is in deploy and undeploy of application on tomcat .when I try to re deploy (Tcp Exception:null pointer exception ) coming .
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

It's impossible to tell what's causing the NPE from the information you've provided. However, this might (or might not) be related:

TcpServer::TcpServer: java.net.BindException: Address already in use: JVM_Bind

I don't know which port it's complaining about, but if you can find out--either by cranking up a log level somewhere, or changing various ports in the configuration until one works, or ... something--then fix that problem, and then try again, that may fix your other problems, or at least it will eliminate one variable.

Two other things:

1) You say it's a problem when you redeploy. So does it work the first time you deploy? If so, maybe you're doing something wrong in your redeploy, either procedure-wise or configuration-wise.

2) Does any of your app's code run, after the redeploy, or does tomcat produce the errors without even starting your app?

If the problem is around redeploying, then I would create a very tiny, simple app that does essentially nothing--maybe its doGet method just sends back "Hello World". Get that working first, and than gradually narrow the gap between the simple working app and your more complex non-working one until you find the source of the problem.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java.lang.NullPointerException
 
Similar Threads
Socket communication
parsing incoming socket stream.
reader interface, wait() then go
java.net.BindException: Address already in use
Exception in reading from a Socket