You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Herve Boutemy (Jira)" <ji...@apache.org> on 2022/04/23 14:40:00 UTC

[jira] [Comment Edited] (MNG-5620) Prevent LinkageError when CDI is in the classpath

    [ https://issues.apache.org/jira/browse/MNG-5620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14419679#comment-14419679 ] 

Herve Boutemy edited comment on MNG-5620 at 4/23/22 2:39 PM:
-------------------------------------------------------------

Fixed on 661b4cf8f38b45a5e7e85463a2860c9dd7407967 https://github.com/apache/maven/commit/661b4cf8f38b45a5e7e85463a2860c9dd7407967


was (Author: jvanzyl):
Fixed on 661b4cf8f38b45a5e7e85463a2860c9dd7407967

> Prevent LinkageError when CDI is in the classpath
> -------------------------------------------------
>
>                 Key: MNG-5620
>                 URL: https://issues.apache.org/jira/browse/MNG-5620
>             Project: Maven
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 3.1.0-alpha-1, 3.1.0, 3.1.1, 3.2.1
>            Reporter: Martin Tzvetanov Grigorov
>            Assignee: Jason van Zyl
>            Priority: Major
>             Fix For: 3.2.2
>
>
> We have troubles use 'mvn jetty:run' for https://github.com/apache/wicket/tree/master/wicket-examples after upgrading to Maven 3.1.0+.
> It fails with:
> 2014-04-17 16:22:57.160:WARN:oejuc.AbstractLifeCycle:FAILED org.mortbay.jetty.plugin.JettyServer@44e5b006: java.lang.LinkageError: loader constraint violation: when resolving overridden method "org.jboss.weld.Weld.select(Ljavax/enterprise/util/TypeLiteral;[Ljava/lang/annotation/Annotation;)Ljavax/enterprise/inject/Instance;" the class loader (instance of org/eclipse/jetty/webapp/WebAppClassLoader) of the current class, org/jboss/weld/Weld, and its superclass loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm), have different Class objects for the type tion/Annotation;)Ljavax/enterprise/inject/Instance; used in the signature
> java.lang.LinkageError: loader constraint violation: when resolving overridden method "org.jboss.weld.Weld.select(Ljavax/enterprise/util/TypeLiteral;[Ljava/lang/annotation/Annotation;)Ljavax/enterprise/inject/Instance;" the class loader (instance of org/eclipse/jetty/webapp/WebAppClassLoader) of the current class, org/jboss/weld/Weld, and its superclass loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm), have different Class objects for the type tion/Annotation;)Ljavax/enterprise/inject/Instance; used in the signature
> 	at org.jboss.weld.servlet.StaticWeldProvider$WeldSingleton.<clinit>(StaticWeldProvider.java:29)
> 	at org.jboss.weld.servlet.StaticWeldProvider.getCDI(StaticWeldProvider.java:49)
> 	at javax.enterprise.inject.spi.CDI.current(CDI.java:60)
> 	at org.jboss.weld.servlet.WeldInitialListener.contextInitialized(WeldInitialListener.java:85)
> 	at org.jboss.weld.servlet.api.helpers.ForwardingServletListener.contextInitialized(ForwardingServletListener.java:34)
> 	at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:171)
> 	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:733)
> ...
> The issue is not new. We just noticed that when using 3.0.5 it runs fine so it should be some change in Maven itself.
> I've found that another user had the same issue:  http://stackoverflow.com/a/18168215/497381
> How to reproduce:
> 1) git clone https://github.com/apache/wicket.git
> 2) mvn install (just to have all dependencies)
> 3) cd wicket-examples
> 4) mvn jetty:run (fails with 3.1.0+)



--
This message was sent by Atlassian Jira
(v8.20.7#820007)