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

  • Home
  • SEARCH
  • 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 8561575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:31:50+00:00 2026-06-11T16:31:50+00:00

There is some information in the tomcat engine that we want to access run

  • 0

There is some information in the tomcat engine that we want to access run time, so we have the following in our app context (got this from this blog post):

<bean id="tomcatEngineProxy" class="org.springframework.jmx.access.MBeanProxyFactoryBean">
    <property name="objectName" value="Catalina:type=Engine" />
    <property name="proxyInterface" value="org.apache.catalina.Engine" />
    <property name="useStrictCasing" value="false" />
</bean>

In a controller, we then autowired it in like this:

@Autowired
private MBeanProxyFactoryBean tomcatEngineProxy = null;

We cannot wire in org.apache.catalina.Engine like in the blog post, because that class is not available to us at build time. It’s only available at run time with all the different tomcat versions running on the different machines.

We were able to get the information we needed from this @Autowire using reflection. Now, we want to move this functionality into a service. I added this to our app context:

<bean id="myService" class="com.foo.bar.MyServiceImpl">
    <constructor-arg ref="tomcatEngineProxy" />
</bean>

And the class looks like this:

public class MyServiceImpl implements MyService
{
    public MyServiceImpl(MBeanProxyFactoryBean tomcatEngineProxy) throws Exception
    {
         //stuff with the proxy
    }
    .....
}

When I do this, I get the following error:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myService' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.jmx.access.MBeanProxyFactoryBean]: Could not convert constructor argument value of type [$Proxy44] to required type [org.springframework.jmx.access.MBeanProxyFactoryBean]: Failed to convert value of type '$Proxy44 implementing org.apache.catalina.Engine,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'org.springframework.jmx.access.MBeanProxyFactoryBean'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [$Proxy44 implementing org.apache.catalina.Engine,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [org.springframework.jmx.access.MBeanProxyFactoryBean]: no matching editors or conversion strategy found

Knowing basically nothing about how proxies work and how to use them, I’m not sure how to go about making this work. Is there some declaration I can use for my constructor arg that will match up? What is different between the @Autowire in the controller that does work and the constructor arg that doesn’t work?

  • 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-11T16:31:51+00:00Added an answer on June 11, 2026 at 4:31 pm

    It’s because your factory bean is exposing the result as the engine interface:

    <property name="proxyInterface" value="org.apache.catalina.Engine" />
    

    So if you try to wire in the “tomcatEngineProxy” bean itself, it’s only compatible assignment is to “org.apache.catalina.Engine”, since the created proxy implements only that interface.

    try referencing the factory bean directly instead (notice the ampersand which is the syntax for finding the actual factory bean which created the object instead of the object itself):

    <constructor-arg ref="&tomcatEngineProxy" />
    

    How to inject FactoryBean instead of object it produces?

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

Sidebar

Related Questions

Some context here...I have a System.Windows.Window that is used to display a modal message
We have a Nagios check that checks the heap memory state on some Tomcat
There is some easily available information on finding the status of a battery, or
Is there any way where we can pick up some information from another web
Is there a way in which I can get some information about the mounts
Is there a way to crawl all facebook fan pages and collect some information?
Is there anyway to create an ObjectSet from a DbSet ? Some background information:
I have a file stored in the terminal server and there are some inforation
Is there some kind of software that I can feed uploaded images to and
Is there some information source or technical draft (something like RFC for networking) describing

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.