users@jaxb.java.net

Re: Reusing bindings from previous xjc run

From: Malachi de AElfweald <malachi_at_eoti.org>
Date: Sat, 30 Oct 2004 01:15:32 -0700

A bit more info... tried a few different things...

1) if I don't do the xsd:import:

  [xjc] [ERROR] [ERROR] src-resolve.4.2: Components from namespace
'http://devel.eoti.org/spec/eotiUtil' are not referenceable from schema
document 'file:/E:/devel/pandora/src/conf/vhost.xsd'.

2) if I do the xsd:import, it says it worked, but it re-binds the common
schema into the current jar (thus removing ability to have utility classes
utilize those common complexTypes)

3) if I don't do the xsd:import, but I do the Class Binding; get error #1 above

4) if I do xsd:import AND do the Class Binding:

    [javac]
E:\devel\pandora\target\jaxb\org\eoti\spec\vhost\ObjectFactory.java:138:
incompatible types
     [javac] found : org.eoti.spec.eotiUtil.impl.ParamConfigImpl
     [javac] required: org.eoti.spec.vhost.VhostConfig.ParamConfig
     [javac] return new org.eoti.spec.eotiUtil.impl.ParamConfigImpl();

because ObjectFactory (in new package):
  defaultImplementations.put((org.eoti.spec.vhost.ParamConfig.class),
"org.eoti.spec.vhost.impl.ParamConfigImpl");

5) if I create a new 'paramConfig' complexType that does a base restriction
on 'eu:paramConfig' (with xsd:import):

[xjc] [ERROR] [ERROR] A class/interface with the same name
"org.eoti.spec.vhost.ParamConfig" is already in use.

6) if I do the base restriction without the import, error #1 above

7) if I do the base restriction, but rename the new complexType (with
xsd:import), I get the wrapper type AND the duplicates (#2 above)


Conclusion: So far, I have no idea how it is supposed to be done. I think
the real solution would be that specifying a Class Binding should have put
a different entry into ObjectFactory.. something like:
  defaultImplementations.put((org.eoti.spec.eotiUtil.ParamConfig.class),
"org.eoti.spec.eotiUtil.impl.ParamConfigImpl");
or even extend the original class in the new structure (so that the utility
classes would still work)....


Any thoughts?

Malachi




At 11:38 PM 10/29/2004, Malachi de AElfweald wrote:
Now that I have moved from Ant to Maven, I am having the same issue.

>Basically, I used to have a single XSD that contained common complexTypes
>that the other XSDs imported. At the time, it was no big deal since all
>the schema bindings were being built at the same time.
>
>Now, however, Maven builds the common library first (containing the
>bindings for that common XSD) and then adds it to the classpath for the
>next module.
>
>What I WANT to happen is to be able to tell JAXB that any references to
>"eu:paramConfig" should be implemented by the previously built impl.
>
>What it is currently doing is creating another copy (in a separate
>jar). That doesn't really work because the whole point of the common
>library is that common utility classes handle those objects. They don't
>know anything about the classes in the new jar.
>
>I will email back if I find a clean way of doing it -- but I think what we
>want to do is provide some kind of annotation instead of doing an xsd:import.
>
>
>Malachi



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net