Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-16043

CLONE - Build Error when using DS security module and @Secured @Stereotype annotation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 4.2.0.Alpha1
    • 4.1.0.Final, 4.1.1.Beta1
    • cdi-extensions
    • None
    • Hide

      1. Create stereotyped secured annotation class @Secured(DecisionVoter.class):

      @Retention(RUNTIME)
      @Target(TYPE, METHOD, FIELD)
      @Documented
      @Secured(LoggedInDecisionVoter.class)
      @Stereotype
      public @interface LoggedInUsingDesicionVoter {}

      2. Create the decision voter class
      3. Create a class with a @LoggedInUsingDesicionVoter annotated method
      4. Trigger the build (if not automatically done)

      Show
      1. Create stereotyped secured annotation class @Secured(DecisionVoter.class) : @Retention(RUNTIME) @Target(TYPE, METHOD, FIELD) @Documented @Secured(LoggedInDecisionVoter.class) @Stereotype public @interface LoggedInUsingDesicionVoter {} 2. Create the decision voter class 3. Create a class with a @LoggedInUsingDesicionVoter annotated method 4. Trigger the build (if not automatically done)

      When using @Secured(DecisionVoter.class) concept for authorization, each build ends with following build error if the method is annotated with a @Secured @Stereotype created annotation:

      eclipse.buildId=4.3.0.M20130911-1000
      java.version=1.7.0_25
      java.vendor=Oracle Corporation
      BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH
      Framework arguments: -product org.eclipse.epp.package.jee.product
      Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product

      Error
      Tue Nov 19 13:36:27 CET 2013
      Errors running builder 'CDI (Context and Dependency Injection) Builder' on project 'ee7-web-ds-security'.

      java.lang.NullPointerException
      at org.jboss.tools.cdi.deltaspike.core.DeltaspikeSecurityExtension.findAnnotationAnnotatedWithSecurityBindingType(DeltaspikeSecurityExtension.java:161)
      at org.jboss.tools.cdi.deltaspike.core.DeltaspikeSecurityExtension.addSecurityMember(DeltaspikeSecurityExtension.java:117)
      at org.jboss.tools.cdi.deltaspike.core.DeltaspikeSecurityExtension.processAnnotatedMember(DeltaspikeSecurityExtension.java:106)
      at org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition.init(TypeDefinition.java:72)
      at org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition.setAnnotatable(AbstractMemberDefinition.java:64)
      at org.jboss.tools.cdi.internal.core.impl.definition.AbstractTypeDefinition.setType(AbstractTypeDefinition.java:69)
      at org.jboss.tools.cdi.internal.core.scanner.CDIBuilderDelegate.build(CDIBuilderDelegate.java:79)
      at org.jboss.tools.cdi.internal.core.scanner.CDIBuilderDelegate.build(CDIBuilderDelegate.java:48)
      at org.jboss.tools.cdi.core.CDICoreBuilder.invokeBuilderDelegates(CDICoreBuilder.java:326)
      at org.jboss.tools.cdi.core.CDICoreBuilder.fullBuild(CDICoreBuilder.java:261)
      at org.jboss.tools.cdi.core.CDICoreBuilder.build(CDICoreBuilder.java:221)
      at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:733)
      at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
      at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
      at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
      at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
      at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
      at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
      at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

      When using the @SecurityBindingType concept for authorization or the @Secured annotation directly, the build passes with no error.

      In any case, even if the build reports this error, the app is compiled correctly and deploys and works as it should.

            scabanovich Viacheslav Kabanovich (Inactive)
            alexeykazakov Alexey Kazakov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: