title: com.sun.tools.xjc.reader.Ring.get(Ring.java:113)
body: <p>I am New to Maven, I have created a Maven Project, which will have only schema in it. My intention is to keep my all XSD in this project , Compile and create the jar of JAXB generated class. Below is my POM<br></p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.ads&lt;/groupId&gt;
    &lt;artifactId&gt;adsSchema&lt;/artifactId&gt;
     &lt;packaging&gt;jar&lt;/packaging&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;adsSchema&lt;/name&gt;
      &lt;pluginRepositories&gt;  
      &lt;pluginRepository&gt;  
          &lt;id&gt;maven2-repository.dev.java.net&lt;/id&gt;  
          &lt;name&gt;Java.net Repository for Maven&lt;/name&gt;  
          &lt;url&gt;http://download.java.net/maven/2/&lt;/url&gt;  
          &lt;layout&gt;default&lt;/layout&gt;  
      &lt;/pluginRepository&gt;  
      &lt;/pluginRepositories&gt;
       &lt;build&gt;  
           &lt;plugins&gt;  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;  
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.0.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.5&lt;/source&gt;
                      &lt;target&gt;1.5&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;  
                  &lt;!-- jaxb plugin --&gt;  
                  &lt;groupId&gt;org.jvnet.jaxb2.maven2&lt;/groupId&gt;  
                  &lt;artifactId&gt;maven-jaxb2-plugin&lt;/artifactId&gt;  
                  &lt;executions&gt;  
                          &lt;execution&gt;  
                              &lt;id&gt;adsSchema&lt;/id&gt;  
                              &lt;goals&gt;  
                                      &lt;goal&gt;generate&lt;/goal&gt;  
                              &lt;/goals&gt;  
                                  &lt;configuration&gt;  
                                      &lt;args&gt;  
                                          &lt;param&gt;-npa&lt;/param&gt;  
                                      &lt;/args&gt;  
                                      &lt;!-- the package for the generated java classes --&gt;  
                                      &lt;generatePackage&gt;com.ads.beans&lt;/generatePackage&gt;  
                                      &lt;npa&gt;true&lt;/npa&gt;  
                                      &lt;!-- include the following schemas only; by default all *.xsd files are processed --&gt;
                                      &lt;schemaIncludes&gt;
                                          &lt;schemaDirectory&gt;src/main/resources&lt;/schemaDirectory&gt;  
                                          &lt;include&gt;AuthenticateUser.xsd&lt;/include&gt;  
                                      &lt;/schemaIncludes&gt;  
                                      &lt;!-- whether old output should be removed, this field should generally be set to "true" --&gt;  
                                      &lt;removeOldOutput&gt;true&lt;/removeOldOutput&gt;  
                                      &lt;!-- generate lots of output --&gt;  
                                      &lt;verbose&gt;true&lt;/verbose&gt;  
                                  &lt;/configuration&gt;  
                          &lt;/execution&gt;  
                  &lt;/executions&gt;  
              &lt;/plugin&gt;  
          &lt;/plugins&gt;  
      &lt;/build&gt;  
       &lt;dependencies&gt;
       &lt;dependency&gt;
      &lt;groupId&gt;com.sun.xml.bind&lt;/groupId&gt;
      &lt;artifactId&gt;jaxb-xjc&lt;/artifactId&gt;
      &lt;version&gt;2.2-promoted-b65&lt;/version&gt;
  &lt;/dependency&gt;
  
       &lt;dependency&gt;
              &lt;groupId&gt;com.sun.xml.bind&lt;/groupId&gt;
              &lt;artifactId&gt;jaxb-impl&lt;/artifactId&gt;
              &lt;version&gt;2.2-promoted-b65&lt;/version&gt;
      &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.geronimo.specs&lt;/groupId&gt;
              &lt;artifactId&gt;geronimo-activation_1.1_spec&lt;/artifactId&gt;
              &lt;version&gt;1.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;
              &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;
              &lt;version&gt;2.2.7&lt;/version&gt;
          &lt;/dependency&gt;
  
           &lt;dependency&gt;
              &lt;groupId&gt;org.jvnet.jaxb2_commons&lt;/groupId&gt;
              &lt;artifactId&gt;jaxb2-basics-runtime&lt;/artifactId&gt;
              &lt;version&gt;0.6.4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;sun.jdk&lt;/groupId&gt;
              &lt;artifactId&gt;tools&lt;/artifactId&gt;
              &lt;version&gt;1.5.0&lt;/version&gt;
              &lt;scope&gt;system&lt;/scope&gt;
              &lt;systemPath&gt;C:\Program Files\Java\jdk1.5.0_22\lib\tools.jar&lt;/systemPath&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
    &lt;/project&gt;
  
  My Project Structure is 
        src
           main
               java
                    My Package(Where all Java files get created).
        target
            classes
  </code></pre>
  
  <p>When I use Maven Complie I am getting below error.</p>
  
  <pre><code>Exception in thread "main" java.lang.Error: java.lang.reflect.InvocationTargetException
      at com.sun.tools.xjc.reader.Ring.get(Ring.java:113)
      at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.&lt;init&gt;(BGMBuilder.java:146)
      at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:116)
      at com.sun.tools.xjc.ModelLoader.annotateXMLSchema(ModelLoader.java:426)
      at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:175)
      at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:120)
      at org.jvnet.mjiip.v_2_2.XJC22Mojo.loadModel(XJC22Mojo.java:50)
      at org.jvnet.mjiip.v_2_2.XJC22Mojo.doExecute(XJC22Mojo.java:40)
      at org.jvnet.mjiip.v_2_2.XJC22Mojo.doExecute(XJC22Mojo.java:27)
      at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute(RawXJC2Mojo.java:314)
      at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute(RawXJC2Mojo.java:156)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:592)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
  Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:501)
      at com.sun.tools.xjc.reader.Ring.get(Ring.java:102)
      ... 31 more
  Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException
      at com.sun.tools.xjc.reader.Ring.get(Ring.java:113)
      at com.sun.tools.xjc.reader.xmlschema.BindingComponent.getClassSelector(BindingComponent.java:65)
      at com.sun.tools.xjc.reader.xmlschema.ColorBinder.&lt;init&gt;(ColorBinder.java:62)
      at com.sun.tools.xjc.reader.xmlschema.BindGreen.&lt;init&gt;(BindGreen.java:63)
      ... 36 more
  Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:501)
      at com.sun.tools.xjc.reader.Ring.get(Ring.java:102)
      ... 39 more
  Caused by: java.lang.NoClassDefFoundError: javax/activation/MimeTypeParseException
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
      at java.lang.Class.getConstructor0(Class.java:2671)
      at java.lang.Class.getDeclaredConstructor(Class.java:1953)
      at com.sun.tools.xjc.reader.Ring.get(Ring.java:100)
      at com.sun.tools.xjc.reader.xmlschema.DefaultClassBinder.&lt;init&gt;(DefaultClassBinder.java:98)
      at com.sun.tools.xjc.reader.xmlschema.ClassSelector.&lt;init&gt;(ClassSelector.java:214)
      ... 44 more
  </code></pre>
  
  <p>Please help me to resolve the issue.</p>