Re: [RomaFramework-dev] Exception while starting blog
Brought to you by:
lvca
|
From: Massimiliano L. <kri...@gm...> - 2006-05-16 17:27:52
|
Ok now everything works!! ;) If i put @MonitoringClass(enabled=3DAnnotationConstants.FALSE) the object is completely ignored by monitoring ^^ (I'm happy...seems like i finished) Massimiliano. On 5/16/06, Massimiliano Loconte <kri...@gm...> wrote: > You mean something like: > > boolean enabled =3D > (Boolean)cls.getFeature(MonitoringAspect.ASPECT_NAME,MonitoringFeatures.E= NABLED); > ? > > For the tutorial, yeah i could write myself...you have to give me > directives first ^^ > > Massimiliano. > > On 5/16/06, Luca Garulli <l.g...@pr...> wrote: > > Hi Massimiliano, > > it's better to use MonitoringFeatures.ENABLED constant instead of > > "enabled" directly. Please replace it in all sources. > > > > For the problem you've signaled...I resolved on the fly (revision > > 200)...it was a bug. > > > > Now should works ;-) > > > > However...Good work Massimiliano! I hope to include the Monitoring Aspe= ct > > in the next DEMO and, surely, in a next TUTORIAL ;-) > > > > Mhmhm... Rather...Do you want to write it yourself? :-D > > > > bye, > > Luca Garulli > > Blogging on: http://zion-city.blogspot.com > > http://www.RomaFramework.org - The new way to build Java applications > > http://www.Pro-Netics.com (member of Orixo.com - The XML business allia= nce) > > http://www.OrienTechnologies.com - Light ODBMS, All in one JDO solution > > > > On Tue, May 16, 2006 18:12, Massimiliano Loconte said: > > > Ok..It's done, now it completely avoids to monitorn unwanted fields > > > (and their accessors methods) or methods. Last question is: do I have > > > to read the annotation: > > > > > > @MonitoringClass(enabled=3DAnnotationConstants.TRUE)? > > > > > > I tried to read it in the monitorObject method of the > > > JmxMonitornAspect class in this way: > > > > > > public void monitorObject(Object iObj) throws MonitoringException { > > > > > > // REGISTER THE OBJECT PASSED AS PARAMETER INTO THE MBEANSERVER > > > > > > SchemaClass cls =3D ObjectContext.getInstance().getComponent( > > > SchemaManager.class).getClassInfo(iObj.getClass().g= etSimpleName()); > > > > > > boolean enabled (Boolean)cls.getFeature(MonitoringAspect.ASPECT= _NAME, > > > "enabled"); > > > > > > if(enabled){ > > > agent.registerMBeans(iObj); > > > } > > > } > > > > > > but i get an exception when i click on the create button: > > > > > > 18:07:04,170 INFO [Controller] [Controller.executeAction] Executing > > > action: create (action:public void > > > org.romaframework.module.crud.CRUDMain.create() throws > > > java.lang.SecurityException,java.lang.NoSuchMethodException,java.lang= .IllegalArgumentException,java.lang.InstantiationException,java.lang.Illega= lAccessException,java.lang.reflect.InvocationTargetException) > > > on object it.blog2.view.domain.blog.BlogMain@153113d... > > > 18:07:04,170 WARN [Controller] [Controller.executeAction] error on > > > execution of method: create > > > java.lang.ClassCastException: java.lang.Byte > > > at > > > org.romaframework.aspect.monitoring.jmx.JmxMonitoringAspect.monitorOb= ject(JmxMonitoringAspect.java:47) > > > at it.blog2.view.domain.blog.BlogCreate.<init>(BlogCreate.java:= 20) > > > at it.blog2.view.domain.blog.BlogCreate.<init>(BlogCreate.java:= 24) > > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ= e Method) > > > at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow= n Source) > > > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un= known > > > Source) > > > ........ > > > ........ > > > > > > do I have to read it? I think it should have a sense but I wonder why > > > that class cast exception... > > > > > > > > > On 5/16/06, Luca Garulli <l.g...@pr...> wrote: > > >> Yes, > > >> @MinitoringField annotation applies to field and getters. > > >> @MonitoringAction, instead, is for methods. > > >> > > >> So you should disable field/getter/setter for > > >> MinitoringField.enabled=3D=3Dfalse and all methods for > > >> MinitoringAction.enabled=3D=3Dfalse. > > >> > > >> bye, > > >> Luca Garulli > > >> Blogging on: http://zion-city.blogspot.com > > >> http://www.RomaFramework.org - The new way to build Java application= s > > >> http://www.Pro-Netics.com (member of Orixo.com - The XML business > > >> alliance) > > >> http://www.OrienTechnologies.com - Light ODBMS, All in one JDO solut= ion > > >> > > >> On Tue, May 16, 2006 17:36, Massimiliano Loconte said: > > >> > Ok..i tested the monitoring setting one field with the annotation: > > >> > @MonitoringField(enabled=3DAnnotationConstants.FALSE) > > >> > and works...that attribute is ignored as espected. > > >> > > > >> > I have a question, do you think i can generalize saying that once = I > > >> > don't want an attribute to be monitorable i don't want to monitor = his > > >> > getter and setter methods as well(whether it has any)? > > >> > > > >> > On 5/16/06, Luca Garulli <l.g...@pr...> wrote: > > >> >> Yes, > > >> >> the version of "blog2" project you have doesn't declare the > > >> >> ComponentFactory. > > >> >> > > >> >> Add these lines in applicationContext.xml > > >> >> > > >> >> <bean abstract=3D"false" autowire=3D"default" > > >> >> class=3D"org.romaframework.aspect.view.echo2.component.DefaultCom= ponentFactory" > > >> >> dependency-check=3D"default" id=3D"ComponentFactory" > > >> lazy-init=3D"default" > > >> >> singleton=3D"true"> > > >> >> </bean> > > >> >> > > >> >> bye, > > >> >> Luca Garulli > > >> >> Blogging on: http://zion-city.blogspot.com > > >> >> http://www.RomaFramework.org - The new way to build Java applicat= ions > > >> >> http://www.Pro-Netics.com (member of Orixo.com - The XML business > > >> >> alliance) > > >> >> http://www.OrienTechnologies.com - Light ODBMS, All in one JDO > > >> solution > > >> >> > > >> >> On Tue, May 16, 2006 16:27, Massimiliano Loconte said: > > >> >> > Hi, Luca i've just updated svn an recompiled with ant install, > > >> after > > >> >> > refreshing in eclipse and starting the blog2 test application i= get > > >> >> > the following exception: > > >> >> > > > >> >> > 16:23:30,485 INFO [SocketListener] Started SocketListener on > > >> >> 0.0.0.0:8080 > > >> >> > 16:23:30,485 WARN [Server] EXCEPTION > > >> >> > org.mortbay.util.MultiException[org.springframework.beans.facto= ry.BeanDefinitionStoreException: > > >> >> > Line 134 in XML document from ServletContext resource > > >> >> > [/WEB-INF/applicationContext.xml] is invalid; nested exception = is > > >> >> > org.xml.sax.SAXParseException: Attribute value "ComponentFactor= y" > > >> of > > >> >> > type ID must be unique within the document.] > > >> >> > at org.mortbay.http.HttpServer.doStart(HttpServer.java:68= 6) > > >> >> > at org.mortbay.util.Container.start(Container.java:72) > > >> >> > at org.mortbay.jetty.Server.main(Server.java:460) > > >> >> > org.springframework.beans.factory.BeanDefinitionStoreException: > > >> Line > > >> >> > 134 in XML document from ServletContext resource > > >> >> > [/WEB-INF/applicationContext.xml] is invalid; nested exception = is > > >> >> > org.xml.sax.SAXParseException: Attribute value "ComponentFactor= y" > > >> of > > >> >> > type ID must be unique within the document. > > >> >> > org.xml.sax.SAXParseException: Attribute value "ComponentFactor= y" > > >> of > > >> >> > type ID must be unique within the document. > > >> >> > at > > >> >> > org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseExcept= ion(Unknown > > >> >> > Source) > > >> >> > at org.apache.xerces.util.ErrorHandlerWrapper.error(Unkno= wn > > >> >> Source) > > >> >> > at > > >> org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown > > >> >> Source) > > >> >> > at > > >> org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown > > >> >> Source) > > >> >> > at > > >> >> > org.apache.xerces.impl.dtd.XMLDTDValidator.validateDTDattribute= (Unknown > > >> >> > Source) > > >> >> > at > > >> >> > org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAn= dValidate(Unknown > > >> >> > Source) > > >> >> > at > > >> >> org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unk= nown > > >> >> > Source) > > >> >> > at > > >> >> org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown > > >> >> > Source) > > >> >> > at > > >> >> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStart= Element(Unknown > > >> >> > Source) > > >> >> > at > > >> >> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentC= ontentDispatcher.dispatch(Unknown > > >> >> > Source) > > >> >> > at > > >> >> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocum= ent(Unknown > > >> >> > Source) > > >> >> > at org.apache.xerces.parsers.XML11Configuration.parse(Unk= nown > > >> >> Source) > > >> >> > at org.apache.xerces.parsers.XML11Configuration.parse(Unk= nown > > >> >> Source) > > >> >> > at org.apache.xerces.parsers.XMLParser.parse(Unknown Sour= ce) > > >> >> > at org.apache.xerces.parsers.DOMParser.parse(Unknown Sour= ce) > > >> >> > at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unkno= wn > > >> >> Source) > > >> >> > at javax.xml.parsers.DocumentBuilder.parse(Unknown Source= ) > > >> >> > at > > >> >> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.l= oadBeanDefinitions(XmlBeanDefinitionReader.java:161) > > >> >> > at > > >> >> > org.springframework.beans.factory.support.AbstractBeanDefinitio= nReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:125) > > >> >> > at > > >> >> > org.springframework.beans.factory.support.AbstractBeanDefinitio= nReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:141) > > >> >> > at > > >> >> > org.springframework.web.context.support.XmlWebApplicationContex= t.loadBeanDefinitions(XmlWebApplicationContext.java:126) > > >> >> > at > > >> >> > org.springframework.web.context.support.XmlWebApplicationContex= t.loadBeanDefinitions(XmlWebApplicationContext.java:94) > > >> >> > at > > >> >> > org.springframework.context.support.AbstractRefreshableApplicat= ionContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89= ) > > >> >> > at > > >> >> > org.springframework.context.support.AbstractApplicationContext.= refresh(AbstractApplicationContext.java:268) > > >> >> > at > > >> >> > org.springframework.web.context.support.AbstractRefreshableWebA= pplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134= ) > > >> >> > at > > >> >> > org.springframework.web.context.ContextLoader.createWebApplicat= ionContext(ContextLoader.java:230) > > >> >> > at > > >> >> > org.springframework.web.context.ContextLoader.initWebApplicatio= nContext(ContextLoader.java:156) > > >> >> > at > > >> >> > org.springframework.web.context.ContextLoaderListener.contextIn= itialized(ContextLoaderListener.java:48) > > >> >> > at > > >> >> > org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebAppl= icationContext.java:495) > > >> >> > at org.mortbay.util.Container.start(Container.java:72) > > >> >> > at org.mortbay.http.HttpServer.doStart(HttpServer.java:70= 8) > > >> >> > at org.mortbay.util.Container.start(Container.java:72) > > >> >> > at org.mortbay.jetty.Server.main(Server.java:460) > > >> >> > > > >> >> > > > >> >> > Maybe something wrong in a xml file? > > >> >> > > > >> >> > Massimiliano Loconte. > > >> > > > > > > > > ------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, securit= y? > > Get stuff done quickly with pre-integrated technology to make your job = easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geron= imo > > http://sel.as-us.falkag.net/sel?cmdlnk&kid=120709&bid&3057&dat=121642 > > _______________________________________________ > > RomaFramework-development mailing list > > Rom...@li... > > https://lists.sourceforge.net/lists/listinfo/romaframework-development > > > |