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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:10:54+00:00 2026-06-05T00:10:54+00:00

i seem to run into a small issue when using @Autowired into a custom

  • 0

i seem to run into a small issue when using @Autowired into a custom cxf interceptor.
My use case is that i want to log soap messages and send these using AMQP to another system. This process works for normal services etc.
But whatever i do, the needed properties do not get autowired and stay null.

I checked the Spring DI log and the context is scanned and pickedup, so what am i missing?

Is this even possible in CXF interceptors?

@Component
public class LogInInterceptor extends AbstractSoapInterceptor {

    private @Value("#{rabbitMQProperties['rabbitmq.binding.log.soap']}")
    String binding;

    @Autowired
    AmqpTemplate amqpTemplate;

    public LogInInterceptor() {
        super(Phase.RECEIVE);
    }

    @Override
    public void handleMessage(SoapMessage soapMessage) throws Fault {
        logIt(soapMessage);
    }

    private void logIt(SoapMessage message) throws Fault {
        // rest of the code omitted...!!!     
        amqpTemplate.convertAndSend(binding, buffer.toString());
    }

}
  • 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-05T00:10:55+00:00Added an answer on June 5, 2026 at 12:10 am

    You can’t mix @InInterceptors (a CXF annotation) and @Component (a Spring annotation). That will create two separate instances of your interceptor: the one whose dependencies are getting injected by Spring, and one created by CXF. (You are providing class names in the @InInterceptors annotation, not a bean ID, so CXF has no way of knowing that you already created an instance in the Spring context.)

    Remove the @InInterceptors annotation and, in addition to the component scan:

    <context:component-scan base-package="org.example.config"/>
    

    You also need something like this in your application context:

    <jaxws:endpoint id="myWebService" address="/MyWebService">
        <jaxws:inInterceptors>
            <ref bean="myInInterceptor" />
        </jaxws:inInterceptors>
    </jaxws:endpoint>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to run mallet using the --use-ngrams true option but can't seem to
I've run into an issue that I can't seem to figure out the solution
I seem to run into a couple of design issue a lot and I
Just a very small question... I seem to run into too much complexity here:
I've bumped into a small problem that i cant seem to find the fix
This is my first time using points and I seem to run into an
I seem to have run into to a wall that I can't get passed.
I've seem to run into some kind of weird issue with tiling backgrounds getting
Have run into an issue that i am hoping somebody can help give me
Seem to run into a service endpoint not found problem when trying to get

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.