users@jaxb.java.net

Re: Large schema's generate so many classes that ObjectFactory is too big for Java

From: Martin Bosak <bosakm_java_at_fmctc.com>
Date: Fri, 10 Jan 2003 23:28:06 -0600

Brent,

I already reported this as a bug.

If you look at the ObjectFactory, it has a static initialization block where
it contains a bunch of lines like:

ir.setDefaultImpl((com.foo.bar.MyElement.class),
(com.foo.bar.MyElementImpl.class));

I just created some
private static void init1(com.sun.xml.bind.ImplementationRegistry ir) {
}

methods and moved a bunch of those lines to those methods. Then in the
initializer block, I simply invoked these private methods.




----- Original Message -----
From: "Brent Hale" <brent_at_EVENTRONIX.COM>
To: <JAXB-INTEREST_at_JAVA.SUN.COM>
Sent: Friday, January 10, 2003 10:43 AM
Subject: Large schema's generate so many classes that ObjectFactory is too
big for Java


> Hi,
>
> I recently downloaded JAXB and pointed it at a Schema for an XML interface
to a very popular program. It generated all the files just fine. But when
I went to run a simple JUnit on it, it failed on the following line:
>
> JAXBContext jc = JAXBContext.newInstance("qbfcjaxb");
>
> The error I receive is the following:
>
> Caused by: java.lang.ClassFormatError: qbfcjaxb/ObjectFactory (Code of a
method longer than 65535 bytes)
>
> And if I go into the generated ObjectFactory.java file it has over 13,000
lines of code. The size of the file is 646,666 bytes.
>
> The architecture of building ObjectFactory this way seems to be a major
deficiency; one that will limit the usefulness of the runtime implementation
of JAXB.
>
> Perhaps there is a work-around. If so, please tell me. After perusing
the docomentation I still don't know how to get around it.
>
> Thanks,
>
> Brent
>