aspose file tools*
The moose likes XML and Related Technologies and the fly likes Jaxb version from 1.x to 2.1.9 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Jaxb version from 1.x to 2.1.9" Watch "Jaxb version from 1.x to 2.1.9" New topic
Author

Jaxb version from 1.x to 2.1.9

Md Uddin
Ranch Hand

Joined: Jan 11, 2006
Posts: 30
Hello,

My application previously used the following two jars (from version 1):

* jaxb-rt-1.0-ea.jar: Runtime library (the binding framework)
* jaxb-xjc-1.0-ea.jar: Schema compiler

I am just wondering, which I need to replace from version 2.1.9 with the above two jar (I want to use the latest version).

When I got the version 2.1.9, I have the following jars:

Any help will be appreciated. Thank you in advance.
[ November 26, 2008: Message edited by: Md Uddin ]

MURAD (SCJP 5.0, SCWCD 1.4)
If you learn to program in Java, you'll never be without a job! (Patricia Seybold in 1998) - Knowing the syntax of Java does not make someone a software engineer. (John Knight)
Md Uddin
Ranch Hand

Joined: Jan 11, 2006
Posts: 30
As I didn't get any answer from the above thread. Let me try it another way to resolve my issue.

My application was using
jaxb-rt-1.0-ea.jar
jaxb-xjc-1.0-ea.jar


which I would like to replace with current jaxb 2.1.9 version jars
I probably need
jaxb-api.jar
jaxb-xjc.jar


But I realized that lots of classes from older version has been deprecated, which I am using, like:

javax.xml.bind.MarshallableRootElement;

javax.xml.bind.Dispatcher;
javax.xml.bind.InvalidAttributeException;
javax.xml.bind.InvalidContentObjectException;
javax.xml.bind.LocalValidationException;
javax.xml.bind.MarshallableObject;
javax.xml.bind.MarshallableRootElement;
javax.xml.bind.MissingContentException;
javax.xml.bind.PredicatedLists;
javax.xml.bind.PredicatedLists.Predicate;
javax.xml.bind.RootElement;
javax.xml.bind.StructureValidationException;
javax.xml.bind.ValidatableObject;
javax.xml.bind.Validator;
javax.xml.marshal.XMLScanner;
javax.xml.marshal.XMLWriter;

etc.

There are lot's of implementation with the use of above classes

I am just wondering if anyone could help me with any workaround or any web link or any doc, so that I can replace the old jars with new ones.

Thank you in advance.
[ December 01, 2008: Message edited by: Md Uddin ]
James Jeyachandran
Greenhorn

Joined: Feb 24, 2010
Posts: 1
I have the same problem...did you get a solution ?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

"Jj", please check your private messages regarding an important administrative matter.

Thank you.
Rajesh Akkiniveeranan
Greenhorn

Joined: Dec 28, 2009
Posts: 4
Hi All,

I am also facing the same issue.. Did anyone got a solution for this?

To Md Uddin: did you resolve this issue?


Thanks,
Rajesh


Rajesh
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10046
    
163

Rajesh Akkiniveeranan wrote:Hi All,

I am also facing the same issue.. Did anyone got a solution for this?


Even if it's the "same" issue, could you please provide more details about what you are running into?

[My Blog] [JavaRanch Journal]
Rajesh Akkiniveeranan
Greenhorn

Joined: Dec 28, 2009
Posts: 4
Hi Jaikiran,

As Md Uddin said, we are also using the below said classes.

javax.xml.bind.MarshallableRootElement;

javax.xml.bind.Dispatcher;
javax.xml.bind.InvalidAttributeException;
javax.xml.bind.InvalidContentObjectException;
javax.xml.bind.LocalValidationException;
javax.xml.bind.MarshallableObject;
javax.xml.bind.MarshallableRootElement;
javax.xml.bind.MissingContentException;
javax.xml.bind.PredicatedLists;
javax.xml.bind.PredicatedLists.Predicate;
javax.xml.bind.RootElement;
javax.xml.bind.StructureValidationException;
javax.xml.bind.ValidatableObject;
javax.xml.bind.Validator;
javax.xml.marshal.XMLScanner;
javax.xml.marshal.XMLWriter;
etc.

Now in JAXB 2.2 I couldn't find any replacement for this.

Actually our project is to migrate the application from 1.4 to 1.6.

It would be great if you give us a solution.

Thanks,
Rajesh
Pavel Tyumentsev
Greenhorn

Joined: Apr 15, 2010
Posts: 1
Hi

Sorry for the inconvenience, I'm looking for jaxb-rt-1.0-ea.jar documentation. I was looking at http://java.sun.com/webservices/docs/1.5/api/ but found no information about deprecated classes like javax.xml.bind.Dispatcher, javax.xml.bind.RootElement etc. Do you have any ideas where could I found it?

Thank you
Rajesh Akkiniveeranan
Greenhorn

Joined: Dec 28, 2009
Posts: 4
Hi Pavel,

Even I searched for the documentation of jaxb-rt-1.0-ea.jar but, no use.

Anyways, there is no replacement for jaxb-rt-1.0-ea.jar. But, we can easily migrate to JAXB 2.1 or 2.2.

Though we need to rewrite the code which uses jaxb-rt-1.0-ea.jar, it is easy to do.

If you want to migrate from jaxb-rt-1.0-ea.jar to JAXB 2.1 or 2.2, I can help you.

One thing is sure, you can't use jaxb-rt-1.0-ea.jar with JDK 1.6 !

Thanks
Steve Singer
Greenhorn

Joined: Feb 23, 2010
Posts: 3
Rajesh, we're trying to upgrade from jaxb-rt-1.0-ea but can't find any documentation on how to do it. If you could give me some tips, that would be great! I also PM'ed you about this as well.

Thanks in advance,
Steve
Rajesh Akkiniveeranan
Greenhorn

Joined: Dec 28, 2009
Posts: 4
Hi Steve,

Please find my comments below

Preliminary Steps:
1. You need to convert all your old .dtd files to .xsd files. You have several tools to convert this.
You can use the below mentioned online tool for conversion:
http://www.hitsw.com/xml_utilites/
2. Generated .xsd files may not be perfect! But we can fine tune it. I will give a tip for fine tuning the .xsd file.
a. Generate java files for the new .xsd files. (Generating java classes is explained below).
b. Compare the java files against the old java file.
c. If you don’t see any difference in the member variable and its method names then your .xsd file is perfect else you have to modify .xsd file based on the old java file method names.

Steps to convert old jaxb-rt-1.0-ea to new JDK 1.6 JAXB:
1. Remove the old .dtd and .xjs files instead include new .xsd files.
2. Generate new java files using .xsd files and replace the old JAXB related java files with the new generated one.
3. For marshalling and unmarshalling see the below link
https://jaxb.dev.java.net/tutorial/
Read the tutorial, you will get a clear idea about marshalling and un marshalling in JDK 1.6

If you need further assistance then please let me know.

Thanks
Allan Kuruvila
Greenhorn

Joined: Mar 16, 2010
Posts: 4
Hey guys,

even i was facing the same issue when i tried to upgrade from jre 1.4 to jre 1.6.

Rajesh, where do youget the dtd files in jaxb-rt-1.0??? i tried finding it, but all i could find was the class files within the jaxb-rt-1.0 package.
can you please let me know what needs to be done
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jaxb version from 1.x to 2.1.9