You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Scott Moore <sc...@netdecide.com> on 2001/10/07 17:28:24 UTC

Fatal Error using Batik in a Servlet

I'm using Batik in a Servlet to create images on the fly using SVG.  Using
the transcoders (specifically the JPEG), I create a JPEG image and directly
write that image to the servlet response output stream.  This all works fine
until a socket closes prematurely.

Unfortunately, sockets close prematurely all the time in browsers if you
click off the page before the image is finished rendering.  Sometimes I just
get a socket closed exception from the code and everything continues on
fine.  Unfortunately, all too often, I get this:


Exception in thread "Thread-8" java.net.SocketException: Connection reset by
pee
r: socket write error
        at java.net.SocketOutputStream.socketWrite(Native Method)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:83)
        at
org.apache.tomcat.service.http.HttpResponseAdapter.endHeaders(HttpRes
ponseAdapter.java:124)
        at
org.apache.tomcat.core.BufferedServletOutputStream.sendHeaders(Buffer
edServletOutputStream.java:126)
        at
org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush(Buffer
edServletOutputStream.java:236)
        at
org.apache.tomcat.core.BufferedServletOutputStream.write(BufferedServ
letOutputStream.java:185)
        at sun.awt.image.codec.JPEGImageEncoderImpl.writeJPEGStream(Native
Metho
d)
        at
sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.
java:475)
        at
sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.
java:231)
        at
sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.
java:238)
        at
org.apache.batik.transcoder.image.JPEGTranscoder.writeImage(JPEGTrans
coder.java:72)
        at
org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTran
scoder.java:260)
        at
org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstra
ctTranscoder.java:126)
        at com.netdecide.graphic.Chart.createJPEG(Chart.java:166)
        at
com.netdecide.graphic.xbeans.ChartXbean.createImage(ChartXbean.java:4
1)
        at com.netdecide.graphic.GraphicServer.doGet(GraphicServer.java:78)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:4
05)
        at org.apache.tomcat.core.Handler.service(Handler.java:287)
        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372
)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.
java:812)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:758
)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnectio
n(HttpConnectionHandler.java:213)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:
416)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java
:501)
        at java.lang.Thread.run(Thread.java:484)
org.apache.batik.transcoder.TranscoderException: null
Enclosed Exception:
null
Enclosed Exception:
reading encoded JPEG Stream
2001-10-07 11:22:53 - Ctx( /GraphicServer ): IOException in:
( /GraphicServer +
 /graphic + null) Connection reset by peer: socket write error
Exception in thread "Thread-10" java.net.SocketException: Connection reset
by pe
er: socket write error
        at java.net.SocketOutputStream.socketWrite(Native Method)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:83)
        at
org.apache.tomcat.service.http.HttpResponseAdapter.endHeaders(HttpRes
ponseAdapter.java:124)
        at
org.apache.tomcat.core.BufferedServletOutputStream.sendHeaders(Buffer
edServletOutputStream.java:126)
        at
org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush(Buffer
edServletOutputStream.java:236)
        at
org.apache.tomcat.core.BufferedServletOutputStream.write(BufferedServ
letOutputStream.java:185)
        at sun.awt.image.codec.JPEGImageEncoderImpl.writeJPEGStream(Native
Metho
d)
        at
sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.
java:475)
        at
sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.
java:231)
        at
sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.
java:238)
        at
org.apache.batik.transcoder.image.JPEGTranscoder.writeImage(JPEGTrans
coder.java:72)
        at
org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTran
scoder.java:260)
        at
org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstra
ctTranscoder.java:126)
        at com.netdecide.graphic.Chart.createJPEG(Chart.java:166)
        at
com.netdecide.graphic.xbeans.ChartXbean.createImage(ChartXbean.java:4
1)
        at com.netdecide.graphic.GraphicServer.doGet(GraphicServer.java:78)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
Finished
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:4
05)
        at org.apache.tomcat.core.Handler.service(Handler.java:287)
        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372
)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.
java:812)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:758
)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnectio
n(HttpConnectionHandler.java:213)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:
416)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java
:501)
        at java.lang.Thread.run(Thread.java:484)

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : unknown exception code occurred at PC=0x77fb16cc
Function name=RtlTraceDatabaseEnumerate
Library=C:\WINNT\System32\ntdll.dll

Current Java thread:
        at sun.awt.image.codec.JPEGImageEncoderImpl.writeJPEGStream(Native
Metho
d)
        at
sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.
java:475)
        at
sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.
java:231)
        at
sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.
java:238)
        at
org.apache.batik.transcoder.image.JPEGTranscoder.writeImage(JPEGTrans
coder.java:72)
        at
org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTran
scoder.java:260)
        at
org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstra
ctTranscoder.java:126)
        at com.netdecide.graphic.Chart.createJPEG(Chart.java:166)
        at
com.netdecide.graphic.xbeans.ChartXbean.createImage(ChartXbean.java:4
1)
        at com.netdecide.graphic.GraphicServer.doGet(GraphicServer.java:78)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:4
05)
        at org.apache.tomcat.core.Handler.service(Handler.java:287)
        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372
)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.
java:812)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:758
)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnectio
n(HttpConnectionHandler.java:213)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:
416)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java
:501)
        at java.lang.Thread.run(Thread.java:484)

Dynamic libraries:
0x00400000 - 0x00405000         C:\Program Files\jdk1.3.1_01\bin\java.exe
0x77F80000 - 0x77FFB000         C:\WINNT\System32\ntdll.dll
0x77DB0000 - 0x77E0B000         C:\WINNT\system32\ADVAPI32.dll
0x77E80000 - 0x77F35000         C:\WINNT\system32\KERNEL32.DLL
0x77D40000 - 0x77DB0000         C:\WINNT\system32\RPCRT4.DLL
0x78000000 - 0x78046000         C:\WINNT\system32\MSVCRT.dll
0x6D420000 - 0x6D4EE000         C:\Program
Files\jdk1.3.1_01\jre\bin\hotspot\jvm
.dll
0x77E10000 - 0x77E74000         C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000         C:\WINNT\system32\GDI32.DLL
0x77570000 - 0x775A0000         C:\WINNT\System32\WINMM.dll
0x6D220000 - 0x6D227000         C:\Program Files\jdk1.3.1_01\jre\bin\hpi.dll
0x6D3B0000 - 0x6D3BD000         C:\Program
Files\jdk1.3.1_01\jre\bin\verify.dll
0x6D250000 - 0x6D266000         C:\Program
Files\jdk1.3.1_01\jre\bin\java.dll
0x6D3C0000 - 0x6D3CD000         C:\Program Files\jdk1.3.1_01\jre\bin\zip.dll
0x6D340000 - 0x6D348000         C:\Program Files\jdk1.3.1_01\jre\bin\net.dll
0x75050000 - 0x75058000         C:\WINNT\System32\WSOCK32.dll
0x75030000 - 0x75043000         C:\WINNT\System32\WS2_32.DLL
0x75020000 - 0x75028000         C:\WINNT\System32\WS2HELP.DLL
0x74FD0000 - 0x74FEF000         C:\WINNT\system32\msafd.dll
0x75010000 - 0x75017000         C:\WINNT\System32\wshtcpip.dll
0x785C0000 - 0x785CC000         C:\WINNT\System32\rnr20.dll
0x77980000 - 0x779A4000         C:\WINNT\System32\DNSAPI.DLL
0x77340000 - 0x77353000         C:\WINNT\System32\iphlpapi.dll
0x77520000 - 0x77525000         C:\WINNT\System32\ICMP.DLL
0x77320000 - 0x77337000         C:\WINNT\System32\MPRAPI.DLL
0x75150000 - 0x75160000         C:\WINNT\System32\SAMLIB.DLL
0x75170000 - 0x751BF000         C:\WINNT\System32\NETAPI32.DLL
0x77BE0000 - 0x77BEF000         C:\WINNT\System32\SECUR32.DLL
0x751C0000 - 0x751C6000         C:\WINNT\System32\NETRAP.DLL
0x77950000 - 0x77979000         C:\WINNT\system32\WLDAP32.DLL
0x77A50000 - 0x77B46000         C:\WINNT\system32\OLE32.DLL
0x779B0000 - 0x77A4B000         C:\WINNT\system32\OLEAUT32.DLL
0x773B0000 - 0x773DE000         C:\WINNT\System32\ACTIVEDS.DLL
0x77380000 - 0x773A2000         C:\WINNT\System32\ADSLDPC.DLL
0x77830000 - 0x7783E000         C:\WINNT\System32\RTUTILS.DLL
0x77880000 - 0x7790D000         C:\WINNT\System32\SETUPAPI.DLL
0x77C10000 - 0x77C6D000         C:\WINNT\System32\USERENV.DLL
0x774E0000 - 0x77512000         C:\WINNT\System32\RASAPI32.DLL
0x774C0000 - 0x774D1000         C:\WINNT\System32\RASMAN.DLL
0x77530000 - 0x77552000         C:\WINNT\System32\TAPI32.DLL
0x77B50000 - 0x77BD9000         C:\WINNT\system32\COMCTL32.DLL
0x77C70000 - 0x77CBA000         C:\WINNT\system32\SHLWAPI.DLL
0x77360000 - 0x77379000         C:\WINNT\System32\DHCPCSVC.DLL
0x775A0000 - 0x77625000         C:\WINNT\System32\CLBCATQ.DLL
0x777E0000 - 0x777E8000         C:\WINNT\System32\winrnr.dll
0x6D020000 - 0x6D128000         C:\Program Files\jdk1.3.1_01\jre\bin\awt.dll
0x77800000 - 0x7781D000         C:\WINNT\System32\WINSPOOL.DRV
0x75E60000 - 0x75E7A000         C:\WINNT\System32\IMM32.dll
0x6D1E0000 - 0x6D21B000         C:\Program
Files\jdk1.3.1_01\jre\bin\fontmanager
.dll
0x72800000 - 0x72846000         C:\WINNT\System32\DDRAW.dll
0x728A0000 - 0x728A6000         C:\WINNT\System32\DCIMAN32.dll
0x69000000 - 0x691A6000         C:\WINNT\System32\atio2kai.dll
0x63000000 - 0x63014000         C:\WINNT\System32\SynTPFcs.dll
0x77820000 - 0x77827000         C:\WINNT\system32\VERSION.dll
0x759B0000 - 0x759B6000         C:\WINNT\system32\LZ32.DLL
0x6D190000 - 0x6D1B2000         C:\Program
Files\jdk1.3.1_01\jre\bin\dcpr.dll
0x6D160000 - 0x6D183000         C:\Program Files\jdk1.3.1_01\jre\bin\cmm.dll
0x6D2C0000 - 0x6D2DB000         C:\Program
Files\jdk1.3.1_01\jre\bin\jpeg.dll
0x77920000 - 0x77943000         C:\WINNT\system32\imagehlp.dll
0x72A00000 - 0x72A2D000         C:\WINNT\system32\DBGHELP.dll
0x0D980000 - 0x0D98B000         C:\WINNT\System32\PSAPI.DLL

Local Time = Sun Oct 07 11:22:54 2001
Elapsed Time = 27
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.3.1_01 mixed mode)
#
# An error report file has been saved as hs_err_pid2176.log.
# Please refer to the file for further information.
#




I'm running Tomcat 3.2.3 with Java 1.3.1_01.  Windows 2000, SP2.  Internet
Explorer 5.0.

Obviously the whole VM crashes and the Servlet goes down.  Not a good thing
for a server.  Does anyone have any suggestions?

Thanks,
Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: Fatal Error using Batik in a Servlet

Posted by Thierry Kormann <tk...@ilog.fr>.
On Sunday 07 October 2001 17:28, Scott Moore wrote:
> I'm using Batik in a Servlet to create images on the fly using SVG.  Using
> the transcoders (specifically the JPEG), I create a JPEG image and directly
> write that image to the servlet response output stream.  This all works
> fine until a socket closes prematurely.
>
> Unfortunately, sockets close prematurely all the time in browsers if you
> click off the page before the image is finished rendering.  Sometimes I
> just get a socket closed exception from the code and everything continues
> on fine.  Unfortunately, all too often, I get this:
>

Do you still have the bug with batik1-1 ?
Does the bug appear when rasterizing SVG images in PNG instead of JPG ?

Thierry.



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org