Mark Winslow wrote:

Hi,

What happens when you try to get an image?  What, if
any, error messages do you get?

If you retrieve the image directly, an empty page is returned. The error log records the following exception:


DBImageViewer: could not retrieve image: java.sql.SQLException: No operations allowed after connection closed.

Connection was closed due to the following exception:

** BEGIN NESTED EXCEPTION **

java.sql.SQLException
MESSAGE: Communication link failure: java.io.EOFException, underlying cause: null


** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException
        at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1394)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1538)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1929)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1167)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1278)
        at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1224)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2244)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2192)
        at com.mysql.jdbc.Statement.executeQuery(Statement.java:1163)
        at shared.DBImageViewer.doGet(DBImageViewer.java:86)


A previous poster's suggestion that the database connection could have timed out seems like a good direction to investigate, the database is up and running because other content from the database appears on the page. However, that's from the JSPs, not from this servlet, so the DB connection in the servlet looks like the best place to start.


Thanks,


Nat.

--- Nat Titman <[EMAIL PROTECTED]> wrote:

Hi,

I'm using Tomcat 5.5.3 running as part of an Apache
webserver on Fedora Core 1.


My webapps are supported by a servlet which serves
gif images stored in a database, it's mapped to the URL pattern
/servlet/image by the following XML which is inside the <web-app> tag of
the web.xml files for two webapps, including ROOT.


<servlet>
<servlet-name>DBImageViewer</servlet-name>
<servlet-class>shared.DBImageViewer</servlet-class>
</servlet>


    <servlet-mapping>
        <servlet-name>DBImageViewer</servlet-name>
        <url-pattern>/servlet/image</url-pattern>
    </servlet-mapping>

My problem is that after leaving the webapps
overnight and returning to the site, the image servlet appears to have stopped.
While the two webapps run fine, the servlet doesn't function until
Tomcat is restarted.


Is there some setting or configuration I'm missing
which would cause the servlet to restart after it has 'idled off', or have
I put the servlet mapping in the wrong place?


Any advice would help greatly,

Thanks,


Nat.


--
Nat Titman
Developer

MitchellConnerSearson
3-5 High Pavement
The Lace Market
Nottingham  NG1 1HF
Tel +44 (0)115 959 6455
Fax +44 (0)115 959 6456
Direct +44 (0)115 959 6462
www.choosemcs.co.uk

Confidentiality: This e-mail and its attachments are intended
for the above named only and may be confidential. If they have
come to you in error you must take no action based on them,
nor must you copy or show them to anyone; please reply to this
e-mail and highlight the error.

Security Warning: Please note that this e-mail has been
created in the knowledge that Internet e-mail is not a 100%
secure communications medium. We advise that you understand
and observe this lack of security when e-mailing us.

Viruses: Although we have taken steps to ensure that this
e-mail and attachments are free from any virus, we advise that
in keeping with good computing practice the recipient should
ensure they are actually virus free.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to