Win a 3 month subscription to Marco Behler Videos this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NonWritableChannelException  RSS feed

 
Adam Chalkley
Ranch Hand
Posts: 380
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys I am getting a non writeable channel exception,I'm not too sure why I am getting this exception,can anyone see anything wrong in my code that I'm not catching?


thanks

 
Adam Chalkley
Ranch Hand
Posts: 380
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed it from  a .txt to a .dat file so example.dat but I still get the same error,I then checked to see if the example.dat file was created and it was yet it still gives me the same exception?
 
Adam Chalkley
Ranch Hand
Posts: 380
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[solved] sorry guys I should have put Output instead of Input silly me have been programming for hours today,

anyway I have a side question which I didn't really need to ask but since I'm here and if anyone see this,if anyone wants to answer it that be great

whats the difference between using these two,they both accomplish the same task so when to use one over the other?

thanks



and

 
Knute Snortum
Sheriff
Posts: 3842
91
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adam, thanks for posting your solution and for posting an SSCCE. Just two more things:

* Don't leave the catch block empty.  At least have e.printStackTrace() in it.

* Include the full error text that the SSCCE produces, like this:
 
Knute Snortum
Sheriff
Posts: 3842
91
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you like me to remove the text [solved] from your post?  People might not see you question below.  Or start a new topic.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!