glassfish
  1. glassfish
  2. GLASSFISH-18369

weld dependencies are part of distribution

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 4.0_b23
    • Fix Version/s: 4.0
    • Component/s: cdi
    • Labels:
      None

      Description

      In trunk build, I am seeing various weld dependencies being part of distribution when they should not be. e.g.,
      slf4-*.jar
      cal10n-api.jar

      and may be others?

      This will cause all kinds of classloading issues as users won't be able to use different versions of these jars in their application. So, they must be removed from distribution.

        Activity

        Sanjeeb Sahoo created issue -
        Hide
        Sivakumar Thyagarajan added a comment -

        It appears that the glassfish-web packager zip brings in slf4j and cal10n, because of maven dependencies of webtier-all. This may need to be fixed.

        [ ../packager/glassfish-web] $ unzip -l target/glassfish-web.zip | grep "cal10n|slf"
        28866 2012-02-15 21:26 glassfish3/glassfish/modules/cal10n-api.jar
        23659 2012-02-15 21:26 glassfish3/glassfish/modules/slf4j-api.jar
        41626 2012-02-15 21:26 glassfish3/glassfish/modules/slf4j-ext.jar

        Transferring this issue to Shingwai

        Show
        Sivakumar Thyagarajan added a comment - It appears that the glassfish-web packager zip brings in slf4j and cal10n, because of maven dependencies of webtier-all. This may need to be fixed. [ ../packager/glassfish-web] $ unzip -l target/glassfish-web.zip | grep "cal10n|slf" 28866 2012-02-15 21:26 glassfish3/glassfish/modules/cal10n-api.jar 23659 2012-02-15 21:26 glassfish3/glassfish/modules/slf4j-api.jar 41626 2012-02-15 21:26 glassfish3/glassfish/modules/slf4j-ext.jar Transferring this issue to Shingwai
        Hide
        Sivakumar Thyagarajan added a comment -

        Shingwai, please let me know if there is anyway we can help. It appears that glassfish-web packager brings in weld osgi impl's dependencies such as cal10n, sfl4j.

        Show
        Sivakumar Thyagarajan added a comment - Shingwai, please let me know if there is anyway we can help. It appears that glassfish-web packager brings in weld osgi impl's dependencies such as cal10n, sfl4j.
        Sivakumar Thyagarajan made changes -
        Field Original Value New Value
        Assignee Sivakumar Thyagarajan [ sivakumart ] Shing Wai Chan [ swchan2 ]
        Hide
        Shing Wai Chan added a comment -

        The slf4j-api, slf4j-ext and cal10n-api are bring it by org.jboss.weld:weld-core:jar:1.1.4.Final:compile which is bring it by org.glassfish.web:web-sse:jar:4.0-SNAPSHOT:compile

        Show
        Shing Wai Chan added a comment - The slf4j-api, slf4j-ext and cal10n-api are bring it by org.jboss.weld:weld-core:jar:1.1.4.Final:compile which is bring it by org.glassfish.web:web-sse:jar:4.0-SNAPSHOT:compile
        Shing Wai Chan made changes -
        Assignee Shing Wai Chan [ swchan2 ] jitu [ jitu ]
        Hide
        Sanjeeb Sahoo added a comment -

        Jitu,

        Can this bug be fixed by depending on javax.inject/javax.inject/1 instead of weld-osgi? More over, mark the dependency a provided scope dependency so that it does not get pulled in to the distribution. Could you do it ASAP?

        Thanks,
        Sahoo

        Show
        Sanjeeb Sahoo added a comment - Jitu, Can this bug be fixed by depending on javax.inject/javax.inject/1 instead of weld-osgi? More over, mark the dependency a provided scope dependency so that it does not get pulled in to the distribution. Could you do it ASAP? Thanks, Sahoo
        Sanjeeb Sahoo made changes -
        Priority Major [ 3 ] Critical [ 2 ]
        Hide
        jitu added a comment -

        If I do the following changes in web-sse/pom.xml, running into an exception. May be HK2 maven plugin needs an update.

        <dependency>

        • <groupId>org.jboss.weld</groupId>
        • <artifactId>weld-osgi-bundle</artifactId>
          + <groupId>javax.inject</groupId>
          + <artifactId>javax.inject</artifactId>
          + <version>1</version>
          + <scope>provided</scope>
          </dependency>

        ---------
        java.lang.ClassCastException: com.sun.tools.apt.mirror.type.ClassTypeImpl cannot be cast to com.sun.mirror.type.AnnotationType
        at com.sun.tools.apt.mirror.declaration.AnnotationMirrorImpl.getAnnotationType(AnnotationMirrorImpl.java:82)
        at com.sun.tools.apt.mirror.apt.AnnotationProcessorEnvironmentImpl$CollectingAP$CollectingVisitor.visitDeclaration(AnnotationProcessorEnvironmentImpl.java:118)
        at com.sun.mirror.util.SimpleDeclarationVisitor.visitParameterDeclaration(SimpleDeclarationVisitor.java:181)
        at com.sun.tools.apt.mirror.declaration.ParameterDeclarationImpl.accept(ParameterDeclarationImpl.java:80)
        at com.sun.mirror.util.DeclarationScanner.visitDeclaration(DeclarationScanner.java:45)
        at com.sun.mirror.util.DeclarationScanner.visitParameterDeclaration(DeclarationScanner.java:233)
        at com.sun.tools.apt.mirror.declaration.ParameterDeclarationImpl.accept(ParameterDeclarationImpl.java:80)
        at com.sun.mirror.util.SourceOrderDeclScanner.visitExecutableDeclaration(SourceOrderDeclScanner.java:225)
        at com.sun.mirror.util.DeclarationScanner.visitMethodDeclaration(DeclarationScanner.java:214)
        at com.sun.tools.apt.mirror.declaration.MethodDeclarationImpl.accept(MethodDeclarationImpl.java:41)
        at com.sun.mirror.util.SourceOrderDeclScanner.visitClassDeclaration(SourceOrderDeclScanner.java:207)
        at com.sun.tools.apt.mirror.declaration.ClassDeclarationImpl.accept(ClassDeclarationImpl.java:95)
        at com.sun.tools.apt.mirror.apt.AnnotationProcessorEnvironmentImpl$CollectingAP.process(AnnotationProcessorEnvironmentImpl.java:126)
        at com.sun.tools.apt.mirror.apt.AnnotationProcessorEnvironmentImpl.getDeclarationsAnnotatedWith(AnnotationProcessorEnvironmentImpl.java:100)
        at org.jvnet.hk2.config.generator.ConfigInjectorGenerator.process(ConfigInjectorGenerator.java:122)
        at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
        at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
        at com.sun.tools.apt.comp.Apt.main(Apt.java:454)
        at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:258)
        at com.sun.tools.apt.main.Main.compile(Main.java:1102)
        at com.sun.tools.apt.main.Main.compile(Main.java:964)
        at com.sun.tools.apt.Main.processing(Main.java:95)
        at com.sun.tools.apt.Main.process(Main.java:85)
        at com.sun.enterprise.module.maven.HK2CompileMojo$1.compileInProcess(HK2CompileMojo.java:126)
        at com.sun.enterprise.module.maven.AptCompiler.compile(AptCompiler.java:106)
        at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:528)
        at com.sun.enterprise.module.maven.CompilerMojo.execute(CompilerMojo.java:155)
        at com.sun.enterprise.module.maven.HK2CompileMojo.execute(HK2CompileMojo.java:140)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        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:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

        Show
        jitu added a comment - If I do the following changes in web-sse/pom.xml, running into an exception. May be HK2 maven plugin needs an update. <dependency> <groupId>org.jboss.weld</groupId> <artifactId>weld-osgi-bundle</artifactId> + <groupId>javax.inject</groupId> + <artifactId>javax.inject</artifactId> + <version>1</version> + <scope>provided</scope> </dependency> --------- java.lang.ClassCastException: com.sun.tools.apt.mirror.type.ClassTypeImpl cannot be cast to com.sun.mirror.type.AnnotationType at com.sun.tools.apt.mirror.declaration.AnnotationMirrorImpl.getAnnotationType(AnnotationMirrorImpl.java:82) at com.sun.tools.apt.mirror.apt.AnnotationProcessorEnvironmentImpl$CollectingAP$CollectingVisitor.visitDeclaration(AnnotationProcessorEnvironmentImpl.java:118) at com.sun.mirror.util.SimpleDeclarationVisitor.visitParameterDeclaration(SimpleDeclarationVisitor.java:181) at com.sun.tools.apt.mirror.declaration.ParameterDeclarationImpl.accept(ParameterDeclarationImpl.java:80) at com.sun.mirror.util.DeclarationScanner.visitDeclaration(DeclarationScanner.java:45) at com.sun.mirror.util.DeclarationScanner.visitParameterDeclaration(DeclarationScanner.java:233) at com.sun.tools.apt.mirror.declaration.ParameterDeclarationImpl.accept(ParameterDeclarationImpl.java:80) at com.sun.mirror.util.SourceOrderDeclScanner.visitExecutableDeclaration(SourceOrderDeclScanner.java:225) at com.sun.mirror.util.DeclarationScanner.visitMethodDeclaration(DeclarationScanner.java:214) at com.sun.tools.apt.mirror.declaration.MethodDeclarationImpl.accept(MethodDeclarationImpl.java:41) at com.sun.mirror.util.SourceOrderDeclScanner.visitClassDeclaration(SourceOrderDeclScanner.java:207) at com.sun.tools.apt.mirror.declaration.ClassDeclarationImpl.accept(ClassDeclarationImpl.java:95) at com.sun.tools.apt.mirror.apt.AnnotationProcessorEnvironmentImpl$CollectingAP.process(AnnotationProcessorEnvironmentImpl.java:126) at com.sun.tools.apt.mirror.apt.AnnotationProcessorEnvironmentImpl.getDeclarationsAnnotatedWith(AnnotationProcessorEnvironmentImpl.java:100) at org.jvnet.hk2.config.generator.ConfigInjectorGenerator.process(ConfigInjectorGenerator.java:122) at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60) at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60) at com.sun.tools.apt.comp.Apt.main(Apt.java:454) at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:258) at com.sun.tools.apt.main.Main.compile(Main.java:1102) at com.sun.tools.apt.main.Main.compile(Main.java:964) at com.sun.tools.apt.Main.processing(Main.java:95) at com.sun.tools.apt.Main.process(Main.java:85) at com.sun.enterprise.module.maven.HK2CompileMojo$1.compileInProcess(HK2CompileMojo.java:126) at com.sun.enterprise.module.maven.AptCompiler.compile(AptCompiler.java:106) at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:528) at com.sun.enterprise.module.maven.CompilerMojo.execute(CompilerMojo.java:155) at com.sun.enterprise.module.maven.HK2CompileMojo.execute(HK2CompileMojo.java:140) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) 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:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
        Hide
        Sanjeeb Sahoo added a comment -

        I think this is happening because hk2 also depends on javax.inject. This is a guess only. If you don't want to spend a lot of time, then you could try changing the existing weld-osgi-bundle dependency to a provided scope dependency so that's its transitive dependencies are not pulled in by the build.

        Show
        Sanjeeb Sahoo added a comment - I think this is happening because hk2 also depends on javax.inject. This is a guess only. If you don't want to spend a lot of time, then you could try changing the existing weld-osgi-bundle dependency to a provided scope dependency so that's its transitive dependencies are not pulled in by the build.
        Hide
        jitu added a comment -

        weld-osgi-bundle artifact is marked with provided scope
        ---------------
        main/appserver/web/web-sse$ svn ci pom.xml
        Sending pom.xml
        Transmitting file data .
        Committed revision 53341.
        ----------------

        Show
        jitu added a comment - weld-osgi-bundle artifact is marked with provided scope --------------- main/appserver/web/web-sse$ svn ci pom.xml Sending pom.xml Transmitting file data . Committed revision 53341. ----------------
        Hide
        jthoennes added a comment -

        In reply to comment #6:
        > I think this is happening because hk2 also depends on javax.inject. This is a
        > guess only. If you don't want to spend a lot of time, then you could try
        > changing the existing weld-osgi-bundle dependency to a provided scope dependency
        > so that's its transitive dependencies are not pulled in by the build.

        Sahoo, please could you elaborate on this? We are also struck by this issue.

        And: Will this be corrected for at least GF 4.0?

        Thanks, Jörg

        Show
        jthoennes added a comment - In reply to comment #6: > I think this is happening because hk2 also depends on javax.inject. This is a > guess only. If you don't want to spend a lot of time, then you could try > changing the existing weld-osgi-bundle dependency to a provided scope dependency > so that's its transitive dependencies are not pulled in by the build. Sahoo, please could you elaborate on this? We are also struck by this issue. And: Will this be corrected for at least GF 4.0? Thanks, Jörg
        Hide
        Sanjeeb Sahoo added a comment -

        Jörg, pl file a separate bug for the hk2 plugin issue against HK2 project to get a faster response from the relevant developers.

        Show
        Sanjeeb Sahoo added a comment - Jörg, pl file a separate bug for the hk2 plugin issue against HK2 project to get a faster response from the relevant developers.
        Hide
        Sanjeeb Sahoo added a comment -

        jitu, why is this bug still open?

        Show
        Sanjeeb Sahoo added a comment - jitu, why is this bug still open?
        Hide
        jitu added a comment -

        Will close the issue if there aren't any comments.

        Show
        jitu added a comment - Will close the issue if there aren't any comments.
        jjsnyder83 made changes -
        Fix Version/s 4.0 [ 10970 ]
        jitu made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            jitu
            Reporter:
            Sanjeeb Sahoo
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: