You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Todd Nine <to...@gmail.com> on 2008/02/08 19:03:15 UTC

Help with integrating maven2 plugin and apache

Hi All,
  I'm using XML Beans version 2.2.0, and I'm trying to run my code through
the Eclipse debugger.  Its failing, and I receive the following errors.
I've included my maven plugin 2 configuration, but basically I'm having the
plugin create a jar of the classes that will be deployed, and including it
into my classpath in Eclipse.  Any idea why I'm getting this error?  I'm
using the same jdk for both maven, and eclipse, so I'm not sure why I'm
getting the class version issues.

Thanks,
Todd

Maven plugin configuration:
<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xmlbeans-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>xmlbeans</goal>
                        </goals>
                    </execution>
                </executions>
                <inherited>true</inherited>
                <configuration>
                    <schemaDirectory>src/main/xsd</schemaDirectory>
                    <download>true</download>
                    <outputJar>target/eclipse/xmlbeans-eclipse-runtime.jar
</outputJar>
                </configuration>

Exception stacktrace:

java.lang.ExceptionInInitializerError
    at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(
UnsafeFieldAccessorFactory.java:25)
    at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java
:122)
    at java.lang.reflect.Field.acquireFieldAccessor(Field.java:917)
    at java.lang.reflect.Field.getFieldAccessor(Field.java:898)
    at java.lang.reflect.Field.get(Field.java:357)
    at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java
:770)
    at com.onwebconsulting.urchin.profiles.ProfilesDocument.<clinit>(Unknown
Source)
    at com.onwebconsulting.urchin.profiles.ProfilesDocument$Factory.parse(Unknown
Source)
    at com.bnp.insightCommon.dao.rest.UrchinDaoImpl.getProfiles(
UrchinDaoImpl.java:81)
    at com.bnp.insightCommon.dao.UrchinDaoTest.getProfiles(
UrchinDaoTest.java:54)
    at com.bnp.insightCommon.dao.UrchinDaoTest.testGetProfiles(
UrchinDaoTest.java:41)
    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:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at org.springframework.test.ConditionalTestCase.runBare(
ConditionalTestCase.java:69)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(
JUnit3TestReference.java:130)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
RemoteTestRunner.java:196)
Caused by: java.lang.RuntimeException: Could not instantiate
SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException): is the
version of xbean.jar correct?
    at
schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.TypeSystemHolder.loadTypeSystem(Unknown
Source)
    at
schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.TypeSystemHolder.<clinit>(Unknown
Source)
    ... 31 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:494)
    ... 33 more
Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled
schema: Incompatible minor version - expecting up to 23, got 24
(schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.index) -
code 3
    at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader
.<init>(SchemaTypeSystemImpl.java:1522)
    at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(
SchemaTypeSystemImpl.java:260)
    at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.<init>(
SchemaTypeSystemImpl.java:183)
    ... 37 more

Re: Help with integrating maven2 plugin and apache

Posted by Jacob Danner <ja...@gmail.com>.
Hi Todd,
I'm not an eclipse user (IntelliJ IDEA), but I'll give it a try. Which
maven plugin are you using, which version of eclipse?
Have you queried the maven or eclipse projects for similar issues?
-jacobd

On Feb 10, 2008 6:21 PM, Todd Nine <to...@gmail.com> wrote:
> Bump,
>   I've been struggling with this for 2 days.  Note that my title is
> incorrect, is should say integrating maven 2 plugin and Eclipse.  I've tried
> downgrading xmlbeans.xbean from 2.2.0 to 2.1.0, which didn't fix my issue.
> If I choose a version less than 2.1.0, the plugin completely blows up due to
> deprecation problems.  Has anyone successfully used this plugin with an
> Eclipse environment?  If so how did you do it?  This is immensely
> frustrating, and I don't want to use JAXB, but I'm running out of time to
> get XML Beans working.
>
>
> Thanks,
> Todd
>
>
>
> On Feb 8, 2008 1:03 PM, Todd Nine <to...@gmail.com> wrote:
> > Hi All,
> >   I'm using XML Beans version 2.2.0, and I'm trying to run my code through
> the Eclipse debugger.  Its failing, and I receive the following errors.
> I've included my maven plugin 2 configuration, but basically I'm having the
> plugin create a jar of the classes that will be deployed, and including it
> into my classpath in Eclipse.  Any idea why I'm getting this error?  I'm
> using the same jdk for both maven, and eclipse, so I'm not sure why I'm
> getting the class version issues.
> >
> > Thanks,
> > Todd
> >
> > Maven plugin configuration:
> > <plugin>
> >                 <groupId>org.codehaus.mojo</groupId>
> >                 <artifactId>xmlbeans-maven-plugin</artifactId>
> >                 <executions>
> >                     <execution>
> >                         <goals>
> >                             <goal>xmlbeans</goal>
> >                         </goals>
> >                     </execution>
> >                 </executions>
> >                 <inherited>true</inherited>
> >                 <configuration>
> >                     <schemaDirectory>src/main/xsd</schemaDirectory>
> >                     <download>true</download>
> >
> <outputJar>target/eclipse/xmlbeans-eclipse-runtime.jar</outputJar>
> >                 </configuration>
> >
> > Exception stacktrace:
> >
> > java.lang.ExceptionInInitializerError
> >     at sun.misc.Unsafe.ensureClassInitialized(Native Method)
> >     at
> sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
> >     at
> sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
> >     at java.lang.reflect.Field.acquireFieldAccessor(Field.java:917)
> >     at java.lang.reflect.Field.getFieldAccessor(Field.java:898)
> >     at java.lang.reflect.Field.get(Field.java:357)
> >     at
> org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:770)
> >     at
> com.onwebconsulting.urchin.profiles.ProfilesDocument.<clinit>(Unknown
> Source)
> >     at
> com.onwebconsulting.urchin.profiles.ProfilesDocument$Factory.parse(Unknown
> Source)
> >     at
> com.bnp.insightCommon.dao.rest.UrchinDaoImpl.getProfiles(UrchinDaoImpl.java:81)
> >     at
> com.bnp.insightCommon.dao.UrchinDaoTest.getProfiles(UrchinDaoTest.java:54)
> >     at
> com.bnp.insightCommon.dao.UrchinDaoTest.testGetProfiles(UrchinDaoTest.java:41)
> >     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:585)
> >     at junit.framework.TestCase.runTest(TestCase.java:154)
> >     at junit.framework.TestCase.runBare(TestCase.java:127)
> >     at
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
> >     at junit.framework.TestResult$1.protect(TestResult.java:106)
> >     at junit.framework.TestResult.runProtected(TestResult.java:124)
> >     at junit.framework.TestResult.run(TestResult.java:109)
> >     at junit.framework.TestCase.run(TestCase.java:118)
> >     at junit.framework.TestSuite.runTest(TestSuite.java:208)
> >     at junit.framework.TestSuite.run(TestSuite.java:203)
> >     at
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
> >     at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> >     at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> >     at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> >     at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> >     at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> > Caused by: java.lang.RuntimeException: Could not instantiate
> SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException): is the
> version of xbean.jar correct?
> >     at
> schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.TypeSystemHolder.loadTypeSystem(Unknown
> Source)
> >     at
> schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.TypeSystemHolder.<clinit>(Unknown
> Source)
> >     ... 31 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:494)
> >     ... 33 more
> > Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS
> compiled schema: Incompatible minor version - expecting up to 23, got 24
> (schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.index) -
> code 3
> >     at
> org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.<init>(SchemaTypeSystemImpl.java:1522)
> >     at
> org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(SchemaTypeSystemImpl.java:260)
> >     at
> org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.<init>(SchemaTypeSystemImpl.java:183)
> >     ... 37 more
> >
> >
> >
> >
> >
>
>



-- 
I'm competing in a Half-Ironman distance triathlon to raise money for
the fight against cancer!
Please help support my efforts by going to:
http://www.active.com/donate/tntwaak/jacobd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: Help - Maven2 with XMLBean Integration

Posted by David Jencks <da...@yahoo.com>.
That's the maven 1 xmlbeans 2 plugin.

The maven 2 xmlbeans 2 plugin is at codehaus.  Docs are:

http://mojo.codehaus.org/xmlbeans-maven-plugin/

thanks
david jencks


On Mar 6, 2008, at 9:27 PM, Jacob Danner wrote:

> This is documented in the src. You can access it online at:
> http://svn.apache.org/viewvc/xmlbeans/trunk/maven-plugin/ 
> INSTRUCTIONS.txt?revision=220227&view=markup
>
> -jacobd
>
> On Thu, Mar 6, 2008 at 9:05 PM,  <sa...@wipro.com> wrote:
>>
>>
>> Hi Friends,
>>
>>     I am using XMLBeans to parse some XML Documents for this I  
>> want to
>> generate Java classes from xsd by using XMLBean. In my project, we  
>> are using
>> maven2 for building, So I want to add this generation of java  
>> classes from
>> xsd to be included in the maven build.
>>
>>     I plan to use maven-xmlbean-plugin. I have no idea about how to
>> configure maven repository to have XMLBeans support, etc.
>>
>>     Pls, Help me to solve this issue.
>>
>>
>> Thanks,
>> P.Sathish kumar
>>
>> The information contained in this electronic message and any  
>> attachments to
>> this message are intended for the exclusive use of the addressee 
>> (s) and may
>> contain proprietary, confidential or privileged information. If  
>> you are not
>> the intended recipient, you should not disseminate, distribute or  
>> copy this
>> e-mail. Please notify the sender immediately and destroy all  
>> copies of this
>> message and any attachments.
>>
>> WARNING: Computer viruses can be transmitted via email. The  
>> recipient should
>> check this email and any attachments for the presence of viruses. The
>> company accepts no liability for any damage caused by any virus  
>> transmitted
>> by this email.
>>
>> www.wipro.com
>
>
>
> -- 
> I'm competing in a Half-Ironman distance triathlon to raise money for
> the fight against cancer!
> Please help support my efforts by going to:
> http://www.active.com/donate/tntwaak/jacobd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>


Re: Help - Maven2 with XMLBean Integration

Posted by Jacob Danner <ja...@gmail.com>.
This is documented in the src. You can access it online at:
http://svn.apache.org/viewvc/xmlbeans/trunk/maven-plugin/INSTRUCTIONS.txt?revision=220227&view=markup

-jacobd

On Thu, Mar 6, 2008 at 9:05 PM,  <sa...@wipro.com> wrote:
>
>
> Hi Friends,
>
>     I am using XMLBeans to parse some XML Documents for this I want to
> generate Java classes from xsd by using XMLBean. In my project, we are using
> maven2 for building, So I want to add this generation of java classes from
> xsd to be included in the maven build.
>
>     I plan to use maven-xmlbean-plugin. I have no idea about how to
> configure maven repository to have XMLBeans support, etc.
>
>     Pls, Help me to solve this issue.
>
>
> Thanks,
> P.Sathish kumar
>
> The information contained in this electronic message and any attachments to
> this message are intended for the exclusive use of the addressee(s) and may
> contain proprietary, confidential or privileged information. If you are not
> the intended recipient, you should not disseminate, distribute or copy this
> e-mail. Please notify the sender immediately and destroy all copies of this
> message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient should
> check this email and any attachments for the presence of viruses. The
> company accepts no liability for any damage caused by any virus transmitted
> by this email.
>
> www.wipro.com



-- 
I'm competing in a Half-Ironman distance triathlon to raise money for
the fight against cancer!
Please help support my efforts by going to:
http://www.active.com/donate/tntwaak/jacobd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Help - Maven2 with XMLBean Integration

Posted by sa...@wipro.com.
Hi Friends,
 
    I am using XMLBeans to parse some XML Documents for this I want to
generate Java classes from xsd by using XMLBean. In my project, we are
using maven2 for building, So I want to add this generation of java
classes from xsd to be included in the maven build.
 
    I plan to use maven-xmlbean-plugin. I have no idea about how to
configure maven repository to have XMLBeans support, etc.
 
    Pls, Help me to solve this issue. 
 
 
Thanks,
P.Sathish kumar 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com


Re: Help with integrating maven2 plugin and apache

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
Thanks Todd for sharing this on the list.

Radu

On Wed, 2008-02-13 at 13:15 -0500, Todd Nine wrote:
> Hi guys,
>   I wanted to thank everyone for their help.  I finally got it
> working.  Basically, I used the plugin and dependencies below only.
> Then I just added the jar that is generated by the plugin to the
> eclipse classpath manually.  Once I did that, everything worked!
> 
> 
> 
>     <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>xmlbeans-maven-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>xmlbeans</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>                 <inherited>true</inherited>
>                 <configuration>
>                     <schemaDirectory>src/main/xsd</schemaDirectory>
>                     <download>true</download>
>                     <outputJar>
>                         target/eclipse/xmlbeans-eclipse-runtime.jar
>                     </outputJar>
>                     <javaSource>1.5</javaSource>
>                 </configuration>
>             </plugin>
>         </plugins>
>     </build>
>     <dependencies>
>         <dependency>
>             <groupId>xmlbeans</groupId>
>             <artifactId>xmlbeans</artifactId>
>             <version>2.3.0</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>stax</groupId>
>             <artifactId>stax</artifactId>
>             <version>1.2.0</version>
>         </dependency>
> 
> 
> 
> 
> On Feb 11, 2008 2:44 PM, Todd Nine <to...@gmail.com> wrote:
>         Thanks for the feedback guys.  I haven't tried the plugin
>         below, but wouldn't using the maven 2 plugin to generate a
>         jar, then pointing Eclipse to it accomplish the same thing?
>         This is what I have for my pom.  If I look at the class files
>         that are created within the jar, they're the same ones that
>         are getting copied with the plugin you suggested.  Any ideas
>         why it works when you use the plugin, but why the jar that
>         appears to have the same binaries doesn't? 
>         
>         
>         <plugin>
>                         <groupId>org.codehaus.mojo</groupId>
>                         <artifactId>xmlbeans-maven-plugin</artifactId>
>                         <executions>
>                             <execution>
>                                 <goals>
>                                     <goal>xmlbeans</goal>
>                                 </goals>
>                             </execution>
>                         </executions>
>                         <inherited>true</inherited>
>                         <configuration>
>         
>         <schemaDirectory>src/main/xsd</schemaDirectory>
>                             <download>true</download>
>                             <outputJar>
>         
>         target/eclipse/xmlbeans-eclipse-runtime.jar
>                             </outputJar>
>         
>                             <javaSource>1.5</javaSource>
>                             <!-- <noJavac>true</noJavac> -->
>                         </configuration>
>                     </plugin>
>         
>         Dependencies
>         
>         <dependencies>
>                 <dependency>
>                     <groupId>xmlbeans</groupId>
>                     <artifactId>xbean</artifactId>
>                     <version>2.2.0</version>
>                 </dependency>
>         
>                 <dependency>
>                     <groupId>stax</groupId>
>                     <artifactId>stax</artifactId>
>                     <version>1.2.0</version>
>                 </dependency>
>         ...
>         </dependencies>
>         
>         
>         
>         
>         On Feb 11, 2008 1:27 AM, David Jencks <da...@yahoo.com>
>         wrote:
>                 I don't use eclipse.  Apparently the eclipse doesn't
>                 work well with maven plugins that generate binary code
>                 that eclipse is supposed to recognize but not compile
>                 itself.  In geronimo we've written a plugin that IIUC
>                 copies the generated code to a location that eclipse
>                 can find.  A typical use of the xmlbeans plugin looks
>                 like:
>                 
>                 
>                     <build>
>                         <plugins>
>                             <plugin>
>                                 <groupId>org.codehaus.mojo</groupId>
>                 
>                  <artifactId>xmlbeans-maven-plugin</artifactId>
>                             </plugin>
>                             
>                             <!--
>                             HACK: Copy XmlBeans generated schemas.
>                             -->
>                             <plugin>
>                 
>                  <groupId>org.apache.geronimo.plugins</groupId>
>                 
>                  <artifactId>geronimo-maven-plugin</artifactId>
>                 <version>2.0.2</version>
>                                 <executions>
>                                     <execution>
>                                         <goals>
>                 
>                  <goal>copy-xmlbeans-schemas</goal>
>                                         </goals>
>                                     </execution>
>                                 </executions>
>                             </plugin>
>                         </plugins>
>                     </build>
>                 
>                 
>                 The next release of this geronimo plugin (probably
>                 next wednesday) will be 
>                 
>                 
>                 
>                  <groupId>org.apache.geronimo.buildsupport</groupId>
>                 
>                  <artifactId>buildsupport-maven-plugin</artifactId>
>                 <version>2.1.0</version>
>                 
>                 
>                 The trunk source code is
>                  at https://svn.apache.org/repos/asf/geronimo/server/trunk/buildsupport/buildsupport-maven-plugin.  I don't think it has changed over the last few releases.
>                 
>                 
>                 Hope this is relevant to the problems you are having.
>                 
>                 
>                 thanks
>                 david jencks
>                 
>                 
>                 
>                 On Feb 10, 2008, at 6:21 PM, Todd Nine wrote:
>                 
>                 > Bump,
>                 >   I've been struggling with this for 2 days.  Note
>                 > that my title is incorrect, is should say
>                 > integrating maven 2 plugin and Eclipse.  I've tried
>                 > downgrading xmlbeans.xbean from 2.2.0 to 2.1.0,
>                 > which didn't fix my issue.  If I choose a version
>                 > less than 2.1.0, the plugin completely blows up due
>                 > to deprecation problems.  Has anyone successfully
>                 > used this plugin with an Eclipse environment?  If so
>                 > how did you do it?  This is immensely frustrating,
>                 > and I don't want to use JAXB, but I'm running out of
>                 > time to get XML Beans working.
>                 > 
>                 > 
>                 > Thanks,
>                 > Todd
>                 > 
>                 > On Feb 8, 2008 1:03 PM, Todd Nine
>                 > <to...@gmail.com> wrote:
>                 >         Hi All,
>                 >           I'm using XML Beans version 2.2.0, and I'm
>                 >         trying to run my code through the Eclipse
>                 >         debugger.  Its failing, and I receive the
>                 >         following errors.  I've included my maven
>                 >         plugin 2 configuration, but basically I'm
>                 >         having the plugin create a jar of the
>                 >         classes that will be deployed, and including
>                 >         it into my classpath in Eclipse.  Any idea
>                 >         why I'm getting this error?  I'm using the
>                 >         same jdk for both maven, and eclipse, so I'm
>                 >         not sure why I'm getting the class version
>                 >         issues.
>                 >         
>                 >         Thanks,
>                 >         Todd
>                 >         
>                 >         Maven plugin configuration:
>                 >         <plugin>
>                 >         
>                 >         <groupId>org.codehaus.mojo</groupId>
>                 >         
>                 >         <artifactId>xmlbeans-maven-plugin</artifactId>
>                 >                         <executions>
>                 >                             <execution>
>                 >                                 <goals>
>                 >         
>                 >         <goal>xmlbeans</goal>
>                 >                                 </goals>
>                 >                             </execution>
>                 >                         </executions>
>                 >                         <inherited>true</inherited>
>                 >                         <configuration>
>                 >         
>                 >         <schemaDirectory>src/main/xsd</schemaDirectory>
>                 >         
>                 >         <download>true</download>
>                 >         
>                 >         <outputJar>target/eclipse/xmlbeans-eclipse-runtime.jar</outputJar>
>                 >                         </configuration>
>                 >         
>                 >         Exception stacktrace:
>                 >         
>                 >         java.lang.ExceptionInInitializerError
>                 >             at
>                 >         sun.misc.Unsafe.ensureClassInitialized(Native Method)
>                 >             at
>                 >         sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
>                 >             at
>                 >         sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
>                 >             at
>                 >         java.lang.reflect.Field.acquireFieldAccessor(Field.java:917)
>                 >             at
>                 >         java.lang.reflect.Field.getFieldAccessor(Field.java:898)
>                 >             at
>                 >         java.lang.reflect.Field.get(Field.java:357)
>                 >             at
>                 >         org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:770)
>                 >             at
>                 >         com.onwebconsulting.urchin.profiles.ProfilesDocument.<clinit>(Unknown Source)
>                 >             at
>                 >         com.onwebconsulting.urchin.profiles.ProfilesDocument$Factory.parse(Unknown Source)
>                 >             at
>                 >         com.bnp.insightCommon.dao.rest.UrchinDaoImpl.getProfiles(UrchinDaoImpl.java:81)
>                 >             at
>                 >         com.bnp.insightCommon.dao.UrchinDaoTest.getProfiles(UrchinDaoTest.java:54)
>                 >             at
>                 >         com.bnp.insightCommon.dao.UrchinDaoTest.testGetProfiles(UrchinDaoTest.java:41)
>                 >             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:585)
>                 >             at
>                 >         junit.framework.TestCase.runTest(TestCase.java:154)
>                 >             at
>                 >         junit.framework.TestCase.runBare(TestCase.java:127)
>                 >             at
>                 >         org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
>                 >             at junit.framework.TestResult
>                 >         $1.protect(TestResult.java:106)
>                 >             at
>                 >         junit.framework.TestResult.runProtected(TestResult.java:124)
>                 >             at
>                 >         junit.framework.TestResult.run(TestResult.java:109)
>                 >             at
>                 >         junit.framework.TestCase.run(TestCase.java:118)
>                 >             at
>                 >         junit.framework.TestSuite.runTest(TestSuite.java:208)
>                 >             at
>                 >         junit.framework.TestSuite.run(TestSuite.java:203)
>                 >             at
>                 >         org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
>                 >             at
>                 >         org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>                 >             at
>                 >         org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>                 >             at
>                 >         org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>                 >             at
>                 >         org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>                 >             at
>                 >         org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>                 >         Caused by: java.lang.RuntimeException: Could
>                 >         not instantiate SchemaTypeSystemImpl
>                 >         (java.lang.reflect.InvocationTargetException): is the version of xbean.jar correct?
>                 >             at
>                 >         schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.TypeSystemHolder.loadTypeSystem(Unknown Source)
>                 >             at
>                 >         schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.TypeSystemHolder.<clinit>(Unknown Source)
>                 >             ... 31 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:494)
>                 >             ... 33 more
>                 >         Caused by:
>                 >         org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled schema: Incompatible minor version - expecting up to 23, got 24 (schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.index) - code 3
>                 >             at
>                 >         org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.<init>(SchemaTypeSystemImpl.java:1522)
>                 >             at
>                 >         org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(SchemaTypeSystemImpl.java:260)
>                 >             at
>                 >         org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.<init>(SchemaTypeSystemImpl.java:183)
>                 >             ... 37 more
>                 >         
>                 >         
>                 >         
>                 >         
>                 > 
>                 
>                 
>         
>         
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: Help with integrating maven2 plugin and apache

Posted by Todd Nine <to...@gmail.com>.
Hi guys,
  I wanted to thank everyone for their help.  I finally got it working.
Basically, I used the plugin and dependencies below only.  Then I just added
the jar that is generated by the plugin to the eclipse classpath manually.
Once I did that, everything worked!



    <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xmlbeans-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>xmlbeans</goal>
                        </goals>
                    </execution>
                </executions>
                <inherited>true</inherited>
                <configuration>
                    <schemaDirectory>src/main/xsd</schemaDirectory>
                    <download>true</download>
                    <outputJar>
                        target/eclipse/xmlbeans-eclipse-runtime.jar
                    </outputJar>
                    <javaSource>1.5</javaSource>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>2.3.0</version>
        </dependency>

        <dependency>
            <groupId>stax</groupId>
            <artifactId>stax</artifactId>
            <version>1.2.0</version>
        </dependency>




On Feb 11, 2008 2:44 PM, Todd Nine <to...@gmail.com> wrote:

> Thanks for the feedback guys.  I haven't tried the plugin below, but
> wouldn't using the maven 2 plugin to generate a jar, then pointing Eclipse
> to it accomplish the same thing?  This is what I have for my pom.  If I look
> at the class files that are created within the jar, they're the same ones
> that are getting copied with the plugin you suggested.  Any ideas why it
> works when you use the plugin, but why the jar that appears to have the same
> binaries doesn't?
>
> <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>xmlbeans-maven-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>xmlbeans</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>                 <inherited>true</inherited>
>                 <configuration>
>                     <schemaDirectory>src/main/xsd</schemaDirectory>
>                     <download>true</download>
>                     <outputJar>
>                         target/eclipse/xmlbeans-eclipse-runtime.jar
>                     </outputJar>
>                     <javaSource>1.5</javaSource>
>                     <!-- <noJavac>true</noJavac> -->
>                 </configuration>
>             </plugin>
>
> Dependencies
>
> <dependencies>
>         <dependency>
>             <groupId>xmlbeans</groupId>
>             <artifactId>xbean</artifactId>
>             <version>2.2.0</version>
>         </dependency>
>
>         <dependency>
>             <groupId>stax</groupId>
>             <artifactId>stax</artifactId>
>             <version>1.2.0</version>
>         </dependency>
> ...
> </dependencies>
>
>
>
> On Feb 11, 2008 1:27 AM, David Jencks <da...@yahoo.com> wrote:
>
> > I don't use eclipse.  Apparently the eclipse doesn't work well with
> > maven plugins that generate binary code that eclipse is supposed to
> > recognize but not compile itself.  In geronimo we've written a plugin that
> > IIUC copies the generated code to a location that eclipse can find.  A
> > typical use of the xmlbeans plugin looks like:
> >     <build>
> >         <plugins>
> >             <plugin>
> >                 <groupId>org.codehaus.mojo</groupId>
> >                 <artifactId>xmlbeans-maven-plugin</artifactId>
> >             </plugin>
> >
> >             <!--
> >             HACK: Copy XmlBeans generated schemas.
> >             -->
> >             <plugin>
> >                 <groupId>org.apache.geronimo.plugins</groupId>
> >                 <artifactId>geronimo-maven-plugin</artifactId>
> > <version>2.0.2</version>
> >                 <executions>
> >                     <execution>
> >                         <goals>
> >                             <goal>copy-xmlbeans-schemas</goal>
> >                         </goals>
> >                     </execution>
> >                 </executions>
> >             </plugin>
> >         </plugins>
> >     </build>
> >
> > The next release of this geronimo plugin (probably next wednesday) will
> > be
> >
> >                 <groupId>org.apache.geronimo.buildsupport</groupId>
> >                 <artifactId>buildsupport-maven-plugin</artifactId>
> > <version>2.1.0</version>
> >
> > The trunk source code is  at
> > https://svn.apache.org/repos/asf/geronimo/server/trunk/buildsupport/buildsupport-maven-plugin.
> >  I don't think it has changed over the last few releases.
> >
> > Hope this is relevant to the problems you are having.
> >
> > thanks
> > david jencks
> >
> > On Feb 10, 2008, at 6:21 PM, Todd Nine wrote:
> >
> > Bump,
> >   I've been struggling with this for 2 days.  Note that my title is
> > incorrect, is should say integrating maven 2 plugin and Eclipse.  I've tried
> > downgrading xmlbeans.xbean from 2.2.0 to 2.1.0, which didn't fix my
> > issue.  If I choose a version less than 2.1.0, the plugin completely
> > blows up due to deprecation problems.  Has anyone successfully used this
> > plugin with an Eclipse environment?  If so how did you do it?  This is
> > immensely frustrating, and I don't want to use JAXB, but I'm running out of
> > time to get XML Beans working.
> >
> >
> > Thanks,
> > Todd
> >
> > On Feb 8, 2008 1:03 PM, Todd Nine <to...@gmail.com> wrote:
> >
> > > Hi All,
> > >   I'm using XML Beans version 2.2.0, and I'm trying to run my code
> > > through the Eclipse debugger.  Its failing, and I receive the following
> > > errors.  I've included my maven plugin 2 configuration, but basically I'm
> > > having the plugin create a jar of the classes that will be deployed, and
> > > including it into my classpath in Eclipse.  Any idea why I'm getting this
> > > error?  I'm using the same jdk for both maven, and eclipse, so I'm not sure
> > > why I'm getting the class version issues.
> > >
> > > Thanks,
> > > Todd
> > >
> > > Maven plugin configuration:
> > > <plugin>
> > >                 <groupId>org.codehaus.mojo</groupId>
> > >                 <artifactId>xmlbeans-maven-plugin</artifactId>
> > >                 <executions>
> > >                     <execution>
> > >                         <goals>
> > >                             <goal>xmlbeans</goal>
> > >                         </goals>
> > >                     </execution>
> > >                 </executions>
> > >                 <inherited>true</inherited>
> > >                 <configuration>
> > >                     <schemaDirectory>src/main/xsd</schemaDirectory>
> > >                     <download>true</download>
> > >                     <outputJar>target/eclipse/xmlbeans-
> > > eclipse-runtime.jar</outputJar>
> > >                 </configuration>
> > >
> > > Exception stacktrace:
> > >
> > > java.lang.ExceptionInInitializerError
> > >     at sun.misc.Unsafe.ensureClassInitialized(Native Method)
> > >     at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(
> > > UnsafeFieldAccessorFactory.java:25)
> > >     at sun.reflect.ReflectionFactory.newFieldAccessor(
> > > ReflectionFactory.java:122)
> > >     at java.lang.reflect.Field.acquireFieldAccessor(Field.java:917)
> > >     at java.lang.reflect.Field.getFieldAccessor(Field.java:898)
> > >     at java.lang.reflect.Field.get(Field.java:357)
> > >     at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(
> > > XmlBeans.java:770)
> > >     at com.onwebconsulting.urchin.profiles.ProfilesDocument.<clinit>(Unknown
> > > Source)
> > >     at
> > > com.onwebconsulting.urchin.profiles.ProfilesDocument$Factory.parse(Unknown
> > > Source)
> > >     at com.bnp.insightCommon.dao.rest.UrchinDaoImpl.getProfiles(
> > > UrchinDaoImpl.java:81)
> > >     at com.bnp.insightCommon.dao.UrchinDaoTest.getProfiles(
> > > UrchinDaoTest.java:54)
> > >     at com.bnp.insightCommon.dao.UrchinDaoTest.testGetProfiles(
> > > UrchinDaoTest.java:41)
> > >     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:585)
> > >     at junit.framework.TestCase.runTest(TestCase.java:154)
> > >     at junit.framework.TestCase.runBare(TestCase.java:127)
> > >     at org.springframework.test.ConditionalTestCase.runBare(
> > > ConditionalTestCase.java:69)
> > >     at junit.framework.TestResult$1.protect(TestResult.java:106)
> > >     at junit.framework.TestResult.runProtected(TestResult.java:124)
> > >     at junit.framework.TestResult.run(TestResult.java:109)
> > >     at junit.framework.TestCase.run(TestCase.java:118)
> > >     at junit.framework.TestSuite.runTest(TestSuite.java:208)
> > >     at junit.framework.TestSuite.run(TestSuite.java:203)
> > >     at
> > > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(
> > > JUnit3TestReference.java:130)
> > >     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> > > TestExecution.java:38)
> > >     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
> > > (RemoteTestRunner.java:460)
> > >     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
> > > (RemoteTestRunner.java:673)
> > >     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> > > RemoteTestRunner.java:386)
> > >     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> > > RemoteTestRunner.java:196)
> > > Caused by: java.lang.RuntimeException: Could not instantiate
> > > SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException): is
> > > the version of xbean.jar correct?
> > >     at
> > > schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.TypeSystemHolder.loadTypeSystem(Unknown
> > > Source)
> > >     at
> > > schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.TypeSystemHolder.<clinit>(Unknown
> > > Source)
> > >     ... 31 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:494)
> > >     ... 33 more
> > > Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS
> > > compiled schema: Incompatible minor version - expecting up to 23, got 24
> > > (schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.index) -
> > > code 3
> > >     at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader
> > > .<init>(SchemaTypeSystemImpl.java:1522)
> > >     at
> > > org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(
> > > SchemaTypeSystemImpl.java:260)
> > >     at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.<init>(
> > > SchemaTypeSystemImpl.java:183)
> > >     ... 37 more
> > >
> > >
> > >
> > >
> > >
> >
> >
>

Re: Help with integrating maven2 plugin and apache

Posted by Todd Nine <to...@gmail.com>.
Thanks for the feedback guys.  I haven't tried the plugin below, but
wouldn't using the maven 2 plugin to generate a jar, then pointing Eclipse
to it accomplish the same thing?  This is what I have for my pom.  If I look
at the class files that are created within the jar, they're the same ones
that are getting copied with the plugin you suggested.  Any ideas why it
works when you use the plugin, but why the jar that appears to have the same
binaries doesn't?

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xmlbeans-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>xmlbeans</goal>
                        </goals>
                    </execution>
                </executions>
                <inherited>true</inherited>
                <configuration>
                    <schemaDirectory>src/main/xsd</schemaDirectory>
                    <download>true</download>
                    <outputJar>
                        target/eclipse/xmlbeans-eclipse-runtime.jar
                    </outputJar>
                    <javaSource>1.5</javaSource>
                    <!-- <noJavac>true</noJavac> -->
                </configuration>
            </plugin>

Dependencies

<dependencies>
        <dependency>
            <groupId>xmlbeans</groupId>
            <artifactId>xbean</artifactId>
            <version>2.2.0</version>
        </dependency>

        <dependency>
            <groupId>stax</groupId>
            <artifactId>stax</artifactId>
            <version>1.2.0</version>
        </dependency>
...
</dependencies>


On Feb 11, 2008 1:27 AM, David Jencks <da...@yahoo.com> wrote:

> I don't use eclipse.  Apparently the eclipse doesn't work well with maven
> plugins that generate binary code that eclipse is supposed to recognize but
> not compile itself.  In geronimo we've written a plugin that IIUC copies the
> generated code to a location that eclipse can find.  A typical use of the
> xmlbeans plugin looks like:
>     <build>
>         <plugins>
>             <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>xmlbeans-maven-plugin</artifactId>
>             </plugin>
>
>             <!--
>             HACK: Copy XmlBeans generated schemas.
>             -->
>             <plugin>
>                 <groupId>org.apache.geronimo.plugins</groupId>
>                 <artifactId>geronimo-maven-plugin</artifactId>
> <version>2.0.2</version>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>copy-xmlbeans-schemas</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
>     </build>
>
> The next release of this geronimo plugin (probably next wednesday) will
> be
>
>                 <groupId>org.apache.geronimo.buildsupport</groupId>
>                 <artifactId>buildsupport-maven-plugin</artifactId>
> <version>2.1.0</version>
>
> The trunk source code is  at
> https://svn.apache.org/repos/asf/geronimo/server/trunk/buildsupport/buildsupport-maven-plugin.
>  I don't think it has changed over the last few releases.
>
> Hope this is relevant to the problems you are having.
>
> thanks
> david jencks
>
> On Feb 10, 2008, at 6:21 PM, Todd Nine wrote:
>
> Bump,
>   I've been struggling with this for 2 days.  Note that my title is
> incorrect, is should say integrating maven 2 plugin and Eclipse.  I've tried
> downgrading xmlbeans.xbean from 2.2.0 to 2.1.0, which didn't fix my
> issue.  If I choose a version less than 2.1.0, the plugin completely blows
> up due to deprecation problems.  Has anyone successfully used this plugin
> with an Eclipse environment?  If so how did you do it?  This is immensely
> frustrating, and I don't want to use JAXB, but I'm running out of time to
> get XML Beans working.
>
>
> Thanks,
> Todd
>
> On Feb 8, 2008 1:03 PM, Todd Nine <to...@gmail.com> wrote:
>
> > Hi All,
> >   I'm using XML Beans version 2.2.0, and I'm trying to run my code
> > through the Eclipse debugger.  Its failing, and I receive the following
> > errors.  I've included my maven plugin 2 configuration, but basically I'm
> > having the plugin create a jar of the classes that will be deployed, and
> > including it into my classpath in Eclipse.  Any idea why I'm getting this
> > error?  I'm using the same jdk for both maven, and eclipse, so I'm not sure
> > why I'm getting the class version issues.
> >
> > Thanks,
> > Todd
> >
> > Maven plugin configuration:
> > <plugin>
> >                 <groupId>org.codehaus.mojo</groupId>
> >                 <artifactId>xmlbeans-maven-plugin</artifactId>
> >                 <executions>
> >                     <execution>
> >                         <goals>
> >                             <goal>xmlbeans</goal>
> >                         </goals>
> >                     </execution>
> >                 </executions>
> >                 <inherited>true</inherited>
> >                 <configuration>
> >                     <schemaDirectory>src/main/xsd</schemaDirectory>
> >                     <download>true</download>
> >                     <outputJar>target/eclipse/xmlbeans-
> > eclipse-runtime.jar</outputJar>
> >                 </configuration>
> >
> > Exception stacktrace:
> >
> > java.lang.ExceptionInInitializerError
> >     at sun.misc.Unsafe.ensureClassInitialized(Native Method)
> >     at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(
> > UnsafeFieldAccessorFactory.java:25)
> >     at sun.reflect.ReflectionFactory.newFieldAccessor(
> > ReflectionFactory.java:122)
> >     at java.lang.reflect.Field.acquireFieldAccessor(Field.java:917)
> >     at java.lang.reflect.Field.getFieldAccessor(Field.java:898)
> >     at java.lang.reflect.Field.get(Field.java:357)
> >     at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(
> > XmlBeans.java:770)
> >     at com.onwebconsulting.urchin.profiles.ProfilesDocument.<clinit>(Unknown
> > Source)
> >     at
> > com.onwebconsulting.urchin.profiles.ProfilesDocument$Factory.parse(Unknown
> > Source)
> >     at com.bnp.insightCommon.dao.rest.UrchinDaoImpl.getProfiles(
> > UrchinDaoImpl.java:81)
> >     at com.bnp.insightCommon.dao.UrchinDaoTest.getProfiles(
> > UrchinDaoTest.java:54)
> >     at com.bnp.insightCommon.dao.UrchinDaoTest.testGetProfiles(
> > UrchinDaoTest.java:41)
> >     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:585)
> >     at junit.framework.TestCase.runTest(TestCase.java:154)
> >     at junit.framework.TestCase.runBare(TestCase.java:127)
> >     at org.springframework.test.ConditionalTestCase.runBare(
> > ConditionalTestCase.java:69)
> >     at junit.framework.TestResult$1.protect(TestResult.java:106)
> >     at junit.framework.TestResult.runProtected(TestResult.java:124)
> >     at junit.framework.TestResult.run(TestResult.java:109)
> >     at junit.framework.TestCase.run(TestCase.java:118)
> >     at junit.framework.TestSuite.runTest(TestSuite.java:208)
> >     at junit.framework.TestSuite.run(TestSuite.java:203)
> >     at
> > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(
> > JUnit3TestReference.java:130)
> >     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> > TestExecution.java:38)
> >     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> > RemoteTestRunner.java:460)
> >     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> > RemoteTestRunner.java:673)
> >     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> > RemoteTestRunner.java:386)
> >     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> > RemoteTestRunner.java:196)
> > Caused by: java.lang.RuntimeException: Could not instantiate
> > SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException): is
> > the version of xbean.jar correct?
> >     at
> > schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.TypeSystemHolder.loadTypeSystem(Unknown
> > Source)
> >     at
> > schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.TypeSystemHolder.<clinit>(Unknown
> > Source)
> >     ... 31 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:494)
> >     ... 33 more
> > Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS
> > compiled schema: Incompatible minor version - expecting up to 23, got 24
> > (schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.index) -
> > code 3
> >     at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader
> > .<init>(SchemaTypeSystemImpl.java:1522)
> >     at
> > org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(
> > SchemaTypeSystemImpl.java:260)
> >     at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.<init>(
> > SchemaTypeSystemImpl.java:183)
> >     ... 37 more
> >
> >
> >
> >
> >
>
>

Re: Help with integrating maven2 plugin and apache

Posted by David Jencks <da...@yahoo.com>.
I don't use eclipse.  Apparently the eclipse doesn't work well with  
maven plugins that generate binary code that eclipse is supposed to  
recognize but not compile itself.  In geronimo we've written a plugin  
that IIUC copies the generated code to a location that eclipse can  
find.  A typical use of the xmlbeans plugin looks like:

     <build>
         <plugins>
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>xmlbeans-maven-plugin</artifactId>
             </plugin>

             <!--
             HACK: Copy XmlBeans generated schemas.
             -->
             <plugin>
                 <groupId>org.apache.geronimo.plugins</groupId>
                 <artifactId>geronimo-maven-plugin</artifactId>
<version>2.0.2</version>
                 <executions>
                     <execution>
                         <goals>
                             <goal>copy-xmlbeans-schemas</goal>
                         </goals>
                     </execution>
                 </executions>
             </plugin>
         </plugins>
     </build>

The next release of this geronimo plugin (probably next wednesday)  
will be

                 <groupId>org.apache.geronimo.buildsupport</groupId>
                 <artifactId>buildsupport-maven-plugin</artifactId>
<version>2.1.0</version>

The trunk source code is  at https://svn.apache.org/repos/asf/ 
geronimo/server/trunk/buildsupport/buildsupport-maven-plugin.  I  
don't think it has changed over the last few releases.

Hope this is relevant to the problems you are having.

thanks
david jencks

On Feb 10, 2008, at 6:21 PM, Todd Nine wrote:

> Bump,
>   I've been struggling with this for 2 days.  Note that my title is  
> incorrect, is should say integrating maven 2 plugin and Eclipse.   
> I've tried downgrading xmlbeans.xbean from 2.2.0 to 2.1.0, which  
> didn't fix my issue.  If I choose a version less than 2.1.0, the  
> plugin completely blows up due to deprecation problems.  Has anyone  
> successfully used this plugin with an Eclipse environment?  If so  
> how did you do it?  This is immensely frustrating, and I don't want  
> to use JAXB, but I'm running out of time to get XML Beans working.
>
>
> Thanks,
> Todd
>
> On Feb 8, 2008 1:03 PM, Todd Nine <to...@gmail.com> wrote:
> Hi All,
>   I'm using XML Beans version 2.2.0, and I'm trying to run my code  
> through the Eclipse debugger.  Its failing, and I receive the  
> following errors.  I've included my maven plugin 2 configuration,  
> but basically I'm having the plugin create a jar of the classes  
> that will be deployed, and including it into my classpath in  
> Eclipse.  Any idea why I'm getting this error?  I'm using the same  
> jdk for both maven, and eclipse, so I'm not sure why I'm getting  
> the class version issues.
>
> Thanks,
> Todd
>
> Maven plugin configuration:
> <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>xmlbeans-maven-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>xmlbeans</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>                 <inherited>true</inherited>
>                 <configuration>
>                     <schemaDirectory>src/main/xsd</schemaDirectory>
>                     <download>true</download>
>                     <outputJar>target/eclipse/xmlbeans-eclipse- 
> runtime.jar</outputJar>
>                 </configuration>
>
> Exception stacktrace:
>
> java.lang.ExceptionInInitializerError
>     at sun.misc.Unsafe.ensureClassInitialized(Native Method)
>     at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor 
> (UnsafeFieldAccessorFactory.java:25)
>     at sun.reflect.ReflectionFactory.newFieldAccessor 
> (ReflectionFactory.java:122)
>     at java.lang.reflect.Field.acquireFieldAccessor(Field.java:917)
>     at java.lang.reflect.Field.getFieldAccessor(Field.java:898)
>     at java.lang.reflect.Field.get(Field.java:357)
>     at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader 
> (XmlBeans.java:770)
>     at com.onwebconsulting.urchin.profiles.ProfilesDocument.<clinit> 
> (Unknown Source)
>     at com.onwebconsulting.urchin.profiles.ProfilesDocument 
> $Factory.parse(Unknown Source)
>     at com.bnp.insightCommon.dao.rest.UrchinDaoImpl.getProfiles 
> (UrchinDaoImpl.java:81)
>     at com.bnp.insightCommon.dao.UrchinDaoTest.getProfiles 
> (UrchinDaoTest.java:54)
>     at com.bnp.insightCommon.dao.UrchinDaoTest.testGetProfiles 
> (UrchinDaoTest.java:41)
>     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:585)
>     at junit.framework.TestCase.runTest(TestCase.java:154)
>     at junit.framework.TestCase.runBare(TestCase.java:127)
>     at org.springframework.test.ConditionalTestCase.runBare 
> (ConditionalTestCase.java:69)
>     at junit.framework.TestResult$1.protect(TestResult.java:106)
>     at junit.framework.TestResult.runProtected(TestResult.java:124)
>     at junit.framework.TestResult.run(TestResult.java:109)
>     at junit.framework.TestCase.run(TestCase.java:118)
>     at junit.framework.TestSuite.runTest(TestSuite.java:208)
>     at junit.framework.TestSuite.run(TestSuite.java:203)
>     at  
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run 
> (JUnit3TestReference.java:130)
>     at org.eclipse.jdt.internal.junit.runner.TestExecution.run 
> (TestExecution.java:38)
>     at  
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests 
> (RemoteTestRunner.java:460)
>     at  
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests 
> (RemoteTestRunner.java:673)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run 
> (RemoteTestRunner.java:386)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main 
> (RemoteTestRunner.java:196)
> Caused by: java.lang.RuntimeException: Could not instantiate  
> SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException):  
> is the version of xbean.jar correct?
>     at  
> schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.Typ 
> eSystemHolder.loadTypeSystem(Unknown Source)
>     at  
> schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.Typ 
> eSystemHolder.<clinit>(Unknown Source)
>     ... 31 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:494)
>     ... 33 more
> Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS  
> compiled schema: Incompatible minor version - expecting up to 23,  
> got 24  
> (schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.in 
> dex) - code 3
>     at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl 
> $XsbReader.<init>(SchemaTypeSystemImpl.java:1522)
>     at  
> org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader 
> (SchemaTypeSystemImpl.java:260)
>     at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.<init> 
> (SchemaTypeSystemImpl.java:183)
>     ... 37 more
>
>
>
>
>


Re: Help with integrating maven2 plugin and apache

Posted by Todd Nine <to...@gmail.com>.
Bump,
  I've been struggling with this for 2 days.  Note that my title is
incorrect, is should say integrating maven 2 plugin and Eclipse.  I've tried
downgrading xmlbeans.xbean from 2.2.0 to 2.1.0, which didn't fix my issue.
If I choose a version less than 2.1.0, the plugin completely blows up due to
deprecation problems.  Has anyone successfully used this plugin with an
Eclipse environment?  If so how did you do it?  This is immensely
frustrating, and I don't want to use JAXB, but I'm running out of time to
get XML Beans working.


Thanks,
Todd

On Feb 8, 2008 1:03 PM, Todd Nine <to...@gmail.com> wrote:

> Hi All,
>   I'm using XML Beans version 2.2.0, and I'm trying to run my code through
> the Eclipse debugger.  Its failing, and I receive the following errors.
> I've included my maven plugin 2 configuration, but basically I'm having the
> plugin create a jar of the classes that will be deployed, and including it
> into my classpath in Eclipse.  Any idea why I'm getting this error?  I'm
> using the same jdk for both maven, and eclipse, so I'm not sure why I'm
> getting the class version issues.
>
> Thanks,
> Todd
>
> Maven plugin configuration:
> <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>xmlbeans-maven-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>xmlbeans</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>                 <inherited>true</inherited>
>                 <configuration>
>                     <schemaDirectory>src/main/xsd</schemaDirectory>
>                     <download>true</download>
>                     <outputJar>target/eclipse/xmlbeans-eclipse-runtime.jar
> </outputJar>
>                 </configuration>
>
> Exception stacktrace:
>
> java.lang.ExceptionInInitializerError
>     at sun.misc.Unsafe.ensureClassInitialized(Native Method)
>     at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(
> UnsafeFieldAccessorFactory.java:25)
>     at sun.reflect.ReflectionFactory.newFieldAccessor(
> ReflectionFactory.java:122)
>     at java.lang.reflect.Field.acquireFieldAccessor(Field.java:917)
>     at java.lang.reflect.Field.getFieldAccessor(Field.java:898)
>     at java.lang.reflect.Field.get(Field.java:357)
>     at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java
> :770)
>     at com.onwebconsulting.urchin.profiles.ProfilesDocument.<clinit>(Unknown
> Source)
>     at com.onwebconsulting.urchin.profiles.ProfilesDocument$Factory.parse(Unknown
> Source)
>     at com.bnp.insightCommon.dao.rest.UrchinDaoImpl.getProfiles(
> UrchinDaoImpl.java:81)
>     at com.bnp.insightCommon.dao.UrchinDaoTest.getProfiles(
> UrchinDaoTest.java:54)
>     at com.bnp.insightCommon.dao.UrchinDaoTest.testGetProfiles(
> UrchinDaoTest.java:41)
>     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:585)
>     at junit.framework.TestCase.runTest(TestCase.java:154)
>     at junit.framework.TestCase.runBare(TestCase.java:127)
>     at org.springframework.test.ConditionalTestCase.runBare(
> ConditionalTestCase.java:69)
>     at junit.framework.TestResult$1.protect(TestResult.java:106)
>     at junit.framework.TestResult.runProtected(TestResult.java:124)
>     at junit.framework.TestResult.run(TestResult.java:109)
>     at junit.framework.TestCase.run(TestCase.java:118)
>     at junit.framework.TestSuite.runTest(TestSuite.java:208)
>     at junit.framework.TestSuite.run(TestSuite.java:203)
>     at
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(
> JUnit3TestReference.java:130)
>     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> TestExecution.java:38)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:460)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:673)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> RemoteTestRunner.java:386)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> RemoteTestRunner.java:196)
> Caused by: java.lang.RuntimeException: Could not instantiate
> SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException): is the
> version of xbean.jar correct?
>     at
> schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.TypeSystemHolder.loadTypeSystem(Unknown
> Source)
>     at
> schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.TypeSystemHolder.<clinit>(Unknown
> Source)
>     ... 31 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:494)
>     ... 33 more
> Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS
> compiled schema: Incompatible minor version - expecting up to 23, got 24
> (schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.index) -
> code 3
>     at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader
> .<init>(SchemaTypeSystemImpl.java:1522)
>     at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader
> (SchemaTypeSystemImpl.java:260)
>     at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.<init>(
> SchemaTypeSystemImpl.java:183)
>     ... 37 more
>
>
>
>
>