JMX and HttpInvokerProxyFactoryBean
Slightly strange scenario: I have a web app that uses the HttpInvokerProxyFactoryBean to get services from other remote services. I have a simple servlet that starts this service. Starting this service pretty much just entails using :
XmlBeanFactory factory = new XmlBeanFactory(cpr);
to get the HttpProxy. This all works great!
Unfortunately(?!), I need to start this service via JMX, which does not work. Instead of getting a proxy of my service from HttpInvokerProxyFactoryBean, I am getting an instance of HttpInvokerProxyFactoryBean. In looking at the spring debug i see two different bean loading scenarios(one for the servlet start, and one for the jmx start.) The main difference that I see is that the servlet start is correctly using XmlBeanFactory, while the JMX start is using CachedIntrospectionResults. I am not to experienced at this level...but any iideas about this?
Sorry about the length, but I have included the debug below.
Here is the servlet start:
[#|2006-08-03T09:47:48.729-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|
2006-08-03 09:47:48,729 DEBUG [org.springframework.beans.factory.xml.XmlBeanFacto ry] - <Creating shared instance of singleton bean 'proxyCoreContentServiceSPRING_HTTP'>
|#]
[#|2006-08-03T09:47:48.729-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:48,729 DEBUG [org.springframework.beans.factory.xml.XmlBeanFacto ry] - <Creating instance of bean 'proxyCoreContentServiceSPRING_HTTP' with merged definition [Root bean: class [org.springframework.remoting.httpinvoker.HttpInvok erProxyFactoryBean]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [CoreServiceBeans.xml]]>
|#]
[#|2006-08-03T09:47:48.729-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:48,729 DEBUG [org.springframework.beans.factory.xml.XmlBeanFacto ry] - <Invoking BeanPostProcessors before instantiation of bean 'proxyCoreContentServiceSPRING_HTTP'>
|#]
[#|2006-08-03T09:47:48.744-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:48,744 DEBUG [org.springframework.beans.CachedIntrospectionResul ts] - <Using cached introspection results for class [org.springframework.remoting.httpinvoker.HttpInvok erProxyFactoryBean]>
|#]
[#|2006-08-03T09:47:48.744-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:48,744 DEBUG [org.springframework.beans.factory.xml.XmlBeanFacto ry] - <Eagerly caching bean with name 'proxyCoreContentServiceSPRING_HTTP' to allow for resolving potential circular references>
[#|2006-08-03T09:47:48.744-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:48,744 DEBUG [org.springframework.beans.BeanWrapperImpl] - <About to invoke write method [public void org.springframework.remoting.support.UrlBasedRemot eAccessor.setServiceUrl(java.lang.String)] on object of class [org.springframework.remoting.httpinvoker.HttpInvok erProxyFactoryBean]>
[#|2006-08-03T09:47:48.744-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:48,744 DEBUG [org.springframework.beans.BeanWrapperImpl] - <Invoked write method [public void org.springframework.remoting.support.UrlBasedRemot eAccessor.setServiceUrl(java.lang.String)] with value of type [java.lang.String]>
[#|2006-08-03T09:47:48.744-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:48,744 DEBUG [org.springframework.beans.PropertyTypeConverter] - <Converting String to [class java.lang.Class] using property editor [org.springframework.beans.propertyeditors.ClassEdi tor@1ea8fc0]>
[#|2006-08-03T09:47:48.744-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:48,744 DEBUG [org.springframework.beans.BeanWrapperImpl] - <About to invoke write method [public void org.springframework.remoting.support.RemoteAccesso r.setServiceInterface(java.lang.Class)] on object of class [org.springframework.remoting.httpinvoker.HttpInvok erProxyFactoryBean]>
[#|2006-08-03T09:47:48.744-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:48,744 DEBUG [org.springframework.core.CollectionFactory] - <Creating [java.util.IdentityHashMap]>
[#|2006-08-03T09:47:48.744-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:48,744 DEBUG [org.springframework.aop.framework.ProxyFactory] - <Added new aspect interface: net.pno.maya.service.core.content.CoreContentServi ce>
|#]
[#|2006-08-03T09:47:48.744-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:48,744 DEBUG [org.springframework.aop.framework.JdkDynamicAopPro xy] - <Creating JDK dynamic proxy>
|#]
[#|2006-08-03T09:47:48.776-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|????? The class of HTTP invoker proxy for service URL [http://localhost:8080/maya/http/CoreContentService.svc] is $Proxy71|
And this is the JMX bean load debug:
[#|2006-08-03T09:47:26.525-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|
2006-08-03 09:47:26,525 DEBUG [org.springframework.beans.CachedIntrospectionResul ts] - <Getting BeanInfo for class [org.springframework.remoting.httpinvoker.HttpInvok erProxyFactoryBean]>
|#]
[#|2006-08-03T09:47:26.588-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:26,588 DEBUG [org.springframework.beans.CachedIntrospectionResul ts] - <Caching PropertyDescriptors for class [org.springframework.remoting.httpinvoker.HttpInvok erProxyFactoryBean]>
|#]
[#|2006-08-03T09:47:26.588-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:26,588 DEBUG [org.springframework.beans.CachedIntrospectionResul ts] - <Found property 'class' of type [java.lang.Class]>
|#]
[#|2006-08-03T09:47:26.588-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:26,588 DEBUG [org.springframework.beans.CachedIntrospectionResul ts] - <Found property 'serviceInterface' of type [java.lang.Class]>
|#]
[#|2006-08-03T09:47:26.588-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:26,588 DEBUG [org.springframework.beans.CachedIntrospectionResul ts] - <Found property 'serviceUrl' of type [java.lang.String]>
|#]
[#|2006-08-03T09:47:26.588-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:26,588 DEBUG [org.springframework.beans.CachedIntrospectionResul ts] - <Found property 'singleton' of type [boolean]>
|#]
[#|2006-08-03T09:47:26.588-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:26,588 DEBUG [org.springframework.beans.CachedIntrospectionResul ts] - <Class [org.springframework.remoting.httpinvoker.HttpInvok erProxyFactoryBean] is not cache-safe>
|#]
[#|2006-08-03T09:47:26.588-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:26,588 DEBUG [org.springframework.core.CollectionFactory] - <Creating [java.util.LinkedHashMap]>
|#]
[#|2006-08-03T09:47:26.588-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:26,588 DEBUG [org.springframework.beans.BeanWrapperImpl] - <About to invoke write method [public void org.springframework.remoting.support.UrlBasedRemot eAccessor.setServiceUrl(java.lang.String)] on object of class [org.springframework.remoting.httpinvoker.HttpInvok erProxyFactoryBean]>
|#]
[#|2006-08-03T09:47:26.588-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:26,588 DEBUG [org.springframework.beans.BeanWrapperImpl] - <Invoked write method [public void org.springframework.remoting.support.UrlBasedRemot eAccessor.setServiceUrl(java.lang.String)] with value of type [java.lang.String]>
|#]
[#|2006-08-03T09:47:26.588-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:26,588 DEBUG [org.springframework.beans.PropertyTypeConverter] - <Converting String to [class java.lang.Class] using property editor [org.springframework.beans.propertyeditors.ClassEdi tor@fca1ca]>
|#]
[#|2006-08-03T09:47:26.603-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:26,603 DEBUG [org.springframework.beans.BeanWrapperImpl] - <About to invoke write method [public void org.springframework.remoting.support.RemoteAccesso r.setServiceInterface(java.lang.Class)] on object of class [org.springframework.remoting.httpinvoker.HttpInvok erProxyFactoryBean]>
|#]
[#|2006-08-03T09:47:26.603-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|2006-08-03 09:47:26,603 DEBUG [org.springframework.beans.BeanWrapperImpl] - <Invoked write method [public void org.springframework.remoting.support.RemoteAccesso r.setServiceInterface(java.lang.Class)] with value of type [java.lang.Class]>
|#]
[#|2006-08-03T09:47:26.603-0700|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|????? The class of org.springframework.remoting.httpinvoker.HttpInvok erProxyFactoryBean@1794e36 is org.springframework.remoting.httpinvoker.HttpInvok erProxyFactoryBean|#]