You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Andreas Karalus <an...@googlemail.com> on 2009/07/31 10:31:50 UTC

jaxb 2.0 vs jaxb 2.1

problem was already posted, there is a problem with javaee-5.0.2 containing
jaxb-api-2.0, if someone relies on jaxb-impl-2.1 you'll get linkage errors
like this one

Caused by: java.lang.LinkageError: JAXB 2.0 API jar is being loaded (from
jar:file:/D:/mavenRepo/org/apache/openejb/javaee-api/5.0-2/javaee-api-5.0-2.jar!/javax/xml/bind/annotation/XmlSchema.class),
but this RI (from
jar:file:/D:/mavenRepo/jboss/jboss-as/jaxb-impl/4.3.0.GA-CP01-EAP/jaxb-impl-4.3.0.GA-CP01-EAP.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class)
requires JAXB 2.1 API jar.
    at
com.sun.xml.bind.v2.model.impl.ModelBuilder.<clinit>(ModelBuilder.java:172)
    at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
    at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
    at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)

-> One way is to replace in your pom.xml
	<dependency>
		<groupId>org.apache.openejb</groupId>
		<artifactId>javaee-api</artifactId>
		<version>5.0-2</version>
	</dependency>
with all the <groupId>org.apache.geronimo.specs</groupId> jars contained in
javaee-api (and not include jaxb-api-2.0.jar) -> see dependecies.xml or
dependencies.txt contained in javaee-api-5.0.2.jar for the complete list.


-> Other way could be providing a javaee-api.jar without the jaxb-api.
@David: You already mentioned this alternative in another post, just wanted
to ask if there are still plans to do that?

regards,
andreas






-- 
View this message in context: http://www.nabble.com/jaxb-2.0-vs-jaxb-2.1-tp24752914p24752914.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


RE: jaxb 2.0 vs jaxb 2.1

Posted by Will Hoover <ja...@gmail.com>.
that sounds like a really good idea!

-----Original Message-----
From: David Blevins [mailto:david.blevins@visi.com] 
Sent: Wednesday, August 05, 2009 6:48 PM
To: users@openejb.apache.org
Subject: Re: jaxb 2.0 vs jaxb 2.1


On Jul 31, 2009, at 1:31 AM, Andreas Karalus wrote:

>
> problem was already posted, there is a problem with javaee-5.0.2  
> containing
> jaxb-api-2.0, if someone relies on jaxb-impl-2.1 you'll get linkage  
> errors
> like this one
>
> Caused by: java.lang.LinkageError: JAXB 2.0 API jar is being loaded  
> (from
> jar:file:/D:/mavenRepo/org/apache/openejb/javaee-api/5.0-2/javaee- 
> api-5.0-2.jar!/javax/xml/bind/annotation/XmlSchema.class),
> but this RI (from
> jar:file:/D:/mavenRepo/jboss/jboss-as/jaxb-impl/4.3.0.GA-CP01-EAP/ 
> jaxb-impl-4.3.0.GA-CP01-EAP.jar!/com/sun/xml/bind/v2/model/impl/ 
> ModelBuilder.class)
> requires JAXB 2.1 API jar.
>    at
> com 
> .sun.xml.bind.v2.model.impl.ModelBuilder.<clinit>(ModelBuilder.java: 
> 172)
>    at
> com 
> .sun 
> .xml 
> .bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java: 
> 422)
>    at
> com 
> .sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java: 
> 286)
>    at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java: 
> 139)
>
> -> One way is to replace in your pom.xml
> 	<dependency>
> 		<groupId>org.apache.openejb</groupId>
> 		<artifactId>javaee-api</artifactId>
> 		<version>5.0-2</version>
> 	</dependency>
> with all the <groupId>org.apache.geronimo.specs</groupId> jars  
> contained in
> javaee-api (and not include jaxb-api-2.0.jar) -> see dependecies.xml  
> or
> dependencies.txt contained in javaee-api-5.0.2.jar for the complete  
> list.
>
>
> -> Other way could be providing a javaee-api.jar without the jaxb-api.
> @David: You already mentioned this alternative in another post, just  
> wanted
> to ask if there are still plans to do that?

I definitely still plan to cook up a javaee jar without jaxb.  One  
thought had occurred to me as well given the recent JPA 2.0 question  
is that for maven users we could actually create a "wrapper pom"  
instead of a "wrapper jar", then people could exclude any library they  
want and include the version they do want.

We can definitely do both, any preference on which would be more  
useful to you?

-David


Re: jaxb 2.0 vs jaxb 2.1

Posted by Andreas Karalus <an...@googlemail.com>.
Hi Louis, hi David,

in our case both way should work (pom or javaee.jar without jaxb), since we
rely on maven as build tool and we are using openejb just for unit tests. In
other cases (e.g. ant build, or embedding openejb in tomcat) the javaee.jar
alternative should be more suitable. 

I've tried running with JDK1.6 locally - everything works fine. People using
jdk1.6 should not run into this problem. But our (test, production)
infrastructure still relies on 1.5 so we are tied to this at this time. 

regards,
andreas




Jean-Louis MONTEIRO wrote:
> 
> 
> 
> David Blevins wrote:
>> 
>> I definitely still plan to cook up a javaee jar without jaxb.  One  
>> thought had occurred to me as well given the recent JPA 2.0 question  
>> is that for maven users we could actually create a "wrapper pom"  
>> instead of a "wrapper jar", then people could exclude any library they  
>> want and include the version they do want.
>> 
>> We can definitely do both, any preference on which would be more  
>> useful to you?
>> 
> Right. Using a pom (as a classifier of javaee-api may be) could be useful
> for unit tests but what about using OpenEJB in Tomcat?
> Does it mean we have to produce and maintain 2 openejb war?
> For jaxb i'm confident. But for others apis, do you think it can produce
> side effects?
> 
> Andreas, did you try running with JDK 1.6?
> AFAIK, jaxb is now part of the IDK 1.6 and i believe it's jaxb 2.1.
> 
> Jean-Louis
> 
> 

-- 
View this message in context: http://www.nabble.com/jaxb-2.0-vs-jaxb-2.1-tp24752914p24841546.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: jaxb 2.0 vs jaxb 2.1

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.


David Blevins wrote:
> 
> I definitely still plan to cook up a javaee jar without jaxb.  One  
> thought had occurred to me as well given the recent JPA 2.0 question  
> is that for maven users we could actually create a "wrapper pom"  
> instead of a "wrapper jar", then people could exclude any library they  
> want and include the version they do want.
> 
> We can definitely do both, any preference on which would be more  
> useful to you?
> 
Right. Using a pom (as a classifier of javaee-api may be) could be useful
for unit tests but what about using OpenEJB in Tomcat?
Does it mean we have to produce and maintain 2 openejb war?
For jaxb i'm confident. But for others apis, do you think it can produce
side effects?

Andreas, did you try running with JDK 1.6?
AFAIK, jaxb is now part of the IDK 1.6 and i believe it's jaxb 2.1.

Jean-Louis

-- 
View this message in context: http://www.nabble.com/jaxb-2.0-vs-jaxb-2.1-tp24752914p24841054.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: jaxb 2.0 vs jaxb 2.1

Posted by David Blevins <da...@visi.com>.
On Jul 31, 2009, at 1:31 AM, Andreas Karalus wrote:

>
> problem was already posted, there is a problem with javaee-5.0.2  
> containing
> jaxb-api-2.0, if someone relies on jaxb-impl-2.1 you'll get linkage  
> errors
> like this one
>
> Caused by: java.lang.LinkageError: JAXB 2.0 API jar is being loaded  
> (from
> jar:file:/D:/mavenRepo/org/apache/openejb/javaee-api/5.0-2/javaee- 
> api-5.0-2.jar!/javax/xml/bind/annotation/XmlSchema.class),
> but this RI (from
> jar:file:/D:/mavenRepo/jboss/jboss-as/jaxb-impl/4.3.0.GA-CP01-EAP/ 
> jaxb-impl-4.3.0.GA-CP01-EAP.jar!/com/sun/xml/bind/v2/model/impl/ 
> ModelBuilder.class)
> requires JAXB 2.1 API jar.
>    at
> com 
> .sun.xml.bind.v2.model.impl.ModelBuilder.<clinit>(ModelBuilder.java: 
> 172)
>    at
> com 
> .sun 
> .xml 
> .bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java: 
> 422)
>    at
> com 
> .sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java: 
> 286)
>    at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java: 
> 139)
>
> -> One way is to replace in your pom.xml
> 	<dependency>
> 		<groupId>org.apache.openejb</groupId>
> 		<artifactId>javaee-api</artifactId>
> 		<version>5.0-2</version>
> 	</dependency>
> with all the <groupId>org.apache.geronimo.specs</groupId> jars  
> contained in
> javaee-api (and not include jaxb-api-2.0.jar) -> see dependecies.xml  
> or
> dependencies.txt contained in javaee-api-5.0.2.jar for the complete  
> list.
>
>
> -> Other way could be providing a javaee-api.jar without the jaxb-api.
> @David: You already mentioned this alternative in another post, just  
> wanted
> to ask if there are still plans to do that?

I definitely still plan to cook up a javaee jar without jaxb.  One  
thought had occurred to me as well given the recent JPA 2.0 question  
is that for maven users we could actually create a "wrapper pom"  
instead of a "wrapper jar", then people could exclude any library they  
want and include the version they do want.

We can definitely do both, any preference on which would be more  
useful to you?

-David