Try marking the jetty dependencies as <scope>provided</scope>.

Jan

On 29 July 2011 19:12, Brice Argenson <[email protected]> wrote:

> Hi everyone,
>
>
> I currently work on a Java WebApp using Servlet 3 technology and
> jetty-maven-plugin 8.0.0.M3 to run it. Since I developed a custom JAAS Login
> Module, I encounter a *ClassLoader* issue during the authentification
> phase.
>
> The exception thrown look like this :
>
> javax.security.auth.login.LoginException: java.lang.LinkageError: loader
>> constraint violation: loader (instance of
>> org/codehaus/plexus/classworlds/realm/ClassRealm) previously initiated
>> loading for a different type with name
>> "org/eclipse/jetty/http/security/Credential"
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
>> at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
>> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
>> at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
>> at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>> at
>> org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:386)
>> at
>> org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
>> at
>> org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
>> at
>> org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
>> at
>> org.eclipse.jetty.plus.jaas.spi.UserInfo.checkCredential(UserInfo.java:58)
>> at
>> org.eclipse.jetty.plus.jaas.spi.AbstractLoginModule$JAASUserInfo.checkCredential(AbstractLoginModule.java:101)
>> ...
>
>
>
> After some research, I found this post:
> http://comments.gmane.org/gmane.comp.java.jetty.support/13254
> It explain that set the *parentLoaderPriority *of the *WebAppContext* to *true
> *fix this issue. Unfortunately, it seems doesn't work in my case and I
> still have the same exception.
>
> My *pom.xml* contain that :
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance";
>
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>
> <modelVersion>4.0.0</modelVersion>
>
>
>  <groupId>com.supinfo</groupId>
>
> <artifactId>SupCommerce</artifactId>
>
> <version>0.0.1-SNAPSHOT</version>
>
> <packaging>war</packaging>
>
>
>  <name>SupCommerce</name>
>
>
>  <properties>
>
>  <jetty.version>8.0.0.M3</jetty.version>
>
> </properties>
>
>
>  <dependencies>
>
>  <dependency>
>
>  <groupId>org.hibernate</groupId>
>
>  <artifactId>hibernate-validator</artifactId>
>
>  <version>4.2.0.Final</version>
>
>  <type>jar</type>
>
>  </dependency>
>
>  <dependency>
>
>  <groupId>commons-lang</groupId>
>
>  <artifactId>commons-lang</artifactId>
>
>  <version>2.6</version>
>
>  <type>jar</type>
>
>  </dependency>
>
>  <dependency>
>
>  <groupId>hsqldb</groupId>
>
>  <artifactId>hsqldb</artifactId>
>
>  <version>1.8.0.10</version>
>
>  </dependency>
>
>  <dependency>
>
>  <groupId>org.hibernate.javax.persistence</groupId>
>
>  <artifactId>hibernate-jpa-2.0-api</artifactId>
>
>  <version>1.0.1.Final</version>
>
>  <type>jar</type>
>
>  </dependency>
>
>  <dependency>
>
>  <groupId>org.slf4j</groupId>
>
>  <artifactId>slf4j-jdk14</artifactId>
>
>  <version>1.6.1</version>
>
>  </dependency>
>
>  <dependency>
>
>  <groupId>org.sitemesh</groupId>
>
>  <artifactId>sitemesh</artifactId>
>
>  <version>3.0-alpha-2</version>
>
>  </dependency>
>
>  <dependency>
>
>  <groupId>com.google.guava</groupId>
>
>  <artifactId>guava</artifactId>
>
>  <version>r09</version>
>
>  </dependency>
>
>  <dependency>
>
>  <groupId>org.slf4j</groupId>
>
>  <artifactId>slf4j-api</artifactId>
>
>  <version>1.6.1</version>
>
>  </dependency>
>
>  <dependency>
>
>  <groupId>org.hibernate</groupId>
>
>  <artifactId>hibernate-entitymanager</artifactId>
>
>  <version>3.6.6.Final</version>
>
>  </dependency>
>
>  <dependency>
>
>  <groupId>javax.validation</groupId>
>
>  <artifactId>validation-api</artifactId>
>
>  <version>1.0.0.GA</version>
>
>  </dependency>
>
>  <dependency>
>
>  <groupId>org.eclipse.jetty</groupId>
>
>  <artifactId>jetty-annotations</artifactId>
>
>  <version>${jetty.version}</version>
>
>  </dependency>
>
>  <dependency>
>
>  <groupId>org.eclipse.jetty</groupId>
>
>  <artifactId>jetty-plus</artifactId>
>
>  <version>${jetty.version}</version>
>
>  </dependency>
>
> </dependencies>
>
>
>  <build>
>
>  <plugins>
>
>  <plugin>
>
>   <groupId>org.apache.maven.plugins</groupId>
>
>   <artifactId>maven-compiler-plugin</artifactId>
>
>   <version>2.3.2</version>
>
>   <configuration>
>
>   <source>1.6</source>
>
>   <target>1.6</target>
>
>   </configuration>
>
>  </plugin>
>
>  <plugin>
>
>   <groupId>org.mortbay.jetty</groupId>
>
>   <artifactId>jetty-maven-plugin</artifactId>
>
>   <version>${jetty.version}</version>
>
>   <configuration>
>
>   <webAppConfig>
>
>    <parentLoaderPriority>true</parentLoaderPriority>
>
>   </webAppConfig>
>
>   <webAppXml>src/main/resources/jetty.xml</webAppXml>
>
>   <systemProperties>
>
>    <systemProperty>
>
>    <name>java.security.auth.login.config</name>
>
>    <value>src/main/resources/login.conf</value>
>
>    </systemProperty>
>
>   </systemProperties>
>
>   </configuration>
>
>  </plugin>
>
>  </plugins>
>
> </build>
>
> </project>
>
>
>
> Any idea of how I can fix this issue ?
>
>
> Thanks in advance.
>
>
> --
> Brice Argenson
> Twitter: @bargenson
>
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
>
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to