Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sisu-users] @Dependent Scope / Custom handler

Hello,

I hope this is the correct forum, but I am not sure where the dividing line is between the technology stack.

I also admit this is effectively a cross-posting with https://github.com/sonatype/sisu-guice/issues/10 (please accept my apologies).

We use maven-core and hence indirectly sisu-guice in our project:-
[INFO] |  +- org.apache.maven:maven-core:jar:3.2.2:compile
[INFO] |  |  +- org.apache.maven:maven-settings:jar:3.2.2:compile
[INFO] |  |  +- org.apache.maven:maven-settings-builder:jar:3.2.2:compile
[INFO] |  |  +- org.apache.maven:maven-repository-metadata:jar:3.2.2:compile
[INFO] |  |  +- org.apache.maven:maven-artifact:jar:3.2.2:compile
[INFO] |  |  +- org.apache.maven:maven-plugin-api:jar:3.2.2:compile
[INFO] |  |  +- org.apache.maven:maven-model-builder:jar:3.2.2:compile
[INFO] |  |  +- org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.0.0.M5:compile
[INFO] |  |  |  +- org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:compile
[INFO] |  |  |  \- org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.0.0.M5:compile
We have noticed a problem with DefaultPlexusContainer when @Dependent @Named beans are on the classpath.

In this scenario com.google.inject.internal.Scoping#makeInjectable() cannot find a Scope for @Dependent and ultimately throws a "Scope Not Found" exception.

This is an example class that causes the error:

@Dependent
@Named("a-name")
public class DependentScopeBean {}

Ideally we would like to be able to filter processing of some classes on the classpath all together or provide a custom Scope handler for @Dependent that would work the same as NO_SCOPE. The classes we'd like to ignore are handled by another technology (JBoss Errai) and are only on the classpath when running from within an IDE. When the application is assembled we filter the classes from the WAR (as they are not needed at runtime -- we use GWT so they are compiled into _javascript_, in case anybody wondered).

Any pointers would be very much appreciated.

With kind regards,

Mike



Back to the top