Announcement Announcement Module
Collapse
No announcement yet.
toString invoked in JSF application? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • toString invoked in JSF application?

    Hi,
    when trying to inject a simple MBeanProxy from Spring into a JSF managed bean, I get a :
    org.springframework.jmx.access.InvalidInvocationEx ception: Operation 'toString' is not exposed on the management interface
    Excepton!

    I am curious about why the toString is invoked??
    Using:
    spring-2.0-m4
    JSF RI 1.2 snapshot
    faclets 1.1.6

    Spring xml config:
    Code:
    	<bean id="jmxMonManagerProxy" class="org.springframework.jmx.access.MBeanProxyFactoryBean">
    		<property name="objectName" value="net.mickeandersson.monitor.jmx:name=jmxMonManager"/>
    		<property name="proxyInterface" value="net.mickeandersson.monitor.jmx.JmxMonManagerIF"/>
    		<property name="server" ref="clientConnector"/>
    	</bean>
    JSF bean config:
    Code:
    	<managed-bean>
    		<managed-bean-name>statusBean</managed-bean-name>
    		<managed-bean-class>net.mickeandersson.monitor.web.beans.MonitorStatusBean</managed-bean-class>
    		<managed-bean-scope>request</managed-bean-scope>
    		<managed-property>
    			<property-name>jmxMonMan</property-name>
    			<value>#{jmxMonManagerProxy}</value>
    		</managed-property>
    	</managed-bean>
    Could it be that it is some logging which invokes the toString method??

    Full Exception:
    19-May-2006 21:47:13 com.sun.faces.application.ApplicationAssociate createAndMaybeStoreManagedBeans
    SEVERE: JSF1001: Managedbean statusBean could not be created.
    19-May-2006 21:52:22 com.sun.faces.application.ApplicationAssociate createAndMaybeStoreManagedBeans
    SEVERE: JSF1001: Managedbean statusBean could not be created.
    19-May-2006 21:52:22 com.sun.facelets.FaceletViewHandler handleRenderException
    SEVERE: Error Rendering View[/pages/status.xhtml]
    javax.el.ELException: /content/statusBody.xhtml: javax.faces.FacesException: Cant set managed bean property: jmxMonMan.
    at com.sun.facelets.compiler.TextInstruction.write(Te xtInstruction.java:50)
    at com.sun.facelets.compiler.UIInstructions.encodeBeg in(UIInstructions.java:39)
    at com.sun.facelets.compiler.UILeaf.encodeAll(UILeaf. java:149)
    at javax.faces.component.UIComponent.encodeAll(UIComp onent.java:889)
    at com.sun.facelets.FaceletViewHandler.renderView(Fac eletViewHandler.java:614)
    at com.sun.faces.lifecycle.RenderResponsePhase.execut e(RenderResponsePhase.java:108)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(Lifecy cleImpl.java:266)
    at com.sun.faces.lifecycle.LifecycleImpl.render(Lifec ycleImpl.java:159)
    at javax.faces.webapp.FacesServlet.service(FacesServl et.java:245)
    at org.mortbay.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:423)
    at org.mortbay.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:965)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter. doFilter(ExtensionsFilter.java:144)
    at org.mortbay.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:956)
    at org.mortbay.jetty.servlet.ServletHandler.handle(Se rvletHandler.java:353)
    at org.mortbay.jetty.servlet.SessionHandler.handle(Se ssionHandler.java:219)
    at org.mortbay.jetty.handler.ContextHandler.handle(Co ntextHandler.java:542)
    at org.mortbay.jetty.handler.ContextHandlerCollection .handle(ContextHandlerCollection.java:145)
    at org.mortbay.jetty.handler.HandlerCollection.handle (HandlerCollection.java:126)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:119)
    at org.mortbay.jetty.Server.handle(Server.java:245)
    at org.mortbay.jetty.HttpConnection.handlerRequest(Ht tpConnection.java:365)
    at org.mortbay.jetty.HttpConnection.access$1500(HttpC onnection.java:38)
    at org.mortbay.jetty.HttpConnection$RequestHandler.he aderComplete(HttpConnection.java:609)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser. java:486)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpPa rser.java:196)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnec tion.java:296)
    at org.mortbay.jetty.nio.SelectChannelConnector$HttpE ndPoint.run(SelectChannelConnector.java:740)
    at org.mortbay.thread.BoundedThreadPool$PoolThread.ru n(BoundedThreadPool.java:435)
    Caused by: javax.faces.FacesException: javax.faces.FacesException: Cant set managed bean property: jmxMonMan.
    at com.sun.faces.application.ApplicationAssociate.cre ateAndMaybeStoreManagedBeans(ApplicationAssociate. java:556)
    at com.sun.faces.el.ManagedBeanELResolver.getValue(Ma nagedBeanELResolver.java:83)
    at javax.el.CompositeELResolver.getValue(CompositeELR esolver.java:135)
    at com.sun.faces.el.FacesCompositeELResolver.getValue (FacesCompositeELResolver.java:62)
    at com.sun.faces.el.ChainAwareVariableResolver.resolv eVariable(ChainAwareVariableResolver.java:95)
    at org.springframework.web.jsf.DelegatingVariableReso lver.resolveVariable(DelegatingVariableResolver.ja va:108)
    at com.sun.faces.el.VariableResolverChainWrapper.getV alue(VariableResolverChainWrapper.java:91)
    at javax.el.CompositeELResolver.getValue(CompositeELR esolver.java:135)
    at com.sun.faces.el.FacesCompositeELResolver.getValue (FacesCompositeELResolver.java:62)
    at com.sun.el.parser.AstIdentifier.getValue(AstIdenti fier.java:44)
    at com.sun.el.parser.AstValue.getValue(AstValue.java: 85)
    at com.sun.el.ValueExpressionImpl.getValue(ValueExpre ssionImpl.java:183)
    at com.sun.facelets.el.ELText$ELTextVariable.writeTex t(ELText.java:184)
    at com.sun.facelets.el.ELText$ELTextComposite.writeTe xt(ELText.java:108)
    at com.sun.facelets.compiler.TextInstruction.write(Te xtInstruction.java:45)
    ... 27 more
    Caused by: javax.faces.FacesException: Cant set managed bean property: jmxMonMan.
    at com.sun.faces.config.ManagedBeanFactoryImpl.setPro pertiesIntoBean(ManagedBeanFactoryImpl.java:685)
    at com.sun.faces.config.ManagedBeanFactoryImpl.newIns tance(ManagedBeanFactoryImpl.java:345)
    at com.sun.faces.application.ApplicationAssociate.cre ateAndMaybeStoreManagedBeans(ApplicationAssociate. java:542)
    ... 41 more
    Caused by: org.springframework.jmx.access.InvalidInvocationEx ception: Operation 'toString' is not exposed on the management interface
    at org.springframework.jmx.access.MBeanClientIntercep tor.invokeOperation(MBeanClientInterceptor.java:35 8)
    at org.springframework.jmx.access.MBeanClientIntercep tor.invoke(MBeanClientInterceptor.java:301)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :170)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:176)
    at $Proxy0.toString(Unknown Source)
    at com.sun.faces.config.ManagedBeanFactoryImpl.getCon vertedValueConsideringPrimitives(ManagedBeanFactor yImpl.java:947)
    at com.sun.faces.config.ManagedBeanFactoryImpl.setPro pertiesIntoBean(ManagedBeanFactoryImpl.java:664)
    ... 43 more

  • #2
    It seems more like the JSF implementation does this when setting the properties into your bean:

    at $Proxy0.toString(Unknown Source)
    ConvertedValueConsideringPrimitives(ManagedBeanFac toryImpl.java:947)
    at com.sun.faces.config.ManagedBeanFactoryImpl.setPro pertiesIntoBean(ManagedBeanFactoryImpl.java:664)
    ... 43 more

    Comment


    • #3
      Ok,
      missed that line.
      Annoying, guess I'll have to implement toString for my JMX managed beans..

      Thans for the help.

      Comment

      Working...
      X