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 Giampaolo Tomassoni <g....@libero.it> on 2004/11/08 11:29:06 UTC

InternalError (Bug?)

Dears,

back again for a problem of mine. This time, however, I have the feeling to 
have discovered a bug.

I'm using batik to convert svg files to bitmap on the fly in a tomcat 
application. The tomcat application is supposed to run in a server under an 
environment which is detached from any X11 server eventually running.

When I try my tomcat app from the debugger I use, which starts tomcat in the 
same session of the debbugger graphical console, everything works fine.

Deploying the app to the final server, I get the exception you can see at the 
end of this message.

The matter is that batik tries to access an GraphicsEnvironment which is 
unexistant in a detached server environment.

Question: Am I completely wrong when I assume that batik is supposed to run on 
services?

Regards,

	Giampaolo Tomassoni


java.lang.InternalError: Can't connect to X11 window server using ':0.0' as 
the value of the DISPLAY variable.
	at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
	at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:134)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:141)
	at 
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
	at org.apache.batik.gvt.font.FontFamilyResolver.(Unknown Source)
	at org.apache.batik.bridge.FontFace.getFontFamily(Unknown Source)
	at org.apache.batik.bridge.SVGFontFace.getFontFamily(Unknown Source)
	at org.apache.batik.bridge.SVGFontUtilities.getFontFamily(Unknown Source)
	at org.apache.batik.bridge.SVGTextElementBridge.getAttributeMap(Unknown 
Source)
	at 
org.apache.batik.bridge.SVGTextElementBridge.fillAttributedStringBuffer(Unknown 
Source)
	at org.apache.batik.bridge.SVGTextElementBridge.buildAttributedString(Unknown 
Source)
	at org.apache.batik.bridge.SVGTextElementBridge.computeLaidoutText(Unknown 
Source)
	at org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(Unknown 
Source)
	at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
	at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown 
Source)
	at org.apache.batik.transcoder.image.ImageTranscoder.transcode(Unknown 
Source)
	at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown 
Source)
	at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown 
Source)
	at it.myorg.MyConverter.doImageGet(MyConverter.java:239)


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


Re: InternalError (Bug?)

Posted by Giampaolo Tomassoni <g....@libero.it>.
On Monday 08 November 2004 11:40, Jorg Heymans wrote:
> You need to run your java app in headless mode. For tomcat this means
> you should export env variable CATALINA_OPTS=-Djava.awt.headless=true
> and restart the container.

It works, Jorg. Didn't know of a headless setting in awt...

Thank very much,

	Giampaolo

>
> Giampaolo Tomassoni wrote:
> > Dears,
> >
> > back again for a problem of mine. This time, however, I have the feeling
> > to have discovered a bug.
> >
> > I'm using batik to convert svg files to bitmap on the fly in a tomcat
> > application. The tomcat application is supposed to run in a server under
> > an environment which is detached from any X11 server eventually running.
> >
> > When I try my tomcat app from the debugger I use, which starts tomcat in
> > the same session of the debbugger graphical console, everything works
> > fine.
> >
> > Deploying the app to the final server, I get the exception you can see at
> > the end of this message.
> >
> > The matter is that batik tries to access an GraphicsEnvironment which is
> > unexistant in a detached server environment.
> >
> > Question: Am I completely wrong when I assume that batik is supposed to
> > run on services?
> >
> > Regards,
> >
> > 	Giampaolo Tomassoni
> >
> >
> > java.lang.InternalError: Can't connect to X11 window server using ':0.0'
> > as the value of the DISPLAY variable.
> > 	at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
> > 	at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:134)
> > 	at java.lang.Class.forName0(Native Method)
> > 	at java.lang.Class.forName(Class.java:141)
> > 	at
> > java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironm
> >ent.java:62) at org.apache.batik.gvt.font.FontFamilyResolver.(Unknown
> > Source) at org.apache.batik.bridge.FontFace.getFontFamily(Unknown Source)
> > at org.apache.batik.bridge.SVGFontFace.getFontFamily(Unknown Source) at
> > org.apache.batik.bridge.SVGFontUtilities.getFontFamily(Unknown Source) at
> > org.apache.batik.bridge.SVGTextElementBridge.getAttributeMap(Unknown
> > Source)
> > 	at
> > org.apache.batik.bridge.SVGTextElementBridge.fillAttributedStringBuffer(U
> >nknown Source)
> > 	at
> > org.apache.batik.bridge.SVGTextElementBridge.buildAttributedString(Unknow
> >n Source)
> > 	at
> > org.apache.batik.bridge.SVGTextElementBridge.computeLaidoutText(Unknown
> > Source)
> > 	at
> > org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(Unknown
> > Source)
> > 	at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
> > 	at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
> > 	at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
> > 	at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
> > 	at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
> > 	at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown
> > Source)
> > 	at org.apache.batik.transcoder.image.ImageTranscoder.transcode(Unknown
> > Source)
> > 	at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown
> > Source)
> > 	at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown
> > Source)
> > 	at it.myorg.MyConverter.doImageGet(MyConverter.java:239)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org


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


Re: InternalError (Bug?)

Posted by Jorg Heymans <jh...@domek.be>.
You need to run your java app in headless mode. For tomcat this means 
you should export env variable CATALINA_OPTS=-Djava.awt.headless=true
and restart the container.


Giampaolo Tomassoni wrote:
> Dears,
> 
> back again for a problem of mine. This time, however, I have the feeling to 
> have discovered a bug.
> 
> I'm using batik to convert svg files to bitmap on the fly in a tomcat 
> application. The tomcat application is supposed to run in a server under an 
> environment which is detached from any X11 server eventually running.
> 
> When I try my tomcat app from the debugger I use, which starts tomcat in the 
> same session of the debbugger graphical console, everything works fine.
> 
> Deploying the app to the final server, I get the exception you can see at the 
> end of this message.
> 
> The matter is that batik tries to access an GraphicsEnvironment which is 
> unexistant in a detached server environment.
> 
> Question: Am I completely wrong when I assume that batik is supposed to run on 
> services?
> 
> Regards,
> 
> 	Giampaolo Tomassoni
> 
> 
> java.lang.InternalError: Can't connect to X11 window server using ':0.0' as 
> the value of the DISPLAY variable.
> 	at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
> 	at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:134)
> 	at java.lang.Class.forName0(Native Method)
> 	at java.lang.Class.forName(Class.java:141)
> 	at 
> java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
> 	at org.apache.batik.gvt.font.FontFamilyResolver.(Unknown Source)
> 	at org.apache.batik.bridge.FontFace.getFontFamily(Unknown Source)
> 	at org.apache.batik.bridge.SVGFontFace.getFontFamily(Unknown Source)
> 	at org.apache.batik.bridge.SVGFontUtilities.getFontFamily(Unknown Source)
> 	at org.apache.batik.bridge.SVGTextElementBridge.getAttributeMap(Unknown 
> Source)
> 	at 
> org.apache.batik.bridge.SVGTextElementBridge.fillAttributedStringBuffer(Unknown 
> Source)
> 	at org.apache.batik.bridge.SVGTextElementBridge.buildAttributedString(Unknown 
> Source)
> 	at org.apache.batik.bridge.SVGTextElementBridge.computeLaidoutText(Unknown 
> Source)
> 	at org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(Unknown 
> Source)
> 	at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
> 	at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
> 	at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
> 	at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
> 	at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
> 	at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown 
> Source)
> 	at org.apache.batik.transcoder.image.ImageTranscoder.transcode(Unknown 
> Source)
> 	at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown 
> Source)
> 	at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown 
> Source)
> 	at it.myorg.MyConverter.doImageGet(MyConverter.java:239)


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