This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes java.sql.SQLException: Io exception: Broken pipe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "java.sql.SQLException: Io exception: Broken pipe" Watch "java.sql.SQLException: Io exception: Broken pipe" New topic
Author

java.sql.SQLException: Io exception: Broken pipe

nir sharma
Ranch Hand

Joined: Sep 11, 2012
Posts: 72

Hi,
I have deployed a war on tomcat server, the first login screen appears without any issue but when I press 'submit' button (submit form), then I get stacktrace screen :


I'm unable to find the cause or solution. I even restarted the server couple of times but this problem still persist.
When I run the same code (from which I have made this war) through eclipse, which connect to the same database server, this page/issue doesn't occur.
Any suggestions are welcome.

nir
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
Can you post some code from your AuthorizationDAO?


Programming is about thinking, NOT coding
nir sharma
Ranch Hand

Joined: Sep 11, 2012
Posts: 72



this is some of the code in ' getDBConnection()' which return connection.



this is in my context.xml which provide connection.



hope this helps..
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi ,

Broken pipe indicates that your database connection has failed. Please check the database connection.

Regards
jatan
nir sharma
Ranch Hand

Joined: Sep 11, 2012
Posts: 72

jatan bhavsar wrote:
Broken pipe indicates that your database connection has failed. Please check the database connection.


how should I check the connection?

and as I mentioned, this problem doesn't occur when I run this using eclipse, also this problem wasn't even there till yesterday.
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Nir,

Try to check what is the difference when you are running through eclipse and tomcat server.
Are you pointing to the same tomcat when you run application through eclipse?
check for the proepr jdbc driver and jar files. Also divers are compatible or not. check is there nay network issue.
Many possibilites are there.

you can search the follwoing post with the similar issues.

thread1
thread2

Regards
Jatan
nir sharma
Ranch Hand

Joined: Sep 11, 2012
Posts: 72

Thanks for the help jatan
jatan bhavsar wrote:
Try to check what is the difference when you are running through eclipse and tomcat server.

No difference here.

jatan bhavsar wrote:
Are you pointing to the same tomcat when you run application through eclipse?

yes.

jatan bhavsar wrote:
check for the proepr jdbc driver and jar files. Also divers are compatible or not. check is there nay network issue.

Drivers and jar are same, as i have deployed many war files in the past, but never showed this problem, also this application through this specific war ran fine for 2 days.
Don't know how to check network issue.

I would like to hear out more possibilities in case this issue keep occurring, because as of now, i have removed re-deployed the same war few minutes back, and for now its working.
Hope the same problem doesn't reappear.
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Nir,

I think its the network issue .is your database on remote machine?

To check the for network issue you can ping with the IP address where your database resides.

If the network issue is there then it will give you the request time out in cmd console.

Command to ping is pint -t IP address. Open cmd and then execute ping -t IPaddress.

Regards
jatan
nir sharma
Ranch Hand

Joined: Sep 11, 2012
Posts: 72

hi jatan,

I think its the network issue .is your database on remote machine?

yes, but connected through lan.
I have already tried 'ping' and there is not problem and never was and i don't think you can detect network issue using ping (not an expert, just a thought) because few times when i have faced some network issue, 'ping' worked fine at that time.

regards
nir
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.sql.SQLException: Io exception: Broken pipe