You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by hannehomuth <ha...@gmx.de> on 2009/07/22 12:21:56 UTC

Maven and XMLBeans, not best friends??

Hi to everyone,

I've trying and searching a lot of hours but could not find any solution
which worked for me.

I want to use xmlbeans in an project which uses maven as build tool. I've
configured the plugin in the pom.xml in this way

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xmlbeans-maven-plugin</artifactId>
                <version>2.1.0</version>
                <executions>
                    <execution>
                        <id>Build-XMLBeans</id>                       
                        <goals>
                            <goal>xmlbeans</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                   
<schemaDirectory>src/main/java/com/vw/ais/jobengine/propertytypes</schemaDirectory>
                   
<schemaDirectory>src/main/java/com/vw/ais/jobengine/configurations</schemaDirectory>
                   
<classGenerationDirectory>${project.build.directory}/generated-classes/xmlbeans</classGenerationDirectory>
                   
<sourceGenerationDirectory>${project.build.directory}/generated-sources/xmlbeans</sourceGenerationDirectory>                    
                    <verbose>true</verbose>
                </configuration>
            </plugin>

Furthermore I have declared some dependencies for xmlbeans

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

The project build will run successful, but when I try to run the app, I get
the good old 

Exception in thread "main" java.lang.ExceptionInInitializerError
        at
com.vw.ais.jobengine.validation.ConfigurationValidator.schematicValidation(ConfigurationValidator.java:98)
        at
com.vw.ais.jobengine.validation.ConfigurationValidator.validate(ConfigurationValidator.java:58)
        at com.vw.ais.jobengine.JobEngine.initialize(JobEngine.java:54)
        at com.vw.ais.jobengine.Test.main(Test.java:34)
Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable
to load class with name
schemaorg_apache_xmlbeans.system.s09447651F54C8102642F6478AB9428E3.TypeSystemHolder.
Make sure the generated binary files are on the classpath.
        at
org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783)
        at
com.vw.ais.jobengine.configurations.JobEngineDocument.<clinit>(JobEngineDocument.java:19)
        ... 4 more
Caused by: java.lang.ClassNotFoundException:
schemaorg_apache_xmlbeans.system.s09447651F54C8102642F6478AB9428E3.TypeSystemHolder
.......
.......

The Class
schemaorg_apache_xmlbeans.system.s09447651F54C8102642F6478AB9428E3.TypeSystemHolder
lies in the jar. 

What the hell is wrong here. Does anyone see what I'm doing wrong here.
Thx for suggestions
-- 
View this message in context: http://www.nabble.com/Maven-and-XMLBeans%2C-not-best-friends---tp24603611p24603611.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


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


RE: Maven and XMLBeans, not best friends??

Posted by hannehomuth <ha...@gmx.de>.
>Did you look at using the maven-plugin that's in XMLBeans tree?
>http://svn.apache.org/viewvc/xmlbeans/trunk/maven-plugin/

No not yet, I only tried the plugin which lies in the central maven
repository. 
But this didn't work, as I said already. We are using an ant task now, which
will be executed by maven. Because this works now and we are going to
release soon, I will try the new version of the xmlbeans plugin after the
release.

Thx to all

 
-- 
View this message in context: http://www.nabble.com/Maven-and-XMLBeans%2C-not-best-friends---tp24603611p24967490.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


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


RE: Maven and XMLBeans, not best friends??

Posted by Cezar Andrei <ce...@oracle.com>.
Did you look at using the maven-plugin that's in XMLBeans tree?
http://svn.apache.org/viewvc/xmlbeans/trunk/maven-plugin/

Cezar

> -----Original Message-----
> From: hannehomuth [mailto:hannehomuth1@gmx.de]
> Sent: Wednesday, July 22, 2009 5:22 AM
> To: user@xmlbeans.apache.org
> Subject: Maven and XMLBeans, not best friends??
> 
> 
> Hi to everyone,
> 
> I've trying and searching a lot of hours but could not find any solution
> which worked for me.
> 
> I want to use xmlbeans in an project which uses maven as build tool. I've
> configured the plugin in the pom.xml in this way
> 
> <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>xmlbeans-maven-plugin</artifactId>
>                 <version>2.1.0</version>
>                 <executions>
>                     <execution>
>                         <id>Build-XMLBeans</id>
>                         <goals>
>                             <goal>xmlbeans</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>                 <configuration>
> 
> <schemaDirectory>src/main/java/com/vw/ais/jobengine/propertytypes</schemaD
> irectory>
> 
> <schemaDirectory>src/main/java/com/vw/ais/jobengine/configurations</schema
> Directory>
> 
> <classGenerationDirectory>${project.build.directory}/generated-
> classes/xmlbeans</classGenerationDirectory>
> 
> <sourceGenerationDirectory>${project.build.directory}/generated-
> sources/xmlbeans</sourceGenerationDirectory>
>                     <verbose>true</verbose>
>                 </configuration>
>             </plugin>
> 
> Furthermore I have declared some dependencies for xmlbeans
> 
>  <dependencies>
>         <dependency>
>             <groupId>xmlbeans</groupId>
>             <artifactId>xmlbeans</artifactId>
>             <version>2.2.0</version>
>         </dependency>
>         <dependency>
>             <groupId>xmlbeans</groupId>
>             <artifactId>xbean</artifactId>
>             <version>2.1.0</version>
>         </dependency>
>     </dependencies>
> 
> The project build will run successful, but when I try to run the app, I
> get
> the good old
> 
> Exception in thread "main" java.lang.ExceptionInInitializerError
>         at
> com.vw.ais.jobengine.validation.ConfigurationValidator.schematicValidation
> (ConfigurationValidator.java:98)
>         at
> com.vw.ais.jobengine.validation.ConfigurationValidator.validate(Configurat
> ionValidator.java:58)
>         at com.vw.ais.jobengine.JobEngine.initialize(JobEngine.java:54)
>         at com.vw.ais.jobengine.Test.main(Test.java:34)
> Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem.
> Unable
> to load class with name
> schemaorg_apache_xmlbeans.system.s09447651F54C8102642F6478AB9428E3.TypeSys
> temHolder.
> Make sure the generated binary files are on the classpath.
>         at
> org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783)
>         at
> com.vw.ais.jobengine.configurations.JobEngineDocument.<clinit>(JobEngineDo
> cument.java:19)
>         ... 4 more
> Caused by: java.lang.ClassNotFoundException:
> schemaorg_apache_xmlbeans.system.s09447651F54C8102642F6478AB9428E3.TypeSys
> temHolder
> .......
> .......
> 
> The Class
> schemaorg_apache_xmlbeans.system.s09447651F54C8102642F6478AB9428E3.TypeSys
> temHolder
> lies in the jar.
> 
> What the hell is wrong here. Does anyone see what I'm doing wrong here.
> Thx for suggestions
> --
> View this message in context: http://www.nabble.com/Maven-and-XMLBeans%2C-
> not-best-friends---tp24603611p24603611.html
> Sent from the Xml Beans - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 

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


Re: Maven and XMLBeans, not best friends??

Posted by Andreas Loew <An...@Sun.COM>.
Jacob Barde schrieb:

> Might want to try a more recent version of the mojo xmlbeans plugin.  
> It's currently up to version 2.3.2, and it supports XMLBeans 2.4.0, 
> located on http://repository.codehaus.org/.

... and - just in case - please be aware of the fact that you still have 
the full freedom/flexibility to fall back to using the 
maven-antrun-plugin and "good old" XMLBeans Ant tasks... ;-)

-- 
Andreas Loew
Senior Java Architect
Sun Microsystems (Germany)

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


Re: Maven and XMLBeans, not best friends??

Posted by Jacob Barde <ja...@swri.org>.
hannehomuth,

Might want to try a more recent version of the mojo xmlbeans plugin.  
It's currently up to version 2.3.2, and it supports XMLBeans 2.4.0, 
located on http://repository.codehaus.org/.

I use the following to generate source and compiled jars with success.  
One thing though, if you don't clean after a previous package command, 
the -sources.jar file won't be generated correctly.

Good luck,

Jay


//pom.xml BEGIN
<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/maven-v4_0_0.xsd">
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.3.2</version>
                <executions>
                    <execution>
                        <id />
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xmlbeans-maven-plugin</artifactId>
                <version>2.3.2</version>
                <executions>
                    <execution>
                        <id />
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>xmlbeans</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <schemaDirectory>src/main/xsd</schemaDirectory>
                    
<staleFile>${project.build.directory}/generated-sources/xmlbeans/.staleFlag</staleFile>
                    <verbose>false</verbose>
                    <quiet>false</quiet>
                    <javaSource>1.5</javaSource>
                    <!-- use this only if your schemata are nested in 
child folders, or are in a folder other than `src/main/xsd'
                    <sourceSchemas>
                        <sourceSchema>bar/foo.xsd</sourceSchema>
                        <sourceSchema>foo/bar.xsd</sourceSchema>
                    </sourceSchemas>
                    -->
                    <!-- again, use this only if your xsdconfig files 
are nested in child folders, or are in a folder other than 
`src/main/xsdconfig'
                    <xmlConfigs>
                        <xmlConfig 
implementation="java.io.File">src/main/xsd/bar/foo.xsdconfig</xmlConfig>
                        <xmlConfig 
implementation="java.io.File">src/main/xsd/foo/bar.xsdconfig</xmlConfig>
                    </xmlConfigs>
                    -->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xmlbeans-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id />
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>xmlbeans-test</goal>
                        </goals>
                    </execution>
                </executions>
                <inherited>true</inherited>
                <configuration>
                    <schemaDirectory>src/test/xsd</schemaDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>2.4.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans-qname</artifactId>
            <version>2.4.0</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans-xmlpublic</artifactId>
            <version>2.4.0</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jsr173_api</artifactId>
            <version>1.0</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>xml-resolver</groupId>
            <artifactId>xml-resolver</artifactId>
            <version>1.2</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.3.2</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</project>
//pom.xml END


hannehomuth wrote:
> Hi to everyone,
>
> I've trying and searching a lot of hours but could not find any solution
> which worked for me.
>
> I want to use xmlbeans in an project which uses maven as build tool. I've
> configured the plugin in the pom.xml in this way
>
> <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>xmlbeans-maven-plugin</artifactId>
>                 <version>2.1.0</version>
>                 <executions>
>                     <execution>
>                         <id>Build-XMLBeans</id>                       
>                         <goals>
>                             <goal>xmlbeans</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>                 <configuration>
>                    
> <schemaDirectory>src/main/java/com/vw/ais/jobengine/propertytypes</schemaDirectory>
>                    
> <schemaDirectory>src/main/java/com/vw/ais/jobengine/configurations</schemaDirectory>
>                    
> <classGenerationDirectory>${project.build.directory}/generated-classes/xmlbeans</classGenerationDirectory>
>                    
> <sourceGenerationDirectory>${project.build.directory}/generated-sources/xmlbeans</sourceGenerationDirectory>                    
>                     <verbose>true</verbose>
>                 </configuration>
>             </plugin>
>
> Furthermore I have declared some dependencies for xmlbeans
>
>  <dependencies>
>         <dependency>
>             <groupId>xmlbeans</groupId>
>             <artifactId>xmlbeans</artifactId>
>             <version>2.2.0</version>
>         </dependency>       
>         <dependency>
>             <groupId>xmlbeans</groupId>
>             <artifactId>xbean</artifactId>
>             <version>2.1.0</version>
>         </dependency>                
>     </dependencies>
>
> The project build will run successful, but when I try to run the app, I get
> the good old 
>
> Exception in thread "main" java.lang.ExceptionInInitializerError
>         at
> com.vw.ais.jobengine.validation.ConfigurationValidator.schematicValidation(ConfigurationValidator.java:98)
>         at
> com.vw.ais.jobengine.validation.ConfigurationValidator.validate(ConfigurationValidator.java:58)
>         at com.vw.ais.jobengine.JobEngine.initialize(JobEngine.java:54)
>         at com.vw.ais.jobengine.Test.main(Test.java:34)
> Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable
> to load class with name
> schemaorg_apache_xmlbeans.system.s09447651F54C8102642F6478AB9428E3.TypeSystemHolder.
> Make sure the generated binary files are on the classpath.
>         at
> org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783)
>         at
> com.vw.ais.jobengine.configurations.JobEngineDocument.<clinit>(JobEngineDocument.java:19)
>         ... 4 more
> Caused by: java.lang.ClassNotFoundException:
> schemaorg_apache_xmlbeans.system.s09447651F54C8102642F6478AB9428E3.TypeSystemHolder
> .......
> .......
>
> The Class
> schemaorg_apache_xmlbeans.system.s09447651F54C8102642F6478AB9428E3.TypeSystemHolder
> lies in the jar. 
>
> What the hell is wrong here. Does anyone see what I'm doing wrong here.
> Thx for suggestions
>   

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