Announcement Announcement Module
Collapse
No announcement yet.
Spring JMX and OC4J/10g r3, Two applications, Same Bean, Two behaviors Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring JMX and OC4J/10g r3, Two applications, Same Bean, Two behaviors

    Greetings

    Im on a OC4J 10G r3, JDk 5 and Spring 1.2.3 installation and I have an issue. First i develop a concept proof application with a MBean up on autodetect MBeanExporter feature. That works fine. But when I deployit in the real application, on same container with different names, I get the following Exception. The XML context follows the log.

    ------------------------------------------------------------------------

    10:53:47 ERROR [DispatcherServlet] Context initialization failed
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'com.mercurio.adsm.beanfactory' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.context.support.ClassPathXmlAp plicationContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'exporter' defined in class path resource [ADSM-managed-beans.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Must specify at least one bean for registration
    org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.context.support.ClassPathXmlAp plicationContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'exporter' defined in class path resource [ADSM-managed-beans.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Must specify at least one bean for registration
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'exporter' defined in class path resource [ADSM-managed-beans.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Must specify at least one bean for registration
    java.lang.IllegalArgumentException: Must specify at least one bean for registration
    at org.springframework.jmx.export.MBeanExporter.regis terBeans(MBeanExporter.java:287)
    at org.springframework.jmx.export.MBeanExporter.after PropertiesSet(MBeanExporter.java:240)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1003)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:348)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:275)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:317)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:80)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:65)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Construc tor.java:494)
    at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:100)
    at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:75)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.autowireConstructor(Abs tractAutowireCapableBeanFactory.java:614)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:312)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:275)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:317)
    at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:134)
    at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:3 05)
    at org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:250 )
    at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:219)
    at org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:111)
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:256)
    at com.evermind.server.http.HttpApplication.loadServl et(HttpApplication.java:2231)
    at com.evermind.server.http.HttpApplication.findServl et(HttpApplication.java:4617)
    at com.evermind.server.http.HttpApplication.findServl et(HttpApplication.java:4541)
    at com.evermind.server.http.HttpApplication.initPrelo adServlets(HttpApplication.java:4730)
    at com.evermind.server.http.HttpApplication.initDynam ic(HttpApplication.java:1019)
    at com.evermind.server.http.HttpApplication.<init>(Ht tpApplication.java:649)
    at com.evermind.server.ApplicationStateRunning.getHtt pApplication(ApplicationStateRunning.java:428)
    at com.evermind.server.Application.getHttpApplication (Application.java:512)
    at com.evermind.server.http.HttpSite$HttpApplicationR unTimeReference.createHttpApplicationFromReference (HttpSite.java:1975)
    at com.evermind.server.http.HttpSite$HttpApplicationR unTimeReference.<init>(HttpSite.java:1894)
    at com.evermind.server.http.HttpSite.addHttpApplicati on(HttpSite.java:1591)
    at oracle.oc4j.admin.internal.WebApplicationBinder.bi ndWebApp(WebApplicationBinder.java:206)
    at oracle.oc4j.admin.internal.WebApplicationBinder.bi ndWebApp(WebApplicationBinder.java:96)
    at oracle.oc4j.admin.internal.ApplicationDeployer.bin dWebApp(ApplicationDeployer.java:541)
    at oracle.oc4j.admin.internal.ApplicationDeployer.doD eploy(ApplicationDeployer.java:197)
    at oracle.oc4j.admin.internal.DeployerBase.execute(De ployerBase.java:93)
    at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDep loyerRunnable.doRun(OC4JDeployerRunnable.java:52)
    at oracle.oc4j.admin.jmx.server.mbeans.deploy.Deploye rRunnable.run(DeployerRunnable.java:81)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Wo rker.run(PooledExecutor.java:814)
    at java.lang.Thread.run(Thread.java:595)

    -----------------------------------------------------------------------

    <beans>
    <bean name="bean:name=BatchService"
    class="framework.batch.jmx.BatchService"
    singleton="true" lazy-init="false">
    <property name="instanceId" value="One" />
    <property name="instanceName" value="BatchService" />
    </bean>

    <!-- COnfiguracoes JMX -->
    <bean id="mbeanServer"
    class="org.springframework.jmx.support.MBeanServer FactoryBean" />

    <bean id="exporter"
    class="org.springframework.jmx.export.MBeanExporte r">
    <property name="autodetect" value="true" />

    <!-- <property name="assembler" ref="assembler" /> -->
    <property name="server" ref="mbeanServer" />
    </bean>

    <bean id="assembler"
    class="org.springframework.jmx.export.assembler.Me tadataMBeanInfoAssembler">
    <property name="attributeSource">
    <bean id="attributeSource"
    class="org.springframework.jmx.export.annotation.A nnotationJmxAttributeSource" />
    </property>
    </bean>

    </beans>
    -------------------------------------------------------------

    Thank you in advance.

  • #2
    O Yes. I forgot. The autodetect MBeanExporter feature works fine in the prototype application, but when I deploy it in the target application, doesn´t work.

    When I use the explicit MBean declaration ("beans" map property) I get the Spring created proxy methods exposed, not only the defined in the bean implementation. In this scenario, the properties appear in OC4J console, but the Bean seens not initialized (properties are unsetted).


    any help, I will appreciate.

    Thank You.

    Comment


    • #3
      I found it.

      In the targe application there is a custom AutoProxyCreator. I Included the MBean in the custom excelusion list and it works.

      It only works with explicit MBeans declaration and autodetect setted to "false". There is still an issue with the MetadataMBeanInfoAssembler with AnnotationJmxAttributeSource in which throws an Authorization Exception like this post.

      Comment

      Working...
      X