You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Olivier Rossel <lo...@lolive.net> on 2001/10/03 19:39:16 UTC

Fixes for the X11 problem are failing!!!

Gianugo Rabellino wrote:

>Anthony,
>
>>If I manage to solve the problem, I'll get back to you, if not - has
>>
>anyone
>
>>got a solution - no way I can install X on our servers.
>>
>
>I think you'd better start with a fresh and sitemap: take out not only
>the component references (including PDF) but even the samples, since
>some of them rely on SVG.
>I hope I can find the time to write a short note about this issue.
>
>Besides, while I concur that this is an annoyance, an headeless X server
>adds little or no overhead at all to the machines. You might want to
>test an AWT version floating around (if I recall correctly it's called
>"pure Java AWT") that should not need X at all, but I'm not sure if it
>works as a drop-in replacement (using -Xbootclasspath or some trick like
>that) or if you have to change the imports and recompile.
>
******
Solution 1 : using PJA as an alternative to built-in AWT.
PJA does not require a X server to launch
***

Problem:

DEBUG   (2001-10-03) 19:24.23:382   [cocoon  ] (/cocoon/) 
Thread-17/DefaultComponentFactory: ComponentFactory creating new 
instance of org.apache.cocoon.serialization.XMLSerializer.
DEBUG   (2001-10-03) 19:24.23:382   [cocoon  ] (/cocoon/) 
Thread-17/DefaultComponentFactory: no logger attribute available, using 
standard logger
DEBUG   (2001-10-03) 19:24.23:382   [cocoon  ] (/cocoon/) 
Thread-17/PoolableComponentHandler: ComponentHandler initialized for: 
org.apache.cocoon.serialization.XMLSerializer
DEBUG   (2001-10-03) 19:24.23:383   [cocoon  ] (/cocoon/) 
Thread-17/ExcaliburComponentSelector: Adding 
org.apache.cocoon.serialization.XMLSerializer for svgxml
ERROR   (2001-10-03) 19:24.25:704   [cocoon  ] (/cocoon/) 
Thread-17/Handler: Error compiling sitemap
java.lang.ExceptionInInitializerError: java.lang.ClassCastException: 
com.eteks.java2d.PJAGraphicsEnvironment
        at java.awt.Toolkit$2.run(Toolkit.java:510)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:489)
        at java.awt.SystemColor.updateSystemColors(SystemColor.java:342)
        at java.awt.SystemColor.<clinit>(SystemColor.java:335)
        at 
org.apache.batik.css.value.DefaultSystemColorResolver.activeBorder(DefaultSystemColorResolver.java:27)
        at 
org.apache.batik.css.value.ColorFactory.<init>(ColorFactory.java:75)
        at 
org.apache.batik.css.value.CommonValueFactoryMap.<init>(CommonValueFactoryMap.java:39)
        at 
org.apache.batik.css.svg.SVGValueFactoryMap.<init>(SVGValueFactoryMap.java:39)
        at 
org.apache.batik.css.svg.SVGValueFactoryMap.<init>(SVGValueFactoryMap.java:32)
        at 
org.apache.batik.dom.svg.SVGDOMImplementation.<init>(SVGDOMImplementation.java:79)
        at 
org.apache.batik.dom.svg.SVGDOMImplementation.<clinit>(SVGDOMImplementation.java:59)
        at 
org.apache.batik.dom.svg.SAXSVGDocumentFactory.<init>(SAXSVGDocumentFactory.java:59)
        at org.apache.cocoon.xml.dom.SVGBuilder.<init>(SVGBuilder.java:44)
        at 
org.apache.cocoon.serialization.SVGSerializer.<init>(SVGSerializer.java:46)
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Class.java:237)
        at 
org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(Unknown 
Source)
        at 
org.apache.avalon.excalibur.pool.AbstractPool.newPoolable(Unknown Source)
        at 
org.apache.avalon.excalibur.pool.AbstractPool.internalGrow(Unknown Source)
        at 
org.apache.avalon.excalibur.pool.SoftResourceLimitingPool.grow(Unknown 
Source)
        at 
org.apache.avalon.excalibur.pool.SoftResourceLimitingPool.initialize(Unknown 
Source)
        at 
org.apache.avalon.excalibur.component.PoolableComponentHandler.initialize(Unknown 
Source)
        at 
org.apache.avalon.excalibur.component.ExcaliburComponentSelector.addComponent(Unknown 
Source)
        at 
org.apache.cocoon.sitemap.SitemapComponentSelector.addSitemapComponent(SitemapComponentSelector.java:91)
        at 
org.apache.cocoon.sitemap.AbstractSitemap.load_component(AbstractSitemap.java:231)
        at 
org.apache.cocoon.www.sitemap_xmap$Configurer.configSerializers(sitemap_xmap.java:1412)
        at 
org.apache.cocoon.www.sitemap_xmap.configure(sitemap_xmap.java:829)
        at 
org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(Unknown 
Source)
        at 
org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initialize(Unknown 
Source)
        at 
org.apache.cocoon.components.language.generator.GeneratorSelector.addGenerator(GeneratorSelector.java:143)
        at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.addCompiledComponent(ProgramGeneratorImpl.java:348)
        at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:183)
        at org.apache.cocoon.sitemap.Handler.run(Handler.java:208)
        at java.lang.Thread.run(Thread.java:484)


Here is the error I have when I install pja.jar in my $TOMCAT_HOME/lib, 
and launch:
java 
-Xbootclasspath/a:/usr/share/tomcat/lib/pja.jar:/usr/share/tomcat/lib/servlet.jar:/usr/share/tomcat/lib/webserver.jar:/usr/share/tomcat/lib/xerces_1_4_3.jar:/usr/share/java/servlet-2.2.jar 
-Dawt.toolkit=com.eteks.java2d.PJAGraphicsEnvironment 
-Djava2d.font.usePlatformFont=false org.apache.tomcat.startup.Tomcat 
-home /usr/share/tomcat/

******
Solution 2: removing any reference to SVG and PDF.
This should disable any call to Batik, which is the problematic library, 
requiring the X11 display
***

Removing anything concerning SVG does not solve the problem, in the 
sitemap.xmap and the WEB-INF/.
May be I missed something.
But I still have a SVGBuilder trying to instanciate a batik 
SVGDOMImplementation, which requires a X11 display.
Note that serializer related to SVG, PDF and XML are disabled!!!

DEBUG   (2001-10-03) 19:33.30:689   [cocoon  ] (/cocoon/) 
Thread-17/DefaultComponentFactory: ComponentFactory creating new 
instance of org.apache.cocoon.serialization.XMLSerializer.
DEBUG   (2001-10-03) 19:33.30:689   [cocoon  ] (/cocoon/) 
Thread-17/DefaultComponentFactory: no logger attribute available, using 
standard logger
DEBUG   (2001-10-03) 19:33.30:690   [cocoon  ] (/cocoon/) 
Thread-17/PoolableComponentHandler: ComponentHandler initialized for: 
org.apache.cocoon.serialization.XMLSerializer
DEBUG   (2001-10-03) 19:33.30:690   [cocoon  ] (/cocoon/) 
Thread-17/ExcaliburComponentSelector: Adding 
org.apache.cocoon.serialization.XMLSerializer for svgxml
ERROR   (2001-10-03) 19:33.38:640   [cocoon  ] (/cocoon/) 
Thread-17/Handler: Error compiling sitemap
java.lang.InternalError: Can't connect to X11 window server using 
'localhost:0.0' as the value of the DISPLAY variable.
        at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at 
sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:58)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:120)
        at 
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:58)
        at sun.awt.motif.MToolkit.<clinit>(MToolkit.java:57)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:120)
        at java.awt.Toolkit$2.run(Toolkit.java:498)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:489)
        at java.awt.SystemColor.updateSystemColors(SystemColor.java:342)
        at java.awt.SystemColor.<clinit>(SystemColor.java:335)
        at 
org.apache.batik.css.value.DefaultSystemColorResolver.activeBorder(DefaultSystemColorResolver.java:27)
        at 
org.apache.batik.css.value.ColorFactory.<init>(ColorFactory.java:75)
        at 
org.apache.batik.css.value.CommonValueFactoryMap.<init>(CommonValueFactoryMap.java:39)
        at 
org.apache.batik.css.svg.SVGValueFactoryMap.<init>(SVGValueFactoryMap.java:39)
        at 
org.apache.batik.css.svg.SVGValueFactoryMap.<init>(SVGValueFactoryMap.java:32)
        at 
org.apache.batik.dom.svg.SVGDOMImplementation.<init>(SVGDOMImplementation.java:79)
        at 
org.apache.batik.dom.svg.SVGDOMImplementation.<clinit>(SVGDOMImplementation.java:59)
        at 
org.apache.batik.dom.svg.SAXSVGDocumentFactory.<init>(SAXSVGDocumentFactory.java:59)
        at org.apache.cocoon.xml.dom.SVGBuilder.<init>(SVGBuilder.java:44)
        at 
org.apache.cocoon.serialization.SVGSerializer.<init>(SVGSerializer.java:46)
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Class.java:237)
        at 
org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(Unknown 
Source)
        at 
org.apache.avalon.excalibur.pool.AbstractPool.newPoolable(Unknown Source)
        at 
org.apache.avalon.excalibur.pool.AbstractPool.internalGrow(Unknown Source)
        at 
org.apache.avalon.excalibur.pool.SoftResourceLimitingPool.grow(Unknown 
Source)
        at 
org.apache.avalon.excalibur.pool.SoftResourceLimitingPool.initialize(Unknown 
Source)
        at 
org.apache.avalon.excalibur.component.PoolableComponentHandler.initialize(Unknown 
Source)
        at 
org.apache.avalon.excalibur.component.ExcaliburComponentSelector.addComponent(Unknown 
Source)
        at 
org.apache.cocoon.sitemap.SitemapComponentSelector.addSitemapComponent(SitemapComponentSelector.java:91)
        at 
org.apache.cocoon.sitemap.AbstractSitemap.load_component(AbstractSitemap.java:231)
        at 
org.apache.cocoon.www.sitemap_xmap$Configurer.configSerializers(sitemap_xmap.java:1412)



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Fixes for the X11 problem are failing!!!

Posted by Ugo Cei <u....@cbim.it>.
Olivier Rossel wrote:


> Solution 2: removing any reference to SVG and PDF.
> This should disable any call to Batik, which is the problematic library, 
> requiring the X11 display
> ***
> 
> Removing anything concerning SVG does not solve the problem, in the 
> sitemap.xmap and the WEB-INF/.
> May be I missed something.
> But I still have a SVGBuilder trying to instanciate a batik 
> SVGDOMImplementation, which requires a X11 display.
> Note that serializer related to SVG, PDF and XML are disabled!!!

Stop your servlet container, remove all work directories and restart. Be 
sure to remove any references to svg in the sitemap, besides the 
serializers there are samples referring to it.

I have C2 running on a Solaris server without any display or X server, 
using Tomcat 3.2.3, so it must work.

Solution 3: use Xvfb if it is available on your platform. I use it on my 
development Linux box because, even though I have an X11 display, 
whenever I logout the X server is restarted and Tomcat just crashes. 
Took a while to figure out why I had to restart Tomcat every morning :).

-- 
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: u.cei@cbim.it


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Fixes for the X11 problem are failing!!!

Posted by Gianugo Rabellino <gi...@rabellino.it>.
Olivier,

> ******
> Solution 1 : using PJA as an alternative to built-in AWT.
> PJA does not require a X server to launch
> ***
>
> Problem:
> java.lang.ExceptionInInitializerError: java.lang.ClassCastException:

I understand that PJA is quite old, so I'm not surprides to see this.


> ******
> Solution 2: removing any reference to SVG and PDF.
> This should disable any call to Batik, which is the problematic
library,
> requiring the X11 display
> ***
>
> Removing anything concerning SVG does not solve the problem, in the
> sitemap.xmap and the WEB-INF/.
> Note that serializer related to SVG, PDF and XML are disabled!!!

Doesn't look like that:
> Thread-17/Handler: Error compiling sitemap
> java.lang.InternalError: Can't connect to X11 window server using
> 'localhost:0.0' as the value of the DISPLAY variable.
[...]
>
org.apache.batik.dom.svg.SAXSVGDocumentFactory.<init>(SAXSVGDocumentFact
ory.java:59)
>         at
org.apache.cocoon.xml.dom.SVGBuilder.<init>(SVGBuilder.java:44)
>         at
>
org.apache.cocoon.serialization.SVGSerializer.<init>(SVGSerializer.java:
46)

Here an SVG serializer is instantiated, and this causes the problem.
Since "svg2jpeg" is next to the latest one who was instantiated
correctly in the default sitemap, can you please double check that you
removed that one too?

I'll do some tests tomorrow too, and let you know.

Ciao,

--
Gianugo Rabellino


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>