This is the mail archive of the mailing list for the Java project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug java/31647] New: Embedded class dependencies cannot be loaded dynamically from a staic binary

I compiled statically an application with dependencies to javax.xml.parser
using GCJ, replacing DocumentBuilderFactory.newInstance() with new
DomDocumentBuilderFactory() (with -static-gcj switch).

By bad fortune, there is no DomDocumentBuilderFactory entry in the output of
nm --demangle=java myapp.executable

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

It's strange that although there exists some entry for gnu.xml.dom.DomImpl
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:
so that it uses xerces instead of gnu.xml.*. It gives me again a

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

I used this on Ubuntu 6.10 (Edgy); GCC version is 4.1.2 (2006-9-28 prerelease,

Here is some posts on GCJ mailing list regarding this problem:

           Summary: Embedded class dependencies cannot be loaded dynamically
                    from a staic binary
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mohsens at gmail dot com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]