You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Ganesh <ga...@wipro.com> on 2003/08/26 13:21:02 UTC

Issue with SVG in Batik with FOP in SunOS (UNIX)

Dear Users,
 
Current Configuration: SunOS, Batik-1.5beta4, with Apache FOP 0.20.5.
 
I am facing a problem when I am trying to use Batik in Unix Environment,
the same SVG mark-up works well in Windows 2000. I have put just a
simple batik code which writes one text line, which fails (please see
the batik mark-up which is embedded in the FOP below). I have copied the
necessary jar files on to unix m/c. It will be great if some one could
help me out in this regard or give me direction to solve this problem. I
have already googled the the exception text below but in vain. 
 
Following is the exception trace I get.
 
 
org.w3c.dom.DOMException: The current node (type: 2, name:
contentStyleType) is
read-only.
at org.apache.batik.dom.AbstractNode.createDOMException(AbstractNode.jav
a:368)
at org.apache.batik.dom.AbstractAttr.setNodeValue(AbstractAttr.java:113)
at org.apache.batik.dom.AbstractAttr.setValue(AbstractAttr.java:177)
at org.apache.batik.dom.svg.AbstractElement$ExtendedNamedNodeHashMap.set
UnspecifiedAttribute(AbstractElement.java:238)
at org.apache.batik.dom.svg.AbstractElement.setUnspecifiedAttribute(Abst
ractElement.java:149)
at org.apache.batik.dom.svg.AttributeInitializer.resetAttribute(Attribut
eInitializer.java:94)
at org.apache.batik.dom.svg.AttributeInitializer.initializeAttributes(At
tributeInitializer.java:70)
at org.apache.batik.dom.svg.AbstractElement.initializeAttributes(Abstrac
tElement.java:115)
at org.apache.batik.dom.svg.AbstractElement.<init>(AbstractElement.java:
59)
at org.apache.batik.dom.svg.SVGOMElement.<init>(SVGOMElement.java:72)
at org.apache.batik.dom.svg.SVGStylableElement.<init>(SVGStylableElement
.java:70)
at org.apache.batik.dom.svg.SVGOMSVGElement.<init>(SVGOMSVGElement.java:
103)
at org.apache.batik.dom.svg.SVGDOMImplementation$SvgElementFactory.creat
e(SVGDOMImplementation.java:1508)
at org.apache.batik.dom.svg.SVGDOMImplementation.createElementNS(SVGDOMI
mplementation.java:255)
at org.apache.batik.dom.svg.SVGOMDocument.createElementNS(SVGOMDocument.
java:338)
at org.apache.batik.dom.svg.SVGDOMImplementation.createDocument(SVGDOMIm
plementation.java:175)
at org.apache.fop.svg.SVGElement.init(SVGElement.java:255)
at org.apache.fop.svg.SVGElement.<init>(SVGElement.java:120)
at org.apache.fop.svg.SVGElement$Maker.make(SVGElement.java:95)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:352)
at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
at org.apache.xerces.validators.common.XMLValidator.callStartElement(XML
Validator.java:1214)
at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumen
tScanner.java:1806)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.disp
atch(XMLDocumentScanner.java:1182)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)
at org.apache.fop.apps.Driver.render(Driver.java:498)
at org.apache.fop.apps.Driver.run(Driver.java:565)
at com.americanexpress.util.dg.core.FOPVelocityAdapter.renderFO(FOPVeloc
ityAdapter.java:233)
at com.americanexpress.util.dg.core.FOPVelocityAdapter.renderDocument(FO
PVelocityAdapter.java:137)
at com.americanexpress.util.dg.clt.component.LocalAccessImpl.renderDocum
ent(LocalAccessImpl.java:53)
at test.SimpleTestClient.myCode(SimpleTestClient.java:83)
at test.SimpleTestClient.startTest(SimpleTestClient.java:113)
at test.TestExecutor.run(TestExecutor.java:24)
 
 
Batik mark-up:
 
 
        <svg:svg xmlns:svg=" <http://www.w3.org/2000/svg>
http://www.w3.org/2000/svg" width = "450" height="300"
content-width="scale-to-fit">
 
        <!-- Assignment Heading -->
        <svg:text style="font-size:18; text-anchor:middle" x="120"
y="20">
        </svg:text>
        <svg:text style="font-weight:bold; fill:orange;
font-family:Verdana; font-size:18;"
        x="20" y="20">
        A sample Dynamically generated graphs.
        </svg:text>

        </svg:svg>


RE: Issue with SVG in Batik with FOP in SunOS (UNIX)

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> DOMException "(The current node (type: 2, name: contentStyleType) is
> read-only)", which probably happens much earlier !? I couldn't imagine
> that this parse error happens because of the x server issue. Any
> comments?

As I said, I have no experience with the 1.3 JVM, but looked into the
apidocs for 1.3.1 and a difference with the 1.4 that caught my attention was
the absence (in 1.3) of the package 'org.w3c.dom', which is exactly the
package where the stated exception occurs. ( For 1.3 this is not a core
package )
I also read on the batik pages that batik can be compiled without DOM ( for
smaller distros ). Compare the size of batik binary distribution to the size
of the batik jar that came with fop... ( the fop lib-dir also contains the
xml-apis.jar, which contains org.w3c.dom, amongst others )

I guess we have found which library is missing or inaccessible. ( I'm
inclined to believe that this has sth to do with the fact that you used the
batik jar included with fop to run batik standalone... true? Don't know if
it works, or if it is supposed to. Do you get the same error when using the
batik distribution? )

Cheerz,

Andreas Delmelle


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


RE: Issue with SVG in Batik with FOP in SunOS (UNIX)

Posted by Ganesh <ga...@wipro.com>.
I did search google and other user group for this
"UnsatisfiedLinkError", I could get more clue that this is either of the
following problems (link given below).

A) The X server is not running.
B) The X server is running but the user does not have the permission to
access it.

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=ddc0
284c.0303222225.58be58db%40posting.google.com&rnum=4&prev=/groups%3Fq%3D
exception%2Boccurred%2Bin%2B%2BJNI_OnLoad%26hl%3Den%26lr%3D%26ie%3DUTF-8
%26oe%3DUTF-8%26selm%3Dddc0284c.0303222225.58be58db%2540posting.google.c
om%26rnum%3D4

As suggested I would get in touch with the solaris administrator, and
see if there is any issue with JRE installation, or if I can install
xvfb/similar softwares so that I can get around this problem.

I understand that the following code ...

" java.awt.Toolkit.<clinit>(Toolkit.java:1058)"

Should be called in FOP case also, but the error I get is a parse
DOMException "(The current node (type: 2, name: contentStyleType) is
read-only)", which probably happens much earlier !? I couldn't imagine
that this parse error happens because of the x server issue. Any
comments?

Ganesh


-----Original Message-----
From: J.Pietschmann [mailto:j3322ptm@yahoo.de] 
Sent: Thursday, August 28, 2003 1:45 AM
To: fop-user@xml.apache.org
Subject: Re: Issue with SVG in Batik with FOP in SunOS (UNIX)


Ganesh wrote:
> that I am using JRE version "1.3.0_04" (Java HotSpot(TM) Client VM 
> (build 1.3.0_04, mixed mode). Due to project constraints I am unable 
> to change/upgrade this JVM. Is this version a problem?

It's rather old. I'd try to install the most recent version side-by-side
or another machine with the same environment and soo what happens.

> Exception in thread "main" java.lang.UnsatisfiedLinkError: exception

A kind of misconfiguration. Either a library is completely missing,
installed in the wrong place or inaccessible to the JVM. Ask your local
Solaris guru to fix the installation. It is weird though that this
didn't happen from FOP, because

>         at java.awt.Toolkit.<clinit>(Toolkit.java:1058)

this should be called there too.

> Now, does this mean that I don't have the Xserver running?

I'd think it should be rather obvious to you whether an X server is
running. In any case, none of the exceptions you've shown so far are
typical for a failure to connect an X server, usually you'd get "cannot
connect to X server" or something similar in this case.

J.Pietschmann




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


Re: Issue with SVG in Batik with FOP in SunOS (UNIX)

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Ganesh wrote:
> that I am using JRE version "1.3.0_04" (Java HotSpot(TM) Client VM
> (build 1.3.0_04, mixed mode). Due to project constraints I am unable to
> change/upgrade this JVM. Is this version a problem?

It's rather old. I'd try to install the most recent version
side-by-side or another machine with the same environment and
soo what happens.

> Exception in thread "main" java.lang.UnsatisfiedLinkError: exception

A kind of misconfiguration. Either a library is completely missing,
installed in the wrong place or inaccessible to the JVM. Ask your
local Solaris guru to fix the installation.
It is weird though that this didn't happen from FOP, because

>         at java.awt.Toolkit.<clinit>(Toolkit.java:1058)

this should be called there too.

> Now, does this mean that I don't have the Xserver running?

I'd think it should be rather obvious to you whether an X server
is running. In any case, none of the exceptions you've shown so
far are typical for a failure to connect an X server, usually
you'd get "cannot connect to X server" or something similar in this
case.

J.Pietschmann


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


RE: Issue with SVG in Batik with FOP in SunOS (UNIX)

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
<snip/>

> I got the following new exception...
> Exception in thread "main" java.lang.UnsatisfiedLinkError: exception
> occurred in
> JNI_OnLoad
>        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
>        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
>        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1298)
>        at java.lang.Runtime.loadLibrary0(Runtime.java:749)
>        at java.lang.System.loadLibrary(System.java:820)
>        at
> sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:53)
>        at java.security.AccessController.doPrivileged(Native Method)
<snip/>
>        at org.apache.batik.apps.rasterizer.Main.execute(Unknown Source)
>        at org.apache.batik.apps.rasterizer.Main.main(Unknown Source)

However fop-unrelated, this gets interesting... Don't know for sure about
the 1.3 JVM,
but seems the VM is started with a security manager in place, requiring you
to explicitly
give permissions to the codebase ( i.e. using sun's policytool ).

> Now, does this mean that I don't have the Xserver running? If that is
> the case, why I am getting a  DOMException (as given below, "The current
> node (type: 2, name:contentStyleType) is read-only") when trying to
> convert the same svg file embedded in FOP? It will be great if you can
> clarify.

Haven't got experience with the headless server environment, but if my above
guess is right this might have sth to do with these permissions being
granted to the fop-codebase, but not to the batik-codebase ( so the
DOMException gives you a hint of what is to come when you do get the
rasterizer to run ...? )

Greetz,

Andreas Delmelle


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


RE: Issue with SVG in Batik with FOP in SunOS (UNIX)

Posted by Ganesh <ga...@wipro.com>.
This is regarding my SVG issue when run in UNIX, but it works perfectly
well in Windows. I tried two options that was suggested, to correct this
("The current node (type: 2, name:
contentStyleType) is read-only") exception, which is given below. Note
that I am using JRE version "1.3.0_04" (Java HotSpot(TM) Client VM
(build 1.3.0_04, mixed mode). Due to project constraints I am unable to
change/upgrade this JVM. Is this version a problem?

a) I tried to execute the Batik in a stand alone mode in Windows 2000,
it was working fine. 
Using the command "java -jar batik-rasterizer.jar -m image/jpg test.svg"
I copied the all batik jar files (batik-1.5beta4, this is the version
FOP 0.20.5 uses) on to my SunOS m/c from windows m/c, then tried it
SunOS. I got the following new exception...
Exception in thread "main" java.lang.UnsatisfiedLinkError: exception
occurred in
 JNI_OnLoad
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1298)
        at java.lang.Runtime.loadLibrary0(Runtime.java:749)
        at java.lang.System.loadLibrary(System.java:820)
        at
sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:53)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.loadLibraries(Toolkit.java:1037)
        at java.awt.Toolkit.<clinit>(Toolkit.java:1058)
        at java.awt.Color.<clinit>(Color.java:188)
        at
org.apache.batik.transcoder.image.JPEGTranscoder.<init>(Unknown Sourc
e)
        at
org.apache.batik.apps.rasterizer.DestinationType.getTranscoder(Unknow
n Source)
        at org.apache.batik.apps.rasterizer.SVGConverter.execute(Unknown
Source)
        at org.apache.batik.apps.rasterizer.Main.execute(Unknown Source)
        at org.apache.batik.apps.rasterizer.Main.main(Unknown Source) 

b) I checked the classpath for any other XML parsers, I don't have any
other parker in my classpath, but still I get this error. 

Now, does this mean that I don't have the Xserver running? If that is
the case, why I am getting a  DOMException (as given below, "The current
node (type: 2, name:contentStyleType) is read-only") when trying to
convert the same svg file embedded in FOP? It will be great if you can
clarify.

> org.w3c.dom.DOMException: The current node (type: 2, name:
> contentStyleType) is read-only.


-----Original Message-----
From: J.Pietschmann [mailto:j3322ptm@yahoo.de] 
Subject: Re: Issue with SVG in Batik with FOP in SunOS (UNIX)


Ganesh wrote:
> I am facing a problem when I am trying to use Batik in Unix 
> Environment,
...
> org.w3c.dom.DOMException: The current node (type: 2, name:
> contentStyleType) is read-only.
> at 
> org.apache.batik.dom.AbstractNode.createDOMException(AbstractNode.jav
> at
org.apache.batik.dom.AbstractAttr.setNodeValue(AbstractAttr.java:113)

This kind of problem is often caused by incompatible XML libraries in
the classpath. If you have JDK 1.4 installed, try to get a more recent
version. However, it would be interesting to see whether the SVG code
can be rendered by one of the Batik apps (squiggle or the CLI
rasterizer).

>         <svg:svg xmlns:svg=" <http://www.w3.org/2000/svg> 
> http://www.w3.org/2000/svg"

Uh, this is a c&p error or what?

J.Pietschmann


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


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


Re: Issue with SVG in Batik with FOP in SunOS (UNIX)

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Ganesh wrote:
> I am facing a problem when I am trying to use Batik in Unix Environment,
...
> org.w3c.dom.DOMException: The current node (type: 2, name:
> contentStyleType) is read-only.
> at org.apache.batik.dom.AbstractNode.createDOMException(AbstractNode.jav
> at org.apache.batik.dom.AbstractAttr.setNodeValue(AbstractAttr.java:113)

This kind of problem is often caused by incompatible XML libraries
in the classpath. If you have JDK 1.4 installed, try to get a more
recent version. However, it would be interesting to see whether
the SVG code can be rendered by one of the Batik apps (squiggle or
the CLI rasterizer).

>         <svg:svg xmlns:svg=" <http://www.w3.org/2000/svg>
> http://www.w3.org/2000/svg"

Uh, this is a c&p error or what?

J.Pietschmann


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