Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Null pointer Exception

Mikael Fox
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a null pointer error, don't know where it came out. Can someone check this code for me please:

The error is in the sendBytes methods, I have put a comment over there, actually there are two null errors. Line 57 and 64.



Thanks a lot in advance.

This is the code:

This is the error:

at ignisftpv3.FTPClient.sendBytes(
at ignisftpv3.FTPClientInterface.btnSendActionPerformed(
at ignisftpv3.FTPClientInterface.access$100(
at ignisftpv3.FTPClientInterface$2.actionPerformed(
at javax.swing.AbstractButton.fireActionPerformed(
at javax.swing.AbstractButton$Handler.actionPerformed(
at javax.swing.DefaultButtonModel.fireActionPerformed(
at javax.swing.DefaultButtonModel.setPressed(
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(
at java.awt.Component.processMouseEvent(
at javax.swing.JComponent.processMouseEvent(
at java.awt.Component.processEvent(
at java.awt.Container.processEvent(
at java.awt.Component.dispatchEventImpl(
at java.awt.Container.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.LightweightDispatcher.retargetMouseEvent(
at java.awt.LightweightDispatcher.processMouseEvent(
at java.awt.LightweightDispatcher.dispatchEvent(
at java.awt.Container.dispatchEventImpl(
at java.awt.Window.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.EventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForFilters(
at java.awt.EventDispatchThread.pumpEventsForFilter(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(
BUILD SUCCESSFUL (total time: 3 minutes 10 seconds)
Paul Clapham
Posts: 20945
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The pw and out variables are null because you never assign them a value. Sure, you have some code which would assign them values if it were executed, but it wasn't executed. (You can tell that because pw and out are null.)

If you look at your stderr output, you should be able to see why that code wasn't executed.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic