Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by Mohsen Saboorian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Since -static-libgcj doesn't embed classes which are loaded
dynamically using reflection, I manually coded:
DocumentBuilderFactory documentBuilderFactory =
DomDocumentBuilderFactory.newInstance()
so that gcj recognizes gnu.xml.dom.* needed classes and embed them in
my native executable file.

When I run my native file (~40MB with -static-libgcj, ~27Mb without
that), it crashes with a NoClassDefFoundError for
gnu.xml.dom.DomDocumentBuilderFactory.

Is it a bug? I'm using gcj 4.1.2 on Ubuntu 6.10.

Thanks.

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by David Daney :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mohsen Saboorian wrote:

> Hi,
>
> Since -static-libgcj doesn't embed classes which are loaded
> dynamically using reflection, I manually coded:
> DocumentBuilderFactory documentBuilderFactory =
> DomDocumentBuilderFactory.newInstance()
> so that gcj recognizes gnu.xml.dom.* needed classes and embed them in
> my native executable file.
>
> When I run my native file (~40MB with -static-libgcj, ~27Mb without
> that), it crashes with a NoClassDefFoundError for
> gnu.xml.dom.DomDocumentBuilderFactory.
>
> Is it a bug? I'm using gcj 4.1.2 on Ubuntu 6.10.

It is not a bug.  Please read the static linking wiki article pointed to
by the documentation.  It describes how to work around this situation.

http://gcc.gnu.org/onlinedocs/gcj/Linking.html#Linking

David Daney

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by David Daney :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mohsen Saboorian wrote:
> Hi,
>
> Since -static-libgcj doesn't embed classes which are loaded
> dynamically using reflection, I manually coded:
> DocumentBuilderFactory documentBuilderFactory =
> DomDocumentBuilderFactory.newInstance()

There is no newInstance() method in DomDocumentBuilderFactory.

This static method is being resolved by the compiler into a call to the
DocumentBuilderFactory.newInstance() method.  This does not create a
reference to DomDocumentBuilderFactory.

David Daney

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by Mohsen Saboorian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> There is no newInstance() method in DomDocumentBuilderFactory.
Yes, but shouldn't compiler load each class it encounters in the code?
I changed the code to "new DomDocumentBuilderFactory()" but still I
had the problem.

> It is not a bug.  Please read the static linking wiki article pointed to
> by the documentation.  It describes how to work around this situation.
> http://gcc.gnu.org/onlinedocs/gcj/Linking.html#Linking

David, would you please tell me the workaround? I see nothing of any
help for me in that document. my command line looks like this:
gcj -onative.executable -static-libgcj --main=net.sf.X  a.o  b.o  c.o d.o

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by David Daney :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mohsen Saboorian wrote:
>> There is no newInstance() method in DomDocumentBuilderFactory.
> Yes, but shouldn't compiler load each class it encounters in the code?

No, It does not gratuitously load unneeded classes.

> I changed the code to "new DomDocumentBuilderFactory()" but still I
> had the problem.
>
>> It is not a bug.  Please read the static linking wiki article pointed to
>> by the documentation.  It describes how to work around this situation.
>> http://gcc.gnu.org/onlinedocs/gcj/Linking.html#Linking
>
> David, would you please tell me the workaround? I see nothing of any
> help for me in that document. my command line looks like this:
> gcj -onative.executable -static-libgcj --main=net.sf.X  a.o  b.o  c.o d.o

http://gcc.gnu.org/wiki/Statically%20linking%20libgcj


Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by Mohsen Saboorian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> http://gcc.gnu.org/wiki/Statically%20linking%20libgcj

My GCC version is 4.1.2 (2006-9-28 prerelease, Ubuntu
4.1.1.14ubuntu7), not 4.2 but still I can use -static-libgcj option.

Trying the following command line replacing Foo with my own classes
and object files, gives me cannot file -lsupc++.
gcc -o Foo Foo.o Foomain.i -shared-libgcc -Wl,-non_shared -lgcj
-Wl,-call_shared -lsupc++ -Wl,--as-needed -lz -lgcc_s -lpthread -lc
-lm -ldl -Wl,--no-as-needed

As I remove -lsupc++, after some moments it gives me a number of
undefined reference error, for whatever exception thrown from my java
code (or other libraries):
undefined reference to `_Jv_ThrowXYZException'

Thanks.

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by David Daney :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mohsen Saboorian wrote:
>> http://gcc.gnu.org/wiki/Statically%20linking%20libgcj
>
> My GCC version is 4.1.2 (2006-9-28 prerelease, Ubuntu
> 4.1.1.14ubuntu7), not 4.2 but still I can use -static-libgcj option.
>
You should look at the documentation that comes with your compiler.  
IIRC Red Hat and Debian are using a hybrid mash-up of code from several
different versions.

If you were using a straight FSF release the -static-libgcj option is
not available until 4.2.  If you have the -static-libgcj option
available, it is far preferable to use it rather than manually
specifying a large string of libraries.

As a side note, I am not sure why you want to statically link.  Usually
it only makes sense for small embedded environments.

David Daney

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by Mohsen Saboorian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I asked some question regarding statically building my software a
while ago on mailing list:
http://www.nabble.com/libgcj_bc.so-not-embedded-t3538410.html and
http://www.nabble.com/libgcj_bc.so-not-embedded-t3538410i20.html

The final answer was that if I manually do "new
DomDocumentBuilderFactory()", GCJ embeds this class within the static
executable file, so there would be no NoClassDefFoundError. Doing so
does nothing but increasing my app size, and I'm still getting
ClassDef error.

> As a side note, I am not sure why you want to statically link.  Usually
> it only makes sense for small embedded environments.
I want to run my app on an OLPC machine, which neither have jre nor libgcj.

Thanks,
Mohsen.

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by Andrew Haley-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mohsen Saboorian writes:
 > I asked some question regarding statically building my software a
 > while ago on mailing list:
 > http://www.nabble.com/libgcj_bc.so-not-embedded-t3538410.html and
 > http://www.nabble.com/libgcj_bc.so-not-embedded-t3538410i20.html
 >
 > The final answer was that if I manually do "new
 > DomDocumentBuilderFactory()", GCJ embeds this class within the static
 > executable file, so there would be no NoClassDefFoundError. Doing so
 > does nothing but increasing my app size, and I'm still getting
 > ClassDef error.
 >
 > > As a side note, I am not sure why you want to statically link.  Usually
 > > it only makes sense for small embedded environments.
 > I want to run my app on an OLPC machine, which neither have jre nor libgcj.

Yeah, we understand that.  Use "nm --demangle=java' to see if the
DomDocumentBuilderFactory classes really are embedded in your
executable.

If they are, and it fails, post the stacktrace here.

Andrew.

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by Mohsen Saboorian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks,
There was no DomDocumentBuilderFactory entry in the output of command:
nm --demangle=java myapp.exe
even when I explicitly imported and did "new
DomDocumentBuilderFactory()" in the code.

I extracted a portion of libgcj-4.2.0.jar (the whole content of
gnu.xml.* package), say gcj-dom.jar, and compiled and linked it with
my application. The result executable has DomDocumentBuilderFactory
but this time I'm facing with NoClassDefFoundError for
gnu.xml.dom.DomImpl.
Again I put the trivial code new DomImpl() and linked the app. This
time again I'm facing with:

java.lang.NoClassDefFoundError: gnu.xml.dom.DomImpl
java.lang.Class.initializeClass(zekr_static_olpc.exe)
gnu.xml.dom.ImplementationSource.<clinit>(zekr_static_olpc.exe)
java.lang.Class.initializeClass(zekr_static_olpc.exe)
java.lang.Class.newInstance(zekr_static_olpc.exe)
org.w3c.dom.bootstrap.DOMImplementationRegistry.newInstance(zekr_static_olpc.exe)
gnu.xml.dom.DomDocumentBuilderFactory.<init>(zekr_static_olpc.exe)
net.sf.zekr.engine.xml.XmlReader.<init>(zekr_static_olpc.exe)
net.sf.zekr.common.config.ApplicationConfig.extractLangProps(zekr_static_olpc.exe)
...

It's strange that although there exists some entry for gnu.xml.dom.DomImpl with:
nm --demangle=java myapp.exe
it gives me that error.

I should also say that I tried to embed xercesImpl.jar with my app, setting:
javax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
so that it uses xerces instead of gnu.xml.*. It gives me again a
NoClassDefFoundError.

It seems that even when a class file is embedded in a static binary,
class loader (java.lang.Class.initializeClass()) cannot load that.

Mohsen.

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by Andrew Haley-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mohsen Saboorian writes:
 > Thanks,
 > There was no DomDocumentBuilderFactory entry in the output of command:
 > nm --demangle=java myapp.exe
 > even when I explicitly imported and did "new
 > DomDocumentBuilderFactory()" in the code.
 >
 > I extracted a portion of libgcj-4.2.0.jar (the whole content of
 > gnu.xml.* package), say gcj-dom.jar, and compiled and linked it with
 > my application. The result executable has DomDocumentBuilderFactory
 > but this time I'm facing with NoClassDefFoundError for
 > gnu.xml.dom.DomImpl.
 > Again I put the trivial code new DomImpl() and linked the app. This
 > time again I'm facing with:
 >
 > java.lang.NoClassDefFoundError: gnu.xml.dom.DomImpl
 > java.lang.Class.initializeClass(zekr_static_olpc.exe)
 > gnu.xml.dom.ImplementationSource.<clinit>(zekr_static_olpc.exe)
 > java.lang.Class.initializeClass(zekr_static_olpc.exe)
 > java.lang.Class.newInstance(zekr_static_olpc.exe)
 > org.w3c.dom.bootstrap.DOMImplementationRegistry.newInstance(zekr_static_olpc.exe)
 > gnu.xml.dom.DomDocumentBuilderFactory.<init>(zekr_static_olpc.exe)
 > net.sf.zekr.engine.xml.XmlReader.<init>(zekr_static_olpc.exe)
 > net.sf.zekr.common.config.ApplicationConfig.extractLangProps(zekr_static_olpc.exe)
 > ...
 >
 > It's strange that although there exists some entry for gnu.xml.dom.DomImpl with:
 > nm --demangle=java myapp.exe
 > it gives me that error.
 >
 > I should also say that I tried to embed xercesImpl.jar with my app, setting:
 > javax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
 > so that it uses xerces instead of gnu.xml.*. It gives me again a
 > NoClassDefFoundError.
 >
 > It seems that even when a class file is embedded in a static binary,
 > class loader (java.lang.Class.initializeClass()) cannot load that.

I think this is a bug in libgcj.  The NoClassDefFoundError is
reporting the wrong missing class.  It's actually one of
DomDocumentBuilderFactory's dependencies that isn't being found.  If
you use "jcf-dump -v" on the class you'll see what its dependencies
are.

I'm sorry this is turning into such a PITA.

Andrew.

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by Mohsen Saboorian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I filled a bug report:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31647

Andrew, newing DomDocumentBuilderFactory workaround didn't work for
me. Do you know any other workaround ;)?

Thanks.

On 4/20/07, Andrew Haley <aph@...> wrote:

> Mohsen Saboorian writes:
>  > Thanks,
>  > There was no DomDocumentBuilderFactory entry in the output of command:
>  > nm --demangle=java myapp.exe
>  > even when I explicitly imported and did "new
>  > DomDocumentBuilderFactory()" in the code.
>  >
>  > I extracted a portion of libgcj-4.2.0.jar (the whole content of
>  > gnu.xml.* package), say gcj-dom.jar, and compiled and linked it with
>  > my application. The result executable has DomDocumentBuilderFactory
>  > but this time I'm facing with NoClassDefFoundError for
>  > gnu.xml.dom.DomImpl.
>  > Again I put the trivial code new DomImpl() and linked the app. This
>  > time again I'm facing with:
>  >
>  > java.lang.NoClassDefFoundError: gnu.xml.dom.DomImpl
>  > java.lang.Class.initializeClass(zekr_static_olpc.exe)
>  > gnu.xml.dom.ImplementationSource.<clinit>(zekr_static_olpc.exe)
>  > java.lang.Class.initializeClass(zekr_static_olpc.exe)
>  > java.lang.Class.newInstance(zekr_static_olpc.exe)
>  > org.w3c.dom.bootstrap.DOMImplementationRegistry.newInstance(zekr_static_olpc.exe)
>  > gnu.xml.dom.DomDocumentBuilderFactory.<init>(zekr_static_olpc.exe)
>  > net.sf.zekr.engine.xml.XmlReader.<init>(zekr_static_olpc.exe)
>  > net.sf.zekr.common.config.ApplicationConfig.extractLangProps(zekr_static_olpc.exe)
>  > ...
>  >
>  > It's strange that although there exists some entry for gnu.xml.dom.DomImpl with:
>  > nm --demangle=java myapp.exe
>  > it gives me that error.
>  >
>  > I should also say that I tried to embed xercesImpl.jar with my app, setting:
>  > javax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
>  > so that it uses xerces instead of gnu.xml.*. It gives me again a
>  > NoClassDefFoundError.
>  >
>  > It seems that even when a class file is embedded in a static binary,
>  > class loader (java.lang.Class.initializeClass()) cannot load that.
>
> I think this is a bug in libgcj.  The NoClassDefFoundError is
> reporting the wrong missing class.  It's actually one of
> DomDocumentBuilderFactory's dependencies that isn't being found.  If
> you use "jcf-dump -v" on the class you'll see what its dependencies
> are.
>
> I'm sorry this is turning into such a PITA.
>
> Andrew.
>

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by Andrew Haley-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mohsen Saboorian writes:
 > I filled a bug report:
 > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31647
 >
 > Andrew, newing DomDocumentBuilderFactory workaround didn't work for
 > me. Do you know any other workaround ;)?

Did you follow my suggestion?

Andrew.

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by Mohsen Saboorian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 4/21/07, Andrew Haley <aph-gcc@...> wrote:
> Mohsen Saboorian writes:
>  > I filled a bug report:
>  > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31647
>  >
>  > Andrew, newing DomDocumentBuilderFactory workaround didn't work for
>  > me. Do you know any other workaround ;)?
>
> Did you follow my suggestion?
>

Yes, and there was some entries for both
gnu.xml.dom.DomDocumentBuilderFactory and gnu.xml.dom.DomImpl.

Attached is the output for command
jcg-dump -v --classpath=zekr-olpc.jar net.sf.zekr.engine.xml.XmlReader

Thanks.

Reading .class from zekr-olpc.jar(net/sf/zekr/engine/xml/XmlReader.class).
Magic number: 0xcafebabe, minor_version: 0, major_version: 49.

Constant pool (count: 182):
#1: Class name: 2="net/sf/zekr/engine/xml/XmlReader"
#2: Utf8: "net/sf/zekr/engine/xml/XmlReader"
#3: Class name: 4="java/lang/Object"
#4: Utf8: "java/lang/Object"
#5: Utf8: "xmlDocument"
#6: Utf8: "Lorg/w3c/dom/Document;"
#7: Utf8: "parentNode"
#8: Utf8: "Lorg/w3c/dom/Node;"
#9: Utf8: "<init>"
#10: Utf8: "(Ljava/lang/String;)V"
#11: Utf8: "Exceptions"
#12: Class name: 13="net/sf/zekr/engine/xml/XmlReadException"
#13: Utf8: "net/sf/zekr/engine/xml/XmlReadException"
#14: Utf8: "Code"
#15: Class name: 16="java/io/File"
#16: Utf8: "java/io/File"
#17: Methodref class: 15=java.io.File name_and_type: 18=<<init> (java.lang.String)void>
#18: NameAndType name: 9=<init>, signature: 10=(java.lang.String)void
#19: Methodref class: 1=net.sf.zekr.engine.xml.XmlReader name_and_type: 20=<<init> (java.io.File)void>
#20: NameAndType name: 9=<init>, signature: 21=(java.io.File)void
#21: Utf8: "(Ljava/io/File;)V"
#22: Utf8: "LineNumberTable"
#23: Utf8: "LocalVariableTable"
#24: Utf8: "this"
#25: Utf8: "Lnet/sf/zekr/engine/xml/XmlReader;"
#26: Utf8: "filePath"
#27: Utf8: "Ljava/lang/String;"
#28: Methodref class: 3=java.lang.Object name_and_type: 29=<<init> ()void>
#29: NameAndType name: 9=<init>, signature: 30=()void
#30: Utf8: "()V"
#31: Class name: 32="gnu/xml/dom/DomDocumentBuilderFactory"
#32: Utf8: "gnu/xml/dom/DomDocumentBuilderFactory"
#33: Methodref class: 31=gnu.xml.dom.DomDocumentBuilderFactory name_and_type: 29=<<init> ()void>
#34: Class name: 35="gnu/xml/dom/DomImpl"
#35: Utf8: "gnu/xml/dom/DomImpl"
#36: Methodref class: 34=gnu.xml.dom.DomImpl name_and_type: 29=<<init> ()void>
#37: Methodref class: 38=javax.xml.parsers.DocumentBuilderFactory name_and_type: 40=<newDocumentBuilder ()javax.xml.parsers.DocumentBuilder>
#38: Class name: 39="javax/xml/parsers/DocumentBuilderFactory"
#39: Utf8: "javax/xml/parsers/DocumentBuilderFactory"
#40: NameAndType name: 41=newDocumentBuilder, signature: 42=()javax.xml.parsers.DocumentBuilder
#41: Utf8: "newDocumentBuilder"
#42: Utf8: "()Ljavax/xml/parsers/DocumentBuilder;"
#43: Methodref class: 44=javax.xml.parsers.DocumentBuilder name_and_type: 46=<parse (java.io.File)org.w3c.dom.Document>
#44: Class name: 45="javax/xml/parsers/DocumentBuilder"
#45: Utf8: "javax/xml/parsers/DocumentBuilder"
#46: NameAndType name: 47=parse, signature: 48=(java.io.File)org.w3c.dom.Document
#47: Utf8: "parse"
#48: Utf8: "(Ljava/io/File;)Lorg/w3c/dom/Document;"
#49: Fieldref class: 1=net.sf.zekr.engine.xml.XmlReader name_and_type: 50=<xmlDocument org.w3c.dom.Document>
#50: NameAndType name: 5=xmlDocument, signature: 6=org.w3c.dom.Document
#51: InterfaceMethodref class: 52=org.w3c.dom.Document name_and_type: 54=<getFirstChild ()org.w3c.dom.Node>
#52: Class name: 53="org/w3c/dom/Document"
#53: Utf8: "org/w3c/dom/Document"
#54: NameAndType name: 55=getFirstChild, signature: 56=()org.w3c.dom.Node
#55: Utf8: "getFirstChild"
#56: Utf8: "()Lorg/w3c/dom/Node;"
#57: Fieldref class: 1=net.sf.zekr.engine.xml.XmlReader name_and_type: 58=<parentNode org.w3c.dom.Node>
#58: NameAndType name: 7=parentNode, signature: 8=org.w3c.dom.Node
#59: InterfaceMethodref class: 60=org.w3c.dom.Node name_and_type: 62=<getNodeType ()short>
#60: Class name: 61="org/w3c/dom/Node"
#61: Utf8: "org/w3c/dom/Node"
#62: NameAndType name: 63=getNodeType, signature: 64=()short
#63: Utf8: "getNodeType"
#64: Utf8: "()S"
#65: InterfaceMethodref class: 60=org.w3c.dom.Node name_and_type: 66=<getNextSibling ()org.w3c.dom.Node>
#66: NameAndType name: 67=getNextSibling, signature: 56=()org.w3c.dom.Node
#67: Utf8: "getNextSibling"
#68: Class name: 69="java/lang/StringBuilder"
#69: Utf8: "java/lang/StringBuilder"
#70: String 71="Error while loading XML: "
#71: Utf8: "Error while loading XML: "
#72: Methodref class: 68=java.lang.StringBuilder name_and_type: 18=<<init> (java.lang.String)void>
#73: Methodref class: 68=java.lang.StringBuilder name_and_type: 74=<append (java.lang.Object)java.lang.StringBuilder>
#74: NameAndType name: 75=append, signature: 76=(java.lang.Object)java.lang.StringBuilder
#75: Utf8: "append"
#76: Utf8: "(Ljava/lang/Object;)Ljava/lang/StringBuilder;"
#77: String 78=": "
#78: Utf8: ": "
#79: Methodref class: 68=java.lang.StringBuilder name_and_type: 80=<append (java.lang.String)java.lang.StringBuilder>
#80: NameAndType name: 75=append, signature: 81=(java.lang.String)java.lang.StringBuilder
#81: Utf8: "(Ljava/lang/String;)Ljava/lang/StringBuilder;"
#82: Methodref class: 83=java.lang.Exception name_and_type: 85=<getMessage ()java.lang.String>
#83: Class name: 84="java/lang/Exception"
#84: Utf8: "java/lang/Exception"
#85: NameAndType name: 86=getMessage, signature: 87=()java.lang.String
#86: Utf8: "getMessage"
#87: Utf8: "()Ljava/lang/String;"
#88: Methodref class: 68=java.lang.StringBuilder name_and_type: 89=<toString ()java.lang.String>
#89: NameAndType name: 90=toString, signature: 87=()java.lang.String
#90: Utf8: "toString"
#91: Methodref class: 12=net.sf.zekr.engine.xml.XmlReadException name_and_type: 92=<<init> (java.lang.String,java.lang.Throwable)void>
#92: NameAndType name: 9=<init>, signature: 93=(java.lang.String,java.lang.Throwable)void
#93: Utf8: "(Ljava/lang/String;Ljava/lang/Throwable;)V"
#94: Utf8: "file"
#95: Utf8: "Ljava/io/File;"
#96: Utf8: "documentBuilderFactory"
#97: Utf8: "Ljavax/xml/parsers/DocumentBuilderFactory;"
#98: Utf8: "a"
#99: Utf8: "I"
#100: Utf8: "parser"
#101: Utf8: "Ljavax/xml/parsers/DocumentBuilder;"
#102: Utf8: "e"
#103: Utf8: "Ljava/lang/Exception;"
#104: Utf8: "getDocumentElement"
#105: Utf8: "()Lorg/w3c/dom/Element;"
#106: InterfaceMethodref class: 52=org.w3c.dom.Document name_and_type: 107=<getDocumentElement ()org.w3c.dom.Element>
#107: NameAndType name: 104=getDocumentElement, signature: 105=()org.w3c.dom.Element
#108: Utf8: "getNodes"
#109: Utf8: "(Ljava/lang/String;)Lnet/sf/zekr/engine/xml/NodeList;"
#110: Class name: 111="net/sf/zekr/engine/xml/NodeList"
#111: Utf8: "net/sf/zekr/engine/xml/NodeList"
#112: Methodref class: 110=net.sf.zekr.engine.xml.NodeList name_and_type: 29=<<init> ()void>
#113: Class name: 114="java/util/StringTokenizer"
#114: Utf8: "java/util/StringTokenizer"
#115: String 116="."
#116: Utf8: "."
#117: Methodref class: 113=java.util.StringTokenizer name_and_type: 118=<<init> (java.lang.String,java.lang.String)void>
#118: NameAndType name: 9=<init>, signature: 119=(java.lang.String,java.lang.String)void
#119: Utf8: "(Ljava/lang/String;Ljava/lang/String;)V"
#120: Methodref class: 113=java.util.StringTokenizer name_and_type: 121=<nextToken ()java.lang.String>
#121: NameAndType name: 122=nextToken, signature: 87=()java.lang.String
#122: Utf8: "nextToken"
#123: Methodref class: 124=net.sf.zekr.engine.xml.XmlUtils name_and_type: 126=<getNodes (org.w3c.dom.Node,java.lang.String)net.sf.zekr.engine.xml.NodeList>
#124: Class name: 125="net/sf/zekr/engine/xml/XmlUtils"
#125: Utf8: "net/sf/zekr/engine/xml/XmlUtils"
#126: NameAndType name: 108=getNodes, signature: 127=(org.w3c.dom.Node,java.lang.String)net.sf.zekr.engine.xml.NodeList
#127: Utf8: "(Lorg/w3c/dom/Node;Ljava/lang/String;)Lnet/sf/zekr/engine/xml/NodeList;"
#128: Methodref class: 124=net.sf.zekr.engine.xml.XmlUtils name_and_type: 129=<getNodes (net.sf.zekr.engine.xml.NodeList,java.lang.String)net.sf.zekr.engine.xml.NodeList>
#129: NameAndType name: 108=getNodes, signature: 130=(net.sf.zekr.engine.xml.NodeList,java.lang.String)net.sf.zekr.engine.xml.NodeList
#130: Utf8: "(Lnet/sf/zekr/engine/xml/NodeList;Ljava/lang/String;)Lnet/sf/zekr/engine/xml/NodeList;"
#131: Methodref class: 110=net.sf.zekr.engine.xml.NodeList name_and_type: 132=<add (net.sf.zekr.engine.xml.NodeList)void>
#132: NameAndType name: 133=add, signature: 134=(net.sf.zekr.engine.xml.NodeList)void
#133: Utf8: "add"
#134: Utf8: "(Lnet/sf/zekr/engine/xml/NodeList;)V"
#135: Methodref class: 110=net.sf.zekr.engine.xml.NodeList name_and_type: 136=<<init> (org.w3c.dom.NodeList)void>
#136: NameAndType name: 9=<init>, signature: 137=(org.w3c.dom.NodeList)void
#137: Utf8: "(Lorg/w3c/dom/NodeList;)V"
#138: Methodref class: 110=net.sf.zekr.engine.xml.NodeList name_and_type: 139=<deleteAll ()void>
#139: NameAndType name: 140=deleteAll, signature: 30=()void
#140: Utf8: "deleteAll"
#141: Methodref class: 113=java.util.StringTokenizer name_and_type: 142=<hasMoreTokens ()boolean>
#142: NameAndType name: 143=hasMoreTokens, signature: 144=()boolean
#143: Utf8: "hasMoreTokens"
#144: Utf8: "()Z"
#145: Methodref class: 110=net.sf.zekr.engine.xml.NodeList name_and_type: 146=<size ()int>
#146: NameAndType name: 147=size, signature: 148=()int
#147: Utf8: "size"
#148: Utf8: "()I"
#149: Utf8: "nodeHierarchy"
#150: Utf8: "list"
#151: Utf8: "Lnet/sf/zekr/engine/xml/NodeList;"
#152: Utf8: "tempList"
#153: Utf8: "node"
#154: Utf8: "tokenizer"
#155: Utf8: "Ljava/util/StringTokenizer;"
#156: Utf8: "getNode"
#157: Utf8: "(Ljava/lang/String;)Lorg/w3c/dom/Node;"
#158: Methodref class: 1=net.sf.zekr.engine.xml.XmlReader name_and_type: 159=<getNodes (java.lang.String)net.sf.zekr.engine.xml.NodeList>
#159: NameAndType name: 108=getNodes, signature: 109=(java.lang.String)net.sf.zekr.engine.xml.NodeList
#160: Methodref class: 110=net.sf.zekr.engine.xml.NodeList name_and_type: 161=<item (int)org.w3c.dom.Node>
#161: NameAndType name: 162=item, signature: 163=(int)org.w3c.dom.Node
#162: Utf8: "item"
#163: Utf8: "(I)Lorg/w3c/dom/Node;"
#164: Utf8: "getElement"
#165: Utf8: "(Ljava/lang/String;)Lorg/w3c/dom/Element;"
#166: Class name: 167="org/w3c/dom/Element"
#167: Utf8: "org/w3c/dom/Element"
#168: Utf8: "elementHierarchy"
#169: Utf8: "getNodeByAttr"
#170: Utf8: "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Node;"
#171: Methodref class: 124=net.sf.zekr.engine.xml.XmlUtils name_and_type: 172=<getElementByNamedAttr (org.w3c.dom.NodeList,java.lang.String,java.lang.String,java.lang.String)org.w3c.dom.Element>
#172: NameAndType name: 173=getElementByNamedAttr, signature: 174=(org.w3c.dom.NodeList,java.lang.String,java.lang.String,java.lang.String)org.w3c.dom.Element
#173: Utf8: "getElementByNamedAttr"
#174: Utf8: "(Lorg/w3c/dom/NodeList;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element;"
#175: Utf8: "attrName"
#176: Utf8: "attrValue"
#177: Utf8: "nodeList"
#178: Utf8: "getDocument"
#179: Utf8: "()Lorg/w3c/dom/Document;"
#180: Utf8: "SourceFile"
#181: Utf8: "XmlReader.java"

Access flags: 0x21 public super
This class: 1=net.sf.zekr.engine.xml.XmlReader, super: 3=java.lang.Object
Interfaces (count: 0):

Fields (count: 2):
Field name:"xmlDocument" private Signature: 6=org.w3c.dom.Document
Field name:"parentNode" private Signature: 8=org.w3c.dom.Node

Methods (count: 8):

Method name:"<init>" public Signature: 10=(java.lang.String)void
Attribute "Exceptions", length:4, count: 1
  0: #12=<Class net.sf.zekr.engine.xml.XmlReadException>
Attribute "Code", length:69, max_stack:4, max_locals:2, code_length:13
Attribute "LineNumberTable", length:10, count: 2
Attribute "LocalVariableTable", length:22, count: 2
  slot#0: name: 24=this, type: 25=net.sf.zekr.engine.xml.XmlReader (pc: 0 length: 13)
  slot#1: name: 26=filePath, type: 27=java.lang.String (pc: 0 length: 13)

Method name:"<init>" public Signature: 21=(java.io.File)void
Attribute "Exceptions", length:4, count: 1
  0: #12=<Class net.sf.zekr.engine.xml.XmlReadException>
Attribute "Code", length:258, max_stack:5, max_locals:5, code_length:118
Exceptions (count: 1):
  start: 4, end: 79, handler: 79, type: 83=java.lang.Exception
Attribute "LineNumberTable", length:46, count: 11
Attribute "LocalVariableTable", length:62, count: 6
  slot#0: name: 24=this, type: 25=net.sf.zekr.engine.xml.XmlReader (pc: 0 length: 118)
  slot#1: name: 94=file, type: 95=java.io.File (pc: 0 length: 118)
  slot#2: name: 96=documentBuilderFactory, type: 97=javax.xml.parsers.DocumentBuilderFactory (pc: 12 length: 67)
  slot#3: name: 98=a, type: 99=int (pc: 20 length: 59)
  slot#4: name: 100=parser, type: 101=javax.xml.parsers.DocumentBuilder (pc: 26 length: 53)
  slot#2: name: 102=e, type: 103=java.lang.Exception (pc: 80 length: 37)

Method name:"getDocumentElement" public Signature: 105=()org.w3c.dom.Element
Attribute "Code", length:52, max_stack:1, max_locals:1, code_length:10
Attribute "LineNumberTable", length:6, count: 1
Attribute "LocalVariableTable", length:12, count: 1
  slot#0: name: 24=this, type: 25=net.sf.zekr.engine.xml.XmlReader (pc: 0 length: 10)

Method name:"getNodes" public Signature: 109=(java.lang.String)net.sf.zekr.engine.xml.NodeList
Attribute "Code", length:241, max_stack:4, max_locals:7, code_length:95
Attribute "LineNumberTable", length:50, count: 12
Attribute "LocalVariableTable", length:72, count: 7
  slot#0: name: 24=this, type: 25=net.sf.zekr.engine.xml.XmlReader (pc: 0 length: 95)
  slot#1: name: 149=nodeHierarchy, type: 27=java.lang.String (pc: 0 length: 95)
  slot#2: name: 150=list, type: 151=net.sf.zekr.engine.xml.NodeList (pc: 8 length: 87)
  slot#3: name: 152=tempList, type: 151=net.sf.zekr.engine.xml.NodeList (pc: 16 length: 79)
  slot#4: name: 153=node, type: 8=org.w3c.dom.Node (pc: 22 length: 73)
  slot#5: name: 122=nextToken, type: 27=java.lang.String (pc: 55 length: 23)
  slot#6: name: 154=tokenizer, type: 155=java.util.StringTokenizer (pc: 34 length: 61)

Method name:"getNode" public Signature: 157=(java.lang.String)org.w3c.dom.Node
Attribute "Code", length:62, max_stack:2, max_locals:2, code_length:10
Attribute "LineNumberTable", length:6, count: 1
Attribute "LocalVariableTable", length:22, count: 2
  slot#0: name: 24=this, type: 25=net.sf.zekr.engine.xml.XmlReader (pc: 0 length: 10)
  slot#1: name: 149=nodeHierarchy, type: 27=java.lang.String (pc: 0 length: 10)

Method name:"getElement" public Signature: 165=(java.lang.String)org.w3c.dom.Element
Attribute "Code", length:65, max_stack:2, max_locals:2, code_length:13
Attribute "LineNumberTable", length:6, count: 1
Attribute "LocalVariableTable", length:22, count: 2
  slot#0: name: 24=this, type: 25=net.sf.zekr.engine.xml.XmlReader (pc: 0 length: 13)
  slot#1: name: 168=elementHierarchy, type: 27=java.lang.String (pc: 0 length: 13)

Method name:"getNodeByAttr" public Signature: 170=(java.lang.String,java.lang.String,java.lang.String)org.w3c.dom.Node
Attribute "Code", length:102, max_stack:4, max_locals:5, code_length:16
Attribute "LineNumberTable", length:10, count: 2
Attribute "LocalVariableTable", length:52, count: 5
  slot#0: name: 24=this, type: 25=net.sf.zekr.engine.xml.XmlReader (pc: 0 length: 16)
  slot#1: name: 149=nodeHierarchy, type: 27=java.lang.String (pc: 0 length: 16)
  slot#2: name: 175=attrName, type: 27=java.lang.String (pc: 0 length: 16)
  slot#3: name: 176=attrValue, type: 27=java.lang.String (pc: 0 length: 16)
  slot#4: name: 177=nodeList, type: 151=net.sf.zekr.engine.xml.NodeList (pc: 7 length: 9)

Method name:"getDocument" public Signature: 179=()org.w3c.dom.Document
Attribute "Code", length:47, max_stack:1, max_locals:1, code_length:5
Attribute "LineNumberTable", length:6, count: 1
Attribute "LocalVariableTable", length:12, count: 1
  slot#0: name: 24=this, type: 25=net.sf.zekr.engine.xml.XmlReader (pc: 0 length: 5)

Attributes (count: 1):
Attribute "SourceFile", length:2, #181="XmlReader.java"

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by Andrew Haley-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mohsen Saboorian writes:
 > On 4/21/07, Andrew Haley <aph-gcc@...> wrote:
 > > Mohsen Saboorian writes:
 > >  > I filled a bug report:
 > >  > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31647
 > >  >
 > >  > Andrew, newing DomDocumentBuilderFactory workaround didn't work for
 > >  > me. Do you know any other workaround ;)?
 > >
 > > Did you follow my suggestion?
 > >
 >
 > Yes, and there was some entries for both
 > gnu.xml.dom.DomDocumentBuilderFactory and gnu.xml.dom.DomImpl.

No, you need the dump for gnu.xml.dom.DomDocumentBuilderFactory and
gnu.xml.dom.DomImpl.  It's *their* dependencies that are causing the
problems.

Andrew.

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by Mohsen Saboorian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 4/21/07, Andrew Haley <aph@...> wrote:

> Mohsen Saboorian writes:
>  > On 4/21/07, Andrew Haley <aph-gcc@...> wrote:
>  > > Mohsen Saboorian writes:
>  > >  > I filled a bug report:
>  > >  > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31647
>  > >  >
>  > >  > Andrew, newing DomDocumentBuilderFactory workaround didn't work for
>  > >  > me. Do you know any other workaround ;)?
>  > >
>  > > Did you follow my suggestion?
>  > >
>  >
>  > Yes, and there was some entries for both
>  > gnu.xml.dom.DomDocumentBuilderFactory and gnu.xml.dom.DomImpl.
>
> No, you need the dump for gnu.xml.dom.DomDocumentBuilderFactory and
> gnu.xml.dom.DomImpl.  It's *their* dependencies that are causing the
> problems.
>
> Andrew.
>
As you see in attachments, there is no dependency between two classes
DomDocumebtBuilderFactory and DomImpl.

But what about NoClassDefFounError in my class in which I explicitly
new'd DomImpl?

Reading .class from ..\share\java\gcj-dom-impl-4.2.jar(gnu/xml/dom/DomDocumentBuilderFactory.class).
Magic number: 0xcafebabe, minor_version: 3, major_version: 45.

Constant pool (count: 154):
#1: Utf8: "gnu/xml/dom/DomDocumentBuilderFactory"
#2: Class name: 1="gnu/xml/dom/DomDocumentBuilderFactory"
#3: Utf8: "javax/xml/parsers/DocumentBuilderFactory"
#4: Class name: 3="javax/xml/parsers/DocumentBuilderFactory"
#5: Utf8: "impl"
#6: Utf8: "Lorg/w3c/dom/DOMImplementation;"
#7: Utf8: "ls"
#8: Utf8: "Lorg/w3c/dom/ls/DOMImplementationLS;"
#9: Utf8: "secureProcessing"
#10: Utf8: "Z"
#11: Utf8: "<init>"
#12: Utf8: "()V"
#13: Utf8: "Code"
#14: NameAndType name: 11=<init>, signature: 12=()void
#15: Methodref class: 4=javax.xml.parsers.DocumentBuilderFactory name_and_type: 14=<<init> ()void>
#16: Utf8: "org/w3c/dom/bootstrap/DOMImplementationRegistry"
#17: Class name: 16="org/w3c/dom/bootstrap/DOMImplementationRegistry"
#18: Utf8: "newInstance"
#19: Utf8: "()Lorg/w3c/dom/bootstrap/DOMImplementationRegistry;"
#20: NameAndType name: 18=newInstance, signature: 19=()org.w3c.dom.bootstrap.DOMImplementationRegistry
#21: Methodref class: 17=org.w3c.dom.bootstrap.DOMImplementationRegistry name_and_type: 20=<newInstance ()org.w3c.dom.bootstrap.DOMImplementationRegistry>
#22: Utf8: "LS 3.0"
#23: String 22="LS 3.0"
#24: Utf8: "getDOMImplementation"
#25: Utf8: "(Ljava/lang/String;)Lorg/w3c/dom/DOMImplementation;"
#26: NameAndType name: 24=getDOMImplementation, signature: 25=(java.lang.String)org.w3c.dom.DOMImplementation
#27: Methodref class: 17=org.w3c.dom.bootstrap.DOMImplementationRegistry name_and_type: 26=<getDOMImplementation (java.lang.String)org.w3c.dom.DOMImplementation>
#28: NameAndType name: 5=impl, signature: 6=org.w3c.dom.DOMImplementation
#29: Fieldref class: 2=gnu.xml.dom.DomDocumentBuilderFactory name_and_type: 28=<impl org.w3c.dom.DOMImplementation>
#30: Utf8: "javax/xml/parsers/FactoryConfigurationError"
#31: Class name: 30="javax/xml/parsers/FactoryConfigurationError"
#32: Utf8: "no LS implementations found"
#33: String 32="no LS implementations found"
#34: Utf8: "(Ljava/lang/String;)V"
#35: NameAndType name: 11=<init>, signature: 34=(java.lang.String)void
#36: Methodref class: 31=javax.xml.parsers.FactoryConfigurationError name_and_type: 35=<<init> (java.lang.String)void>
#37: Utf8: "org/w3c/dom/ls/DOMImplementationLS"
#38: Class name: 37="org/w3c/dom/ls/DOMImplementationLS"
#39: NameAndType name: 7=ls, signature: 8=org.w3c.dom.ls.DOMImplementationLS
#40: Fieldref class: 2=gnu.xml.dom.DomDocumentBuilderFactory name_and_type: 39=<ls org.w3c.dom.ls.DOMImplementationLS>
#41: Utf8: "(Ljava/lang/Exception;)V"
#42: NameAndType name: 11=<init>, signature: 41=(java.lang.Exception)void
#43: Methodref class: 31=javax.xml.parsers.FactoryConfigurationError name_and_type: 42=<<init> (java.lang.Exception)void>
#44: Utf8: "java/lang/Exception"
#45: Class name: 44="java/lang/Exception"
#46: Utf8: "LineNumberTable"
#47: Utf8: "newDocumentBuilder"
#48: Utf8: "()Ljavax/xml/parsers/DocumentBuilder;"
#49: Utf8: "http://www.w3.org/TR/REC-xml"
#50: String 49="http://www.w3.org/TR/REC-xml"
#51: Utf8: "createLSParser"
#52: Utf8: "(SLjava/lang/String;)Lorg/w3c/dom/ls/LSParser;"
#53: NameAndType name: 51=createLSParser, signature: 52=(short,java.lang.String)org.w3c.dom.ls.LSParser
#54: InterfaceMethodref class: 38=org.w3c.dom.ls.DOMImplementationLS name_and_type: 53=<createLSParser (short,java.lang.String)org.w3c.dom.ls.LSParser>
#55: Utf8: "org/w3c/dom/ls/LSParser"
#56: Class name: 55="org/w3c/dom/ls/LSParser"
#57: Utf8: "getDomConfig"
#58: Utf8: "()Lorg/w3c/dom/DOMConfiguration;"
#59: NameAndType name: 57=getDomConfig, signature: 58=()org.w3c.dom.DOMConfiguration
#60: InterfaceMethodref class: 56=org.w3c.dom.ls.LSParser name_and_type: 59=<getDomConfig ()org.w3c.dom.DOMConfiguration>
#61: Utf8: "namespaces"
#62: String 61="namespaces"
#63: Utf8: "isNamespaceAware"
#64: Utf8: "()Z"
#65: NameAndType name: 63=isNamespaceAware, signature: 64=()boolean
#66: Methodref class: 2=gnu.xml.dom.DomDocumentBuilderFactory name_and_type: 65=<isNamespaceAware ()boolean>
#67: Utf8: "java/lang/Boolean"
#68: Class name: 67="java/lang/Boolean"
#69: Utf8: "TRUE"
#70: Utf8: "Ljava/lang/Boolean;"
#71: NameAndType name: 69=TRUE, signature: 70=java.lang.Boolean
#72: Fieldref class: 68=java.lang.Boolean name_and_type: 71=<TRUE java.lang.Boolean>
#73: Utf8: "FALSE"
#74: NameAndType name: 73=FALSE, signature: 70=java.lang.Boolean
#75: Fieldref class: 68=java.lang.Boolean name_and_type: 74=<FALSE java.lang.Boolean>
#76: Utf8: "setParameter"
#77: Utf8: "(Lorg/w3c/dom/DOMConfiguration;Ljava/lang/String;Ljava/lang/Object;)V"
#78: NameAndType name: 76=setParameter, signature: 77=(org.w3c.dom.DOMConfiguration,java.lang.String,java.lang.Object)void
#79: Methodref class: 2=gnu.xml.dom.DomDocumentBuilderFactory name_and_type: 78=<setParameter (org.w3c.dom.DOMConfiguration,java.lang.String,java.lang.Object)void>
#80: Utf8: "element-content-whitespace"
#81: String 80="element-content-whitespace"
#82: Utf8: "isIgnoringElementContentWhitespace"
#83: NameAndType name: 82=isIgnoringElementContentWhitespace, signature: 64=()boolean
#84: Methodref class: 2=gnu.xml.dom.DomDocumentBuilderFactory name_and_type: 83=<isIgnoringElementContentWhitespace ()boolean>
#85: Utf8: "comments"
#86: String 85="comments"
#87: Utf8: "isIgnoringComments"
#88: NameAndType name: 87=isIgnoringComments, signature: 64=()boolean
#89: Methodref class: 2=gnu.xml.dom.DomDocumentBuilderFactory name_and_type: 88=<isIgnoringComments ()boolean>
#90: Utf8: "expand-entity-references"
#91: String 90="expand-entity-references"
#92: Utf8: "isExpandEntityReferences"
#93: NameAndType name: 92=isExpandEntityReferences, signature: 64=()boolean
#94: Methodref class: 2=gnu.xml.dom.DomDocumentBuilderFactory name_and_type: 93=<isExpandEntityReferences ()boolean>
#95: Utf8: "coalescing"
#96: String 95="coalescing"
#97: Utf8: "isCoalescing"
#98: NameAndType name: 97=isCoalescing, signature: 64=()boolean
#99: Methodref class: 2=gnu.xml.dom.DomDocumentBuilderFactory name_and_type: 98=<isCoalescing ()boolean>
#100: Utf8: "validating"
#101: String 100="validating"
#102: Utf8: "isValidating"
#103: NameAndType name: 102=isValidating, signature: 64=()boolean
#104: Methodref class: 2=gnu.xml.dom.DomDocumentBuilderFactory name_and_type: 103=<isValidating ()boolean>
#105: Utf8: "xinclude-aware"
#106: String 105="xinclude-aware"
#107: Utf8: "isXIncludeAware"
#108: NameAndType name: 107=isXIncludeAware, signature: 64=()boolean
#109: Methodref class: 2=gnu.xml.dom.DomDocumentBuilderFactory name_and_type: 108=<isXIncludeAware ()boolean>
#110: Utf8: "gnu/xml/dom/DomDocumentBuilder"
#111: Class name: 110="gnu/xml/dom/DomDocumentBuilder"
#112: Utf8: "(Lorg/w3c/dom/DOMImplementation;Lorg/w3c/dom/ls/DOMImplementationLS;Lorg/w3c/dom/ls/LSParser;)V"
#113: NameAndType name: 11=<init>, signature: 112=(org.w3c.dom.DOMImplementation,org.w3c.dom.ls.DOMImplementationLS,org.w3c.dom.ls.LSParser)void
#114: Methodref class: 111=gnu.xml.dom.DomDocumentBuilder name_and_type: 113=<<init> (org.w3c.dom.DOMImplementation,org.w3c.dom.ls.DOMImplementationLS,org.w3c.dom.ls.LSParser)void>
#115: Utf8: "Exceptions"
#116: Utf8: "javax/xml/parsers/ParserConfigurationException"
#117: Class name: 116="javax/xml/parsers/ParserConfigurationException"
#118: Utf8: "org/w3c/dom/DOMConfiguration"
#119: Class name: 118="org/w3c/dom/DOMConfiguration"
#120: Utf8: "canSetParameter"
#121: Utf8: "(Ljava/lang/String;Ljava/lang/Object;)Z"
#122: NameAndType name: 120=canSetParameter, signature: 121=(java.lang.String,java.lang.Object)boolean
#123: InterfaceMethodref class: 119=org.w3c.dom.DOMConfiguration name_and_type: 122=<canSetParameter (java.lang.String,java.lang.Object)boolean>
#124: Methodref class: 117=javax.xml.parsers.ParserConfigurationException name_and_type: 35=<<init> (java.lang.String)void>
#125: Utf8: "(Ljava/lang/String;Ljava/lang/Object;)V"
#126: NameAndType name: 76=setParameter, signature: 125=(java.lang.String,java.lang.Object)void
#127: InterfaceMethodref class: 119=org.w3c.dom.DOMConfiguration name_and_type: 126=<setParameter (java.lang.String,java.lang.Object)void>
#128: Utf8: "getAttribute"
#129: Utf8: "(Ljava/lang/String;)Ljava/lang/Object;"
#130: Utf8: "setAttribute"
#131: Utf8: "setFeature"
#132: Utf8: "(Ljava/lang/String;Z)V"
#133: Utf8: "java/lang/NullPointerException"
#134: Class name: 133="java/lang/NullPointerException"
#135: Methodref class: 134=java.lang.NullPointerException name_and_type: 14=<<init> ()void>
#136: Utf8: "javax/xml/XMLConstants"
#137: Class name: 136="javax/xml/XMLConstants"
#138: Utf8: "FEATURE_SECURE_PROCESSING"
#139: Utf8: "Ljava/lang/String;"
#140: NameAndType name: 138=FEATURE_SECURE_PROCESSING, signature: 139=java.lang.String
#141: Fieldref class: 137=javax.xml.XMLConstants name_and_type: 140=<FEATURE_SECURE_PROCESSING java.lang.String>
#142: Utf8: "java/lang/String"
#143: Class name: 142="java/lang/String"
#144: Utf8: "equals"
#145: Utf8: "(Ljava/lang/Object;)Z"
#146: NameAndType name: 144=equals, signature: 145=(java.lang.Object)boolean
#147: Methodref class: 143=java.lang.String name_and_type: 146=<equals (java.lang.Object)boolean>
#148: NameAndType name: 9=secureProcessing, signature: 10=boolean
#149: Fieldref class: 2=gnu.xml.dom.DomDocumentBuilderFactory name_and_type: 148=<secureProcessing boolean>
#150: Utf8: "getFeature"
#151: Utf8: "(Ljava/lang/String;)Z"
#152: Utf8: "SourceFile"
#153: Utf8: "DomDocumentBuilderFactory.java"

Access flags: 0x21 public super
This class: 2=gnu.xml.dom.DomDocumentBuilderFactory, super: 4=javax.xml.parsers.DocumentBuilderFactory
Interfaces (count: 0):

Fields (count: 3):
Field name:"impl" final Signature: 6=org.w3c.dom.DOMImplementation
Field name:"ls" final Signature: 8=org.w3c.dom.ls.DOMImplementationLS
Field name:"secureProcessing" private Signature: 10=boolean

Methods (count: 7):

Method name:"<init>" public Signature: 12=()void
Attribute "Code", length:108, max_stack:4, max_locals:2, code_length:60
Exceptions (count: 1):
  start: 4, end: 46, handler: 49, type: 45=java.lang.Exception
Attribute "LineNumberTable", length:22, count: 5

Method name:"newDocumentBuilder" public Signature: 48=()javax.xml.parsers.DocumentBuilder
Attribute "Code", length:258, max_stack:5, max_locals:3, code_length:198
Attribute "LineNumberTable", length:42, count: 10
Attribute "Exceptions", length:4, count: 1
  0: #117=<Class javax.xml.parsers.ParserConfigurationException>

Method name:"setParameter" Signature: 77=(org.w3c.dom.DOMConfiguration,java.lang.String,java.lang.Object)void
Attribute "Code", length:57, max_stack:4, max_locals:4, code_length:29
Attribute "LineNumberTable", length:10, count: 2
Attribute "Exceptions", length:4, count: 1
  0: #117=<Class javax.xml.parsers.ParserConfigurationException>

Method name:"getAttribute" public Signature: 129=(java.lang.String)java.lang.Object
Attribute "Code", length:26, max_stack:1, max_locals:2, code_length:2
Attribute "LineNumberTable", length:6, count: 1

Method name:"setAttribute" public Signature: 125=(java.lang.String,java.lang.Object)void
Attribute "Code", length:13, max_stack:0, max_locals:3, code_length:1

Method name:"setFeature" public Signature: 132=(java.lang.String,boolean)void
Attribute "Code", length:73, max_stack:4, max_locals:3, code_length:37
Attribute "LineNumberTable", length:18, count: 4
Attribute "Exceptions", length:4, count: 1
  0: #117=<Class javax.xml.parsers.ParserConfigurationException>

Method name:"getFeature" public Signature: 151=(java.lang.String)boolean
Attribute "Code", length:52, max_stack:4, max_locals:2, code_length:24
Attribute "LineNumberTable", length:10, count: 2
Attribute "Exceptions", length:4, count: 1
  0: #117=<Class javax.xml.parsers.ParserConfigurationException>

Attributes (count: 1):
Attribute "SourceFile", length:2, #153="DomDocumentBuilderFactory.java"

Reading .class from ..\share\java\gcj-dom-impl-4.2.jar(gnu/xml/dom/DomImpl.class).
Magic number: 0xcafebabe, minor_version: 3, major_version: 45.

Constant pool (count: 156):
#1: Utf8: "gnu/xml/dom/DomImpl"
#2: Class name: 1="gnu/xml/dom/DomImpl"
#3: Utf8: "java/lang/Object"
#4: Class name: 3="java/lang/Object"
#5: Utf8: "org/w3c/dom/DOMImplementation"
#6: Class name: 5="org/w3c/dom/DOMImplementation"
#7: Utf8: "org/w3c/dom/ls/DOMImplementationLS"
#8: Class name: 7="org/w3c/dom/ls/DOMImplementationLS"
#9: Utf8: "<init>"
#10: Utf8: "()V"
#11: Utf8: "Code"
#12: NameAndType name: 9=<init>, signature: 10=()void
#13: Methodref class: 4=java.lang.Object name_and_type: 12=<<init> ()void>
#14: Utf8: "hasFeature"
#15: Utf8: "(Ljava/lang/String;Ljava/lang/String;)Z"
#16: Utf8: "java/lang/String"
#17: Class name: 16="java/lang/String"
#18: Utf8: "length"
#19: Utf8: "()I"
#20: NameAndType name: 18=length, signature: 19=()int
#21: Methodref class: 17=java.lang.String name_and_type: 20=<length ()int>
#22: Utf8: "toLowerCase"
#23: Utf8: "()Ljava/lang/String;"
#24: NameAndType name: 22=toLowerCase, signature: 23=()java.lang.String
#25: Methodref class: 17=java.lang.String name_and_type: 24=<toLowerCase ()java.lang.String>
#26: Utf8: "charAt"
#27: Utf8: "(I)C"
#28: NameAndType name: 26=charAt, signature: 27=(int)char
#29: Methodref class: 17=java.lang.String name_and_type: 28=<charAt (int)char>
#30: Utf8: "substring"
#31: Utf8: "(I)Ljava/lang/String;"
#32: NameAndType name: 30=substring, signature: 31=(int)java.lang.String
#33: Methodref class: 17=java.lang.String name_and_type: 32=<substring (int)java.lang.String>
#34: Utf8: "xml"
#35: String 34="xml"
#36: Utf8: "equals"
#37: Utf8: "(Ljava/lang/Object;)Z"
#38: NameAndType name: 36=equals, signature: 37=(java.lang.Object)boolean
#39: Methodref class: 17=java.lang.String name_and_type: 38=<equals (java.lang.Object)boolean>
#40: Utf8: "core"
#41: String 40="core"
#42: Utf8: ""
#43: String 42=""
#44: Utf8: "1.0"
#45: String 44="1.0"
#46: Utf8: "2.0"
#47: String 46="2.0"
#48: Utf8: "3.0"
#49: String 48="3.0"
#50: Utf8: "ls"
#51: String 50="ls"
#52: Utf8: "ls-async"
#53: String 52="ls-async"
#54: Utf8: "events"
#55: String 54="events"
#56: Utf8: "mutationevents"
#57: String 56="mutationevents"
#58: Utf8: "uievents"
#59: String 58="uievents"
#60: Utf8: "htmlevents"
#61: String 60="htmlevents"
#62: Utf8: "user-events"
#63: String 62="user-events"
#64: Utf8: "0.1"
#65: String 64="0.1"
#66: Utf8: "traversal"
#67: String 66="traversal"
#68: Utf8: "xpath"
#69: String 68="xpath"
#70: Utf8: "html"
#71: String 70="html"
#72: Utf8: "xhtml"
#73: String 72="xhtml"
#74: Utf8: "LineNumberTable"
#75: Utf8: "createDocumentType"
#76: Utf8: "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/DocumentType;"
#77: Utf8: "gnu/xml/dom/DomDocument"
#78: Class name: 77="gnu/xml/dom/DomDocument"
#79: Utf8: "checkNCName"
#80: Utf8: "(Ljava/lang/String;Z)V"
#81: NameAndType name: 79=checkNCName, signature: 80=(java.lang.String,boolean)void
#82: Methodref class: 78=gnu.xml.dom.DomDocument name_and_type: 81=<checkNCName (java.lang.String,boolean)void>
#83: Utf8: "gnu/xml/dom/DomDoctype"
#84: Class name: 83="gnu/xml/dom/DomDoctype"
#85: Utf8: "(Lorg/w3c/dom/DOMImplementation;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"
#86: NameAndType name: 9=<init>, signature: 85=(org.w3c.dom.DOMImplementation,java.lang.String,java.lang.String,java.lang.String,java.lang.String)void
#87: Methodref class: 84=gnu.xml.dom.DomDoctype name_and_type: 86=<<init> (org.w3c.dom.DOMImplementation,java.lang.String,java.lang.String,java.lang.String,java.lang.String)void>
#88: Utf8: "createDocument"
#89: Utf8: "(Ljava/lang/String;Ljava/lang/String;Lorg/w3c/dom/DocumentType;)Lorg/w3c/dom/Document;"
#90: Utf8: "()Lorg/w3c/dom/Document;"
#91: NameAndType name: 88=createDocument, signature: 90=()org.w3c.dom.Document
#92: Methodref class: 2=gnu.xml.dom.DomImpl name_and_type: 91=<createDocument ()org.w3c.dom.Document>
#93: Utf8: "org/w3c/dom/Document"
#94: Class name: 93="org/w3c/dom/Document"
#95: Utf8: "createElementNS"
#96: Utf8: "(Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element;"
#97: NameAndType name: 95=createElementNS, signature: 96=(java.lang.String,java.lang.String)org.w3c.dom.Element
#98: InterfaceMethodref class: 94=org.w3c.dom.Document name_and_type: 97=<createElementNS (java.lang.String,java.lang.String)org.w3c.dom.Element>
#99: Utf8: "xmlns:"
#100: String 99="xmlns:"
#101: Utf8: "startsWith"
#102: Utf8: "(Ljava/lang/String;)Z"
#103: NameAndType name: 101=startsWith, signature: 102=(java.lang.String)boolean
#104: Methodref class: 17=java.lang.String name_and_type: 103=<startsWith (java.lang.String)boolean>
#105: Utf8: "gnu/xml/dom/DomDOMException"
#106: Class name: 105="gnu/xml/dom/DomDOMException"
#107: Utf8: "xmlns is reserved"
#108: String 107="xmlns is reserved"
#109: Utf8: "(SLjava/lang/String;Lorg/w3c/dom/Node;I)V"
#110: NameAndType name: 9=<init>, signature: 109=(short,java.lang.String,org.w3c.dom.Node,int)void
#111: Methodref class: 106=gnu.xml.dom.DomDOMException name_and_type: 110=<<init> (short,java.lang.String,org.w3c.dom.Node,int)void>
#112: Utf8: "appendChild"
#113: Utf8: "(Lorg/w3c/dom/Node;)Lorg/w3c/dom/Node;"
#114: NameAndType name: 112=appendChild, signature: 113=(org.w3c.dom.Node)org.w3c.dom.Node
#115: InterfaceMethodref class: 94=org.w3c.dom.Document name_and_type: 114=<appendChild (org.w3c.dom.Node)org.w3c.dom.Node>
#116: Utf8: "(Lorg/w3c/dom/DOMImplementation;)V"
#117: NameAndType name: 9=<init>, signature: 116=(org.w3c.dom.DOMImplementation)void
#118: Methodref class: 78=gnu.xml.dom.DomDocument name_and_type: 117=<<init> (org.w3c.dom.DOMImplementation)void>
#119: Utf8: "getFeature"
#120: Utf8: "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;"
#121: NameAndType name: 14=hasFeature, signature: 15=(java.lang.String,java.lang.String)boolean
#122: Methodref class: 2=gnu.xml.dom.DomImpl name_and_type: 121=<hasFeature (java.lang.String,java.lang.String)boolean>
#123: Utf8: "equalsIgnoreCase"
#124: NameAndType name: 123=equalsIgnoreCase, signature: 102=(java.lang.String)boolean
#125: Methodref class: 17=java.lang.String name_and_type: 124=<equalsIgnoreCase (java.lang.String)boolean>
#126: Utf8: "gnu/xml/dom/html2/DomHTMLImpl"
#127: Class name: 126="gnu/xml/dom/html2/DomHTMLImpl"
#128: Methodref class: 127=gnu.xml.dom.html2.DomHTMLImpl name_and_type: 12=<<init> ()void>
#129: Utf8: "createLSParser"
#130: Utf8: "(SLjava/lang/String;)Lorg/w3c/dom/ls/LSParser;"
#131: Utf8: "gnu/xml/dom/ls/DomLSParser"
#132: Class name: 131="gnu/xml/dom/ls/DomLSParser"
#133: Utf8: "(SLjava/lang/String;)V"
#134: NameAndType name: 9=<init>, signature: 133=(short,java.lang.String)void
#135: Methodref class: 132=gnu.xml.dom.ls.DomLSParser name_and_type: 134=<<init> (short,java.lang.String)void>
#136: Utf8: "Exceptions"
#137: Utf8: "org/w3c/dom/DOMException"
#138: Class name: 137="org/w3c/dom/DOMException"
#139: Utf8: "createLSSerializer"
#140: Utf8: "()Lorg/w3c/dom/ls/LSSerializer;"
#141: Utf8: "gnu/xml/dom/ls/DomLSSerializer"
#142: Class name: 141="gnu/xml/dom/ls/DomLSSerializer"
#143: Methodref class: 142=gnu.xml.dom.ls.DomLSSerializer name_and_type: 12=<<init> ()void>
#144: Utf8: "createLSInput"
#145: Utf8: "()Lorg/w3c/dom/ls/LSInput;"
#146: Utf8: "gnu/xml/dom/ls/DomLSInput"
#147: Class name: 146="gnu/xml/dom/ls/DomLSInput"
#148: Methodref class: 147=gnu.xml.dom.ls.DomLSInput name_and_type: 12=<<init> ()void>
#149: Utf8: "createLSOutput"
#150: Utf8: "()Lorg/w3c/dom/ls/LSOutput;"
#151: Utf8: "gnu/xml/dom/ls/DomLSOutput"
#152: Class name: 151="gnu/xml/dom/ls/DomLSOutput"
#153: Methodref class: 152=gnu.xml.dom.ls.DomLSOutput name_and_type: 12=<<init> ()void>
#154: Utf8: "SourceFile"
#155: Utf8: "DomImpl.java"

Access flags: 0x21 public super
This class: 2=gnu.xml.dom.DomImpl, super: 4=java.lang.Object
Interfaces (count: 2):
- Implements: 6=org.w3c.dom.DOMImplementation
- Implements: 8=org.w3c.dom.ls.DOMImplementationLS

Fields (count: 0):

Methods (count: 10):

Method name:"<init>" public Signature: 10=()void
Attribute "Code", length:17, max_stack:1, max_locals:1, code_length:5

Method name:"hasFeature" public Signature: 15=(java.lang.String,java.lang.String)boolean
Attribute "Code", length:529, max_stack:9, max_locals:3, code_length:429
Attribute "LineNumberTable", length:82, count: 20

Method name:"createDocumentType" public Signature: 76=(java.lang.String,java.lang.String,java.lang.String)org.w3c.dom.DocumentType
Attribute "Code", length:46, max_stack:7, max_locals:4, code_length:18
Attribute "LineNumberTable", length:10, count: 2

Method name:"createDocument" public Signature: 89=(java.lang.String,java.lang.String,org.w3c.dom.DocumentType)org.w3c.dom.Document
Attribute "Code", length:138, max_stack:6, max_locals:6, code_length:78
Attribute "LineNumberTable", length:42, count: 10

Method name:"createDocument" protected Signature: 90=()org.w3c.dom.Document
Attribute "Code", length:33, max_stack:3, max_locals:1, code_length:9
Attribute "LineNumberTable", length:6, count: 1

Method name:"getFeature" public Signature: 120=(java.lang.String,java.lang.String)java.lang.Object
Attribute "Code", length:82, max_stack:3, max_locals:3, code_length:42
Attribute "LineNumberTable", length:22, count: 5

Method name:"createLSParser" public Signature: 130=(short,java.lang.String)org.w3c.dom.ls.LSParser
Attribute "Code", length:34, max_stack:4, max_locals:3, code_length:10
Attribute "LineNumberTable", length:6, count: 1
Attribute "Exceptions", length:4, count: 1
  0: #138=<Class org.w3c.dom.DOMException>

Method name:"createLSSerializer" public Signature: 140=()org.w3c.dom.ls.LSSerializer
Attribute "Code", length:32, max_stack:2, max_locals:1, code_length:8
Attribute "LineNumberTable", length:6, count: 1

Method name:"createLSInput" public Signature: 145=()org.w3c.dom.ls.LSInput
Attribute "Code", length:32, max_stack:2, max_locals:1, code_length:8
Attribute "LineNumberTable", length:6, count: 1

Method name:"createLSOutput" public Signature: 150=()org.w3c.dom.ls.LSOutput
Attribute "Code", length:32, max_stack:2, max_locals:1, code_length:8
Attribute "LineNumberTable", length:6, count: 1

Attributes (count: 1):
Attribute "SourceFile", length:2, #155="DomImpl.java"

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by David Daney :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mohsen Saboorian wrote:

> On 4/21/07, Andrew Haley <aph@...> wrote:
>> Mohsen Saboorian writes:
>>  > On 4/21/07, Andrew Haley <aph-gcc@...> wrote:
>>  > > Mohsen Saboorian writes:
>>  > >  > I filled a bug report:
>>  > >  > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31647
>>  > >  >
>>  > >  > Andrew, newing DomDocumentBuilderFactory workaround didn't
>> work for
>>  > >  > me. Do you know any other workaround ;)?
>>  > >
>>  > > Did you follow my suggestion?
>>  > >
>>  >
>>  > Yes, and there was some entries for both
>>  > gnu.xml.dom.DomDocumentBuilderFactory and gnu.xml.dom.DomImpl.
>>
>> No, you need the dump for gnu.xml.dom.DomDocumentBuilderFactory and
>> gnu.xml.dom.DomImpl.  It's *their* dependencies that are causing the
>> problems.
>>
>> Andrew.
>>
>
> As you see in attachments, there is no dependency between two classes
> DomDocumebtBuilderFactory and DomImpl.
>
> But what about NoClassDefFounError in my class in which I explicitly
> new'd DomImpl?
Try running under gdb with a breakpoint in the NoClassDefFoundError
constructor.  You can then walk up the stack a bit and see which class
it is looking for.

David Daney

David Daney


Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by Andrew Haley-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

David Daney writes:
 > Mohsen Saboorian wrote:
 > > On 4/21/07, Andrew Haley <aph@...> wrote:
 > >> Mohsen Saboorian writes:
 > >>  > On 4/21/07, Andrew Haley <aph-gcc@...> wrote:
 > >>  > > Mohsen Saboorian writes:
 > >>  > >  > I filled a bug report:
 > >>  > >  > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31647
 > >>  > >  >
 > >>  > >  > Andrew, newing DomDocumentBuilderFactory workaround didn't
 > >> work for
 > >>  > >  > me. Do you know any other workaround ;)?
 > >>  > >
 > >>  > > Did you follow my suggestion?
 > >>  > >
 > >>  >
 > >>  > Yes, and there was some entries for both
 > >>  > gnu.xml.dom.DomDocumentBuilderFactory and gnu.xml.dom.DomImpl.
 > >>
 > >> No, you need the dump for gnu.xml.dom.DomDocumentBuilderFactory and
 > >> gnu.xml.dom.DomImpl.  It's *their* dependencies that are causing the
 > >> problems.
 > >>
 > >> Andrew.
 > >>
 > >
 > > As you see in attachments, there is no dependency between two classes
 > > DomDocumebtBuilderFactory and DomImpl.
 > >
 > > But what about NoClassDefFounError in my class in which I explicitly
 > > new'd DomImpl?
 > Try running under gdb with a breakpoint in the NoClassDefFoundError
 > constructor.  You can then walk up the stack a bit and see which class
 > it is looking for.

Yes.  

Something has just dawned on me: all the XML stuff is built with
indirect dispatch in the current libgcj, and that will break
everything when linking statically!

Mohsen, we build the XML stuff with indirect dispatch so that it can
easily be dynamically replaced, but this is bad for you.  Edit
scripts/makemake.tcl so that lines like these are removed:

set package_map(gnu/xml/util) bc
set package_map(javax/xml) bc

then run

scripts/makemake.tcl > sources.am

This will give you something that the static linker will be able to
understand.

Alternatively, perhaps you could link explicitly against all the XML
object files.

Andrew.

Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by David Daney :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andrew Haley wrote:

> David Daney writes:
>  > Mohsen Saboorian wrote:
>  > > On 4/21/07, Andrew Haley <aph@...> wrote:
>  > >> Mohsen Saboorian writes:
>  > >>  > On 4/21/07, Andrew Haley <aph-gcc@...> wrote:
>  > >>  > > Mohsen Saboorian writes:
>  > >>  > >  > I filled a bug report:
>  > >>  > >  > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31647
>  > >>  > >  >
>  > >>  > >  > Andrew, newing DomDocumentBuilderFactory workaround didn't
>  > >> work for
>  > >>  > >  > me. Do you know any other workaround ;)?
>  > >>  > >
>  > >>  > > Did you follow my suggestion?
>  > >>  > >
>  > >>  >
>  > >>  > Yes, and there was some entries for both
>  > >>  > gnu.xml.dom.DomDocumentBuilderFactory and gnu.xml.dom.DomImpl.
>  > >>
>  > >> No, you need the dump for gnu.xml.dom.DomDocumentBuilderFactory and
>  > >> gnu.xml.dom.DomImpl.  It's *their* dependencies that are causing the
>  > >> problems.
>  > >>
>  > >> Andrew.
>  > >>
>  > >
>  > > As you see in attachments, there is no dependency between two classes
>  > > DomDocumebtBuilderFactory and DomImpl.
>  > >
>  > > But what about NoClassDefFounError in my class in which I explicitly
>  > > new'd DomImpl?
>  > Try running under gdb with a breakpoint in the NoClassDefFoundError
>  > constructor.  You can then walk up the stack a bit and see which class
>  > it is looking for.
>
> Yes.  
>
> Something has just dawned on me: all the XML stuff is built with
> indirect dispatch in the current libgcj, and that will break
> everything when linking statically!
>
> Mohsen, we build the XML stuff with indirect dispatch so that it can
> easily be dynamically replaced, but this is bad for you.  Edit
> scripts/makemake.tcl so that lines like these are removed:
>
> set package_map(gnu/xml/util) bc
> set package_map(javax/xml) bc
>  
We already use different options (-fPIC, etc) for shared objects.  We
should probably also make the BC ABI dependent on this also.

David Daney


Re: Trying to embed gnu.xml.dom.DomDocumentBuilderFactory

by Andrew Haley-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

David Daney writes:
 > Andrew Haley wrote:
 > > David Daney writes:

 > > Something has just dawned on me: all the XML stuff is built with
 > > indirect dispatch in the current libgcj, and that will break
 > > everything when linking statically!
 > >
 > > Mohsen, we build the XML stuff with indirect dispatch so that it can
 > > easily be dynamically replaced, but this is bad for you.  Edit
 > > scripts/makemake.tcl so that lines like these are removed:
 > >
 > > set package_map(gnu/xml/util) bc
 > > set package_map(javax/xml) bc
 > >  
 > We already use different options (-fPIC, etc) for shared objects.  We
 > should probably also make the BC ABI dependent on this also.

AFAIAA all that is handled by libtool.

I'd accept patches to compile static libraries without indirect
dispatch.  However, you might not always want to do that: maybe you'd
want to use interpreted XML libraries. The default is just our "best
guess".

Andrew.
< Prev | 1 - 2 | Next >