Re: [RomaFramework-dev] Exception while starting blog
Brought to you by:
lvca
|
From: Massimiliano L. <kri...@gm...> - 2006-05-16 16:12:44
|
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
=09
=09SchemaClass cls =3D ObjectContext.getInstance().getComponent(
=09 SchemaManager.class).getClassInfo(iObj.getClass().getSimpleN=
ame());
=09
=09boolean enabled =3D
(Boolean)cls.getFeature(MonitoringAspect.ASPECT_NAME, "enabled");
=09if(enabled){
=09=09agent.registerMBeans(iObj);
=09}
}
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.Illeg=
alArgumentException,java.lang.InstantiationException,java.lang.IllegalAcces=
sException,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
=09at org.romaframework.aspect.monitoring.jmx.JmxMonitoringAspect.monitorOb=
ject(JmxMonitoringAspect.java:47)
=09at it.blog2.view.domain.blog.BlogCreate.<init>(BlogCreate.java:20)
=09at it.blog2.view.domain.blog.BlogCreate.<init>(BlogCreate.java:24)
=09at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
=09at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
=09at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou=
rce)
........
........
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 applications
> http://www.Pro-Netics.com (member of Orixo.com - The XML business allianc=
e)
> http://www.OrienTechnologies.com - Light ODBMS, All in one JDO solution
>
> 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.DefaultComponen=
tFactory"
> >> 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 applications
> >> http://www.Pro-Netics.com (member of Orixo.com - The XML business
> >> alliance)
> >> http://www.OrienTechnologies.com - Light ODBMS, All in one JDO solutio=
n
> >>
> >> 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.factory.Be=
anDefinitionStoreException:
> >> > Line 134 in XML document from ServletContext resource
> >> > [/WEB-INF/applicationContext.xml] is invalid; nested exception is
> >> > org.xml.sax.SAXParseException: Attribute value "ComponentFactory" of
> >> > type ID must be unique within the document.]
> >> > at org.mortbay.http.HttpServer.doStart(HttpServer.java:686)
> >> > 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 "ComponentFactory" of
> >> > type ID must be unique within the document.
> >> > org.xml.sax.SAXParseException: Attribute value "ComponentFactory" of
> >> > type ID must be unique within the document.
> >> > at
> >> > org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(U=
nknown
> >> > Source)
> >> > at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
> >> 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(Unkn=
own
> >> > Source)
> >> > at
> >> > org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndVali=
date(Unknown
> >> > Source)
> >> > at
> >> org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown
> >> > Source)
> >> > at
> >> org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown
> >> > Source)
> >> > at
> >> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartEleme=
nt(Unknown
> >> > Source)
> >> > at
> >> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentConten=
tDispatcher.dispatch(Unknown
> >> > Source)
> >> > at
> >> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(U=
nknown
> >> > Source)
> >> > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> >> Source)
> >> > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> >> Source)
> >> > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> >> > at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
> >> > at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
> >> Source)
> >> > at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
> >> > at
> >> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBe=
anDefinitions(XmlBeanDefinitionReader.java:161)
> >> > at
> >> > org.springframework.beans.factory.support.AbstractBeanDefinitionRead=
er.loadBeanDefinitions(AbstractBeanDefinitionReader.java:125)
> >> > at
> >> > org.springframework.beans.factory.support.AbstractBeanDefinitionRead=
er.loadBeanDefinitions(AbstractBeanDefinitionReader.java:141)
> >> > at
> >> > org.springframework.web.context.support.XmlWebApplicationContext.loa=
dBeanDefinitions(XmlWebApplicationContext.java:126)
> >> > at
> >> > org.springframework.web.context.support.XmlWebApplicationContext.loa=
dBeanDefinitions(XmlWebApplicationContext.java:94)
> >> > at
> >> > org.springframework.context.support.AbstractRefreshableApplicationCo=
ntext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
> >> > at
> >> > org.springframework.context.support.AbstractApplicationContext.refre=
sh(AbstractApplicationContext.java:268)
> >> > at
> >> > org.springframework.web.context.support.AbstractRefreshableWebApplic=
ationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
> >> > at
> >> > org.springframework.web.context.ContextLoader.createWebApplicationCo=
ntext(ContextLoader.java:230)
> >> > at
> >> > org.springframework.web.context.ContextLoader.initWebApplicationCont=
ext(ContextLoader.java:156)
> >> > at
> >> > org.springframework.web.context.ContextLoaderListener.contextInitial=
ized(ContextLoaderListener.java:48)
> >> > at
> >> > org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicati=
onContext.java:495)
> >> > at org.mortbay.util.Container.start(Container.java:72)
> >> > at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
> >> > 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, security?
> Get stuff done quickly with pre-integrated technology to make your job ea=
sier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim=
o
> 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
>
|