Issue Details (XML | Word | Printable)

Key: GLASSFISH-18369
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: jitu
Reporter: Sanjeeb Sahoo
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
glassfish

weld dependencies are part of distribution

Created: 15/Feb/12 01:10 PM   Updated: 01/Mar/13 07:10 PM   Resolved: 01/Mar/13 07:10 PM
Component/s: cdi
Affects Version/s: 4.0_b23
Fix Version/s: 4.0

Time Tracking:
Not Specified

Tags:
Participants: jitu, jthoennes, Sanjeeb Sahoo, Shing Wai Chan and Sivakumar Thyagarajan


 Description  « Hide

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.



Sivakumar Thyagarajan added a comment - 15/Feb/12 04:28 PM

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


Sivakumar Thyagarajan added a comment - 15/Feb/12 04:29 PM

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.


Shing Wai Chan added a comment - 07/Mar/12 09:11 PM

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


Sanjeeb Sahoo added a comment - 02/Apr/12 05:57 PM

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


jitu added a comment - 02/Apr/12 10:22 PM

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)


Sanjeeb Sahoo added a comment - 03/Apr/12 01:35 AM

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.


jitu added a comment - 03/Apr/12 06:22 PM

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.
----------------


jthoennes added a comment - 04/Apr/12 10:09 AM

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


Sanjeeb Sahoo added a comment - 07/Apr/12 06:39 PM

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


Sanjeeb Sahoo added a comment - 07/Apr/12 06:40 PM

jitu, why is this bug still open?


jitu added a comment - 08/Apr/12 05:55 AM

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