Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.net.ProtocolException: Does not support output

 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i try to write the files on tomcat it gives me following exception
java.net.ProtocolException: Does not support output

My code is :
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has completely nothing to do with Tomcat. You would get exactly the same problem at all other application servers. It's just a bug in your code.

Read this how to *read* from an URL: http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html
You need to interpret "input" and "output" from *your* perspective, not from the other side.
 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your suggestion but I want to upload the file to tomcat server
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then set the output. Read the same tutorial again, but then the *writing* part.
 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now im getting java.net.SocketTimeoutException
Check this code
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic