aspose file tools*
The moose likes BEA/Weblogic and the fly likes Problem with xjc ant task in jdk 1.6 in weblogic 10.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Problem with xjc ant task in jdk 1.6 in weblogic 10.3" Watch "Problem with xjc ant task in jdk 1.6 in weblogic 10.3" New topic
Author

Problem with xjc ant task in jdk 1.6 in weblogic 10.3

Jyothsna Panchagnula
Ranch Hand

Joined: Jul 11, 2005
Posts: 113
Hi all,

I have an xml and xsd files.

I am trying to generate java classes using xjc ant task in jdk 1.6.
xsd file :

xml file :


When I generated java classes using the initial version of ie 1.0 of Jaxb , I saw that GuiField and GuifieldType classes were generated.
but when I was migrating the application from weblogic 8.1 sp6 to weblogic 10.3 only one class was generated ie GuiField.
I am not knowing whats going wrong , as some classes were looking for GuiField type and it is not genereted.

In jdk 1.5 I used the following jars for jaxb ie jaxb-api.jar , jaxb-impl.jar , jaxp-api.jar , jaxb-lib.jar.

with JDK 1.6 I used that jars that come with bea weblogic.
ie glassfish.jaxb.xjc_2.1.6.jar ,glassfish.jaxb_2.1.6.jar


am I missing anything here?

thanks,
Jyothsna
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Why would you need weblogic specific classes to generated the jaxb java files ? xjc as a standalone should be sufficient for jdk 6.

Which files are generated is dependent upon the XJC compiler. Internal representation types such as the GUIType java class should not have an impact on your code unless you wrote code that directly depended on that type.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Jyothsna Panchagnula
Ranch Hand

Joined: Jul 11, 2005
Posts: 113
Hello Bala,

I am using now XJC compiler only from jdk1.6.

But in one of the java files my code is referring to the method newInstance(java.lang.Class) , which was
generated by jaxb1.0 in ObjectFactory class.
ie the method new Instance(java.lang.class) was available with jaxb1.0 version.

But with jaxb2.0 this method is no longer generated.



Can any one tell me what should be the replacement for the above line of code.
I went through the specification but I didnt find any information so far.

am I missing anything here?


Thanks,
Jyothsna
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

You are probably using an old method to try marshalling or unmarshalling. This tutorial on the new version should help

Jyothsna Panchagnula
Ranch Hand

Joined: Jul 11, 2005
Posts: 113
Hi Deepak,

I am using the latest version only.

The Weblogic 10.3 comes with JAXB 2.1. The problem is the ObjectFactory.java created by the xjc task using JAXB 2.1 is different from the older ObjectFactory.java created using the JAXB1.3. The newInstance() method is missing in the newer version because of which the existing code that uses this method is facing problems.

I can see the problem with 2.1 version only as that newInstance() method is available even in JAXB 2.0.

The Final version of the JSR 222 ( Jaxb 2.1) Architecture Document says that the ObjectFactory has that method.

This can be shown in the following code snippet taken from the Architecture document.

But I dont get that method when I try to generate the java files from the XSD document.

Can any one tell me what is the replacement for newInstance method in ObjectFactory (if there).

thanks,
Jyothsna
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

If it is possible, you can post your XSD here and I can give it a try when time allows.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with xjc ant task in jdk 1.6 in weblogic 10.3