Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » How to use Moxy(artifact is missing SchemaMetadata.class)
How to use Moxy [message #1118345] Fri, 27 September 2013 10:09 Go to next message
Martin Lichtin is currently offline Martin Lichtin
Messages: 1
Registered: September 2013
Junior Member
Just wanted to start using Moxy and trying things described on page:
http://www.eclipse.org/eclipselink/documentation/2.5/moxy/dynamic_jaxb003.htm

Using Maven, I add a dependency:

<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.moxy</artifactId>
<version>2.5.0</version>
</dependency>

This pulls in core, asm, antlr as well. So far, so good.

When calling DynamicJAXBContextFactory.createContextFromXSD(...) however I am getting a

java.lang.ClassNotFoundException: org.eclipse.persistence.jaxb.dynamic.metadata.SchemaMetadata

That's baffling. The "org.eclipse.persistence.jaxb.dynamic.metadata" package belongs to the
"org.eclipse.persistence.moxy" artifact, so how come SchemaMetadata.class is not in the artifact?

Re: How to use Moxy [message #1118706 is a reply to message #1118345] Fri, 27 September 2013 17:43 Go to previous message
Rick Barkhouse is currently offline Rick Barkhouse
Messages: 22
Registered: July 2009
Junior Member
Hello Martin,

This has actually exposed a bug in our Maven support, some dependencies are not present for the moxy artifact. I've entered a bug to track this here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=418207

To work around this, you will need to change your dependency to include the full eclipselink artifact, and also include a dependency to the required xjc tools:

<dependency>
    <groupId>org.eclipse.persistence</groupId>
    <artifactId>eclipselink</artifactId>
    <version>2.5.0</version>
    <exclusions>
        <exclusion>
            <artifactId>commonj.sdo</artifactId>
            <groupId>commonj.sdo</groupId>
        </exclusion>
    </exclusions>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>com.sun.tools.xjc.maven2</groupId>
    <artifactId>maven-jaxb-plugin</artifactId>
    <version>1.1.1</version>
</dependency>


Thanks for bringing this to our attention,
Rick
Previous Topic:eclipselink moxy xml-path binding file not skipping element
Next Topic:postgresql calling a function on delete
Goto Forum:
  


Current Time: Tue Oct 21 05:30:16 GMT 2014

Powered by FUDForum. Page generated in 0.02028 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software