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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:08:32+00:00 2026-06-01T23:08:32+00:00

This thread is related to a problem I am encountering here regarding the needs

  • 0

This thread is related to a problem I am encountering here regarding the needs for access to protected methods of an advised class. I’m using Spring 3.0.6, and have created a Spring profiling aspect that I am applying to a significant number of beans using JDK proxies.

However, due to the need to access protected methods in one particular bean, I would like to advise it using CGLIB. All other beans I would like to continue to use JDK Proxies.

I am using a mix of annotations and xml configuration, but this particular aspect is defined in XML configuration.

I know that there is <aop:scoped-proxy> tag, but from what I can tell, that applies to all aspects.

Is there anyway to define for a single aspect to use CGLIB instead?

<aop:config>
    <aop:aspect id="Profiler" ref="lendingSimulationServiceProfilerInterceptor">
        <!-- info -->
        <aop:around method="infoProfiler"
                    pointcut="execution(* com.cws.cs.lendingsimulationservice.service.LendingSimulationServiceImpl.calculate*(..))"  />

        <!-- debug -->
        <aop:around method="infoProfiler"
                    pointcut="execution(* com.cws.cs.lendingsimulationservice.process.LendingSimulationProcessImpl.calculate(..))"  />

        <aop:around method="infoProfiler"
                    pointcut="execution(* com.blaze.BlazeEngine.invokeService(..))"  />

        <!-- trace -->
        <aop:around method="traceProfiler" 
                    pointcut="execution(* com.calculator.dao.impl.LendingSimulationDaoImpl.*(..))"  />

        <!-- NEED TO DEFINE THIS PARTICULAR ASPECT AS CGLIB -->
        <aop:around method="traceProfiler" 
                    pointcut="execution(* com.cws.cs.lendingsimulationservice.util.pool.JAXBPoolImpl.*(..))"    />
    </aop:aspect>
</aop:config>

I’ve tried to split the configuration into two, and for one configuration specify target-class="true" and the other target-class="false", but it seems to apply CGLIB to all at that point.

Is there any way to accomplish this?

Thanks,

Eric

  • 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-01T23:08:34+00:00Added an answer on June 1, 2026 at 11:08 pm

    Unfortunately, either all or none beans use CGLIB and if you use proxying of target class in one place, it is forced in all other places. Quoting 8.6 Proxying mechanisms of official documentation:

    Note

    Multiple <aop:config/> sections are collapsed into a single unified auto-proxy creator at runtime, which applies the strongest proxy settings that any of the <aop:config/> sections (typically from different XML bean definition files) specified. This also applies to the <tx:annotation-driven/> and <aop:aspectj-autoproxy/> elements.

    To be clear: using 'proxy-target-class="true"' on <tx:annotation-driven/>, <aop:aspectj-autoproxy/> or <aop:config/> elements will force the use of CGLIB proxies for all three of them.

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

Sidebar

Related Questions

This is related to a question I asked here: Thread Locking in Ruby (use
This question is based on this thread . Problem: to access MySQL's manual when
This question is related to this previous thread . I followed Tomas's suggestion using
This is inspired by/taken from this thread: http://www.allegro.cc/forums/thread/603383 The Problem Assume the user gives
I am working on CUDA and I have a problem related to thread synchronization.
I found this thread here: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=16836 I have exactly the same problem. Quote: Rob
This problem seems related to this post, but I was not able to infer
I'm having a GUI/threading-related problem under Mac OS X (10.6.7). I'm using the wxWidgets
I have one more question related to this thread. How to decode some number
I have a problem similar if not identical to the problem in this thread:

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.