Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7791547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:55:12+00:00 2026-06-01T21:55:12+00:00

So I was able to get Apache Shiro working with Guice (thanks to ShiroWebModule)

  • 0

So I was able to get Apache Shiro working with Guice (thanks to ShiroWebModule) on Vaadin.
The Shiro annotations (@RequiresAuthentication, @RequiresPermission) work only on the main Vaadin Application class and inside custom classes. They don’t work inside CustomComponent/Window classes.

I tried injecting the Window classes to the Application class with providers, through injector.getInstance and it still doesn’t work…

I am new to Guice and Shiro, so maybe I am missing something?

Why does it work for other custom classes? This works as expected (throws exception)

public class TestClassImpl implements TestClass {

    @Override

    public void doSomeWork() {
        //this will throw an exception as expected
        test();
    }

    @RequiresAuthentication

    public void test() {

    }
}

This doesn’t work as expected (the method is executed, the Apache Shiro annotation is ignored):

  public class LoginView extends CustomComponent {

    public LoginWindow() {
        setCompositionRoot(mainLayout);
        //this will execture but it should not
        test();
    }

    @RequiresAuthentication

    public void test() {

    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:55:13+00:00Added an answer on June 1, 2026 at 9:55 pm

    Using Annotations like this at runtime usually involves AOP.

    With Spring AOP, you cannot intercept calls to self : this is because Spring AOP generates proxy classes, and the interception happens on those proxies -> it can’t intercept calls to self.

    I suspect Guice AOP works in the same way.

    NB: One of the differences between TestClass/Impl and LoginView is that TestClass implements an Interface; it might be the case that Guice treats Interface proxies and “normal class” proxies differently – I’d try changing the TestClass to extend an abstract class, and see what happens there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not able to get my jwysiwyg and Jhtmlarea text editors to work
I was able to get this working is SSRS 2008, but do to the
Iam not able to get familiar with XAMPP interface on Windows7 (Only prior experiencxe
I was just able to get Apache ANT running on my computer. The ant
I need to be able get a single specific attribute from an element with
Has anyone been able to get an NHibernate-based project up and running on a
Has anyone been able to get xinc to run correctly under OpenBSD's chrooted default
Has anyone been able to get a variable record length text file (CSV) into
I'm able to get cells to format as Dates, but I've been unable to
I am able to get the feed from the spreadsheet and worksheet ID. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.