users@jaxb.java.net

Re: Maven 2 Jaxb2 plugin use

From: William Simons <william.simons_at_childrens.harvard.edu>
Date: Thu, 30 Mar 2006 16:00:09 -0500

Ah. I thought it was a forking problem and it was. It turns out that with
surefire, when you set forkMode to turn forking on, you must also set
childDelegation to false.

Eg.

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <forkMode>pertest</forkMode>
                    <childDelegation>false</childDelegation>
                    <systemProperties>
                        <property>
                            <name>maven.build.dir</name>
                            <value>${build.directory}</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>


On 3/30/06 3:23 PM, "William Simons" <william.simons_at_childrens.harvard.edu>
wrote:

> Hi Jon,
>
> I've been working with the plugin (manually installed) for the better part
> of a day now (in conjunction with migrating my project from maven 1 to maven
> 2) and have run into a snag. All of my sources are generated and compiled
> fine. However, when I try to execute my unit tests they fail with a
> java.lang.LinkageError that I included at the end of this email.
>
> While running my tests, I first got a NoClassDefFoundError due to the fact
> that I hadn't included the activation.jar. Once I did included the
> activation.jar (as provided on the java.net repo in jaxb group), I got the
> LinkageError.
>
> I have my unit tests configured in my pom to fork pertest.
>
> Any idea what I'm doing wrong?
>
> Thanks,
> Bill
>
>
>
> java.lang.LinkageError: loader constraints violated when linking
> javax/xml/namespace/QName class
> at
> com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.<clinit>(RuntimeBu
> iltinLeafInfoImpl.java:791)
> at
> com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfo
> SetImpl.java:25)
> at
> com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(Runtime
> ModelBuilder.java:78)
> at
> com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(Runtime
> ModelBuilder.java:41)
> at
> com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:97)
> at
> com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilde
> r.java:44)
> at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.j
> ava:334)
> at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:204)
> at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:76)
> at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:55)
> at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:124)
> 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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:132)
> at javax.xml.bind.ContextFinder.find(ContextFinder.java:286)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244)
> ........
>
>
> On 3/29/06 10:05 PM, "Jonathan Johnson" <jonjohnson_at_mail.com> wrote:
>
>> Hi Bill,
>>
>> The last time I saw a message from Kohsuke he said he was going to publish
>> it to https://maven-repository.dev.java.net/nonav/repository. He is very
>> responsive to these messages so keep an eye out for his update. Once we get
>> some validation and feedback from a few people we will be publishing it on
>> ibiblio.
>>
>> Once you are able to download it please let us know if you were successful.
>> Also any feedback on the behavior, expected features, documentation, and the
>> like would be helpful for all of us.
>>
>> Thanks!!
>>
>> - Jonathan
>>
>>
>> -----Original Message-----
>> From: William Simons [mailto:william.simons_at_childrens.harvard.edu]
>> Sent: Wednesday, March 29, 2006 3:17 PM
>> To: users_at_jaxb.dev.java.net
>> Subject: Re: Maven 2 Jaxb2 plugin use
>>
>> Ah,
>>
>> I see that I'm a bit ahead of myself... From an earlier email "... We need
>> to get the plugin into the repository so people can download it."
>>
>> Looks like I need to just wait until it gets into the repository. I'll
>> monitor this list for status.
>>
>> Thanks for all your great work!
>>
>> Bill
>>
>>
>> On 3/29/06 3:04 PM, "William Simons" <william.simons_at_childrens.harvard.edu>
>> wrote:
>>
>>> Hey guys,
>>>
>>> I'm trying to use the maven 2 plugin that you wrote and ran into a small
>>> problem. The error message that I got:
>>>
>>> The plugin 'com.sun.tools.xjc.maven2:maven-jaxb-plugin' does not exist or
>> no
>>> valid version could be found
>>>
>>>
>>> Seems to indicate that the plugin isn't available in any repository. My
>> pom
>>> is fairly simple and is included below. What am I missing?
>>>
>>> Thanks,
>>> Bill
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <project>
>>> <modelVersion>4.0.0</modelVersion>
>>> <artifactId>core-xml</artifactId>
>>> <name>PING CORE XML</name>
>>> <groupId>ping</groupId>
>>> <version>3.0-SNAPSHOT</version>
>>> <repositories>
>>> <repository>
>>> <id>java.net</id>
>>> <name>java.net Maven Repository</name>
>>>
>> <url>https://maven-repository.dev.java.net/nonav/repository</url>
>>> <layout>legacy</layout>
>>> </repository>
>>> </repositories>
>>> <dependencies>
>>> <dependency>
>>> <groupId>jaxb</groupId>
>>> <artifactId>jaxb-api</artifactId>
>>> <version>2.0-SNAPSHOT</version>
>>> </dependency>
>>> <dependency>
>>> <groupId>jaxb</groupId>
>>> <artifactId>jaxb-impl</artifactId>
>>> <version>2.0-SNAPSHOT</version>
>>> </dependency>
>>> </dependencies>
>>> <build>
>>> <plugins>
>>> <plugin>
>>> <groupId>com.sun.tools.xjc.maven2</groupId>
>>> <artifactId>maven-jaxb-plugin</artifactId>
>>> <executions>
>>> <execution>
>>> <phase>generate-sources</phase>
>>> <goals>
>>> <goal>generate</goal>
>>> </goals>
>>> </execution>
>>> </executions>
>>> </plugin>
>>> <plugin>
>>> <groupId>org.apache.maven.plugins</groupId>
>>> <artifactId>maven-compiler-plugin</artifactId>
>>> <configuration>
>>> <source>1.5</source>
>>> <target>1.5</target>
>>> </configuration>
>>> </plugin>
>>> </plugins>
>>> </build>
>>> </project>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>