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 952163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:50:55+00:00 2026-05-15T23:50:55+00:00

I have provider which should inject javax.mail.Session (provider looks it up in env. context

  • 0

I have provider which should inject javax.mail.Session (provider looks it up in env. context of tomcat) as singleton. There is a problem when I use field injection somewhere in code:

java.lang.IllegalArgumentException: Cannot subclass final class class javax.mail.Session

Is there a way to go round this? Only clues that I’ve found point to Spring AOP/Proxies.

Thanks && regards

  • 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-05-15T23:50:56+00:00Added an answer on May 15, 2026 at 11:50 pm

    Look at this http://code.google.com/p/google-guice/wiki/AOP. It seems that there is some limitations:

    Limitations

    Behind the scenes, method interception is implemented by generating
    bytecode at runtime. Guice dynamically creates a subclass that applies
    interceptors by overriding methods. If you are on a platform that
    doesn’t support bytecode generation (such as Android), you should use
    Guice without AOP support.

    This approach imposes limits on what classes and methods can be
    intercepted:

    Classes must be public or package-private. Classes must be non-final
    Methods must be public, package-private or protected Methods must be
    non-final Instances must be created by Guice by an @Inject-annotated
    or no-argument constructor

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

Sidebar

Related Questions

We have the problem, which I think should be easily resolvable, but just not
Introduction We have an OpenID Provider which we created using the DotNetOpenAuth component. Everything
I have Eclipselink persistence provider tuned on DB2 DB. Where is 3 tables which
I have my own custom Content Provider that loads a database which contains the
We have an external data provider which, in its construtor, takes a callback thread
Are there any good guides on how to implement a custom role provider which
I have a custom type that I created, which should be persisted in a
I've implemented an OAuth 1.0 provider following this specification , which should be the
I have an administration website - the users of which should be able to
I have what I think is a simple problem to which I have found

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.