Bug in JAXB / Generating Interfaces

I wanted to declare an interface in my Binding-Schema.

These interface should have a Getter-Methode that returns a class called PvXMLElementarvertrag.

In my DTD this element hat obviously subelements and therefore it is a class. But the generated Interface returns a String. Also a Declaration in the Binding-Schema does not help.

Has anyone similar problems ? Is this a bug or did i make a mistake ?

[433 byte] By [pokkkkk] at [2007-9-26 2:07:05]
# 1
I've got the same problem. I'm able to generate interfaces when all elements are leafs but for elements that contain sub-elements it's always a string.Anyone has a sample to show us the right way or is it a bug?
zmea at 2007-6-29 8:53:59 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Hi guys,

The only way this can be resloved is by changing the code after it is generated. I did this and now it works..

to change the setter method do

sed -e "s/setMyObject(String _MyObject);/setMyObject(Object _myObject);/g" InterfaceName.java > InterfaceName.java.patched

copy InterfaceName.java.patched InterfaceName.java

del InterfaceName.java.patched

to change the gettter method do.

sed -e "s/public String getMyObject();/public Object getMyObject();/g" InterfaceName.java > InterfaceName.java.patched

copy InterfaceName.java.patched InterfaceName.java

del InterfaceName.java.patched

Remember to also add code to import that class Name. As somebody said before. This approach is bad. But its an ok work around and it works for me.

Jaxb has its set of bugs. But I think it is great to work with....

Srini

nandula.rm at 2007-6-29 8:53:59 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...