Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 38655 invoked from network); 21 Jul 2006 21:34:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Jul 2006 21:34:25 -0000 Received: (qmail 84944 invoked by uid 500); 21 Jul 2006 21:34:19 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 84537 invoked by uid 500); 21 Jul 2006 21:34:18 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 84526 invoked by uid 99); 21 Jul 2006 21:34:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jul 2006 14:34:18 -0700 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=DNS_FROM_RFC_ABUSE,INFO_TLD,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of ammulder@gmail.com designates 66.249.92.173 as permitted sender) Received: from [66.249.92.173] (HELO ug-out-1314.google.com) (66.249.92.173) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jul 2006 14:34:17 -0700 Received: by ug-out-1314.google.com with SMTP id m2so1539132uge for ; Fri, 21 Jul 2006 14:33:56 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=LBdc9/8CRZlZblG61MGD0eOMOJEqcrsXKh1kugAuMM0NDrzhOz4E1OJtwcynYSjun4OA0BsGh8hW8L1avTipM18vV2et4aCzSYpVzMvUkmYrGrhDrHeZoynpbEvrIQFeatoOlroyfuLD0DnCjfjjRQUvt2ic8Px5Vd4tLsNe09A= Received: by 10.78.193.5 with SMTP id q5mr631509huf; Fri, 21 Jul 2006 14:33:56 -0700 (PDT) Received: by 10.78.175.6 with HTTP; Fri, 21 Jul 2006 14:33:56 -0700 (PDT) Message-ID: <74e15baa0607211433p28f556a8jca9572fff41a1cd4@mail.gmail.com> Date: Fri, 21 Jul 2006 17:33:56 -0400 From: "Aaron Mulder" Sender: ammulder@gmail.com To: user@geronimo.apache.org Subject: Re: Unknown start exception when extending DeltaManager in G1.1 - Special attribute objectName must have the type java.lang.String In-Reply-To: <44C13D14.9010101@cait.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <44C139BC.9040802@cait.org> <7FD0BD1A-5B4C-4F14-93EC-377ED71A6ACA@planet57.com> <44C13D14.9010101@cait.org> X-Google-Sender-Auth: eae4ce22ef9e8424 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N The problem appears to be that the DeltaManager has a property with name "objectName" and type "ObjectName". That's a conflict with a Geronimo special GBean attribute named "objectName" with type "String". You need to avoid that conflict. I think you have two options. One option is to, instead of extending DeltaManager, wrap it: public class MyGBean { private DeltaManager mgr; ... } In that case, you can create the DeltaManager in your GBean constructor, create the DeltaManager in your GBean doStart, or look up an existing DeltaManager somehow. (I don't know what DeltaManager is.) Then you can expose whatever GBean attributes you want on your GBean and pass the values through to the DeltaManager (either have the setters call mgr.setXYZ or store up all the values and apply them to the DeltaManager instance in doStart). You'd specifically need to avoid exposing the objectName attribute of type ObjectName. The other option is to continue to subclass DeltaManager, but instead of calling infoBuilder.addInterface(hostinfoGBean.class); you'd need to manually add all the attributes that should be exposed on the GBean (and exclude the objectName attribute, since it's causing problems). Thanks, Aaron On 7/21/06, Russell E Glaue wrote: > Well pretty much I want to wrap the DeltaManager in a GBean. And then I want to > access information from the DeltaManager in a web application using that same GBean. > > A lot of documentation I have been reading on GBeans after G1.0 came out writes > about exposing classes in Geronimo by wrapping them in a GBean. > > -RG > > > Jason Dillon wrote: > > Does DeltaManager define an attribute named objectName that is of type > > javax.management.ObjectName? > > > > Do you need to extend DeltaManager? Maybe you want to delegate to it > > instead of extend from it. > > > > --jason > > > > > > On Jul 21, 2006, at 1:31 PM, Russell E Glaue wrote: > > > >> My hostinfoGBean gbean deploys but will not startup. > >> > >> This is my gbean which I am trying to upgrade to Geronimo 1.1. It > >> compiled, deployed and started in Geronimo 1.0. > >> If I take out the implementation to the DeltaManager and deploy the > >> GBean, It deploys and starts up without errors. (code for gbean is below) > >> > >> Deployment message after taking DeltaManager implementation out of the > >> GBean: > >> - > >> Deployed wnode/wnode/1.0/jar > >> - > >> > >> > >> When deploying my hostinfoGBean that extends DeltaManager, I get this > >> configuration error: > >> - > >> Special attribute objectName must have the type java.lang.String, > >> but is javax.management.ObjectName: > >> targetClass=org.cait.wnode.hostinfoGBean > >> - > >> > >> If I extend DeltaManager in my GBean for Geronimo 1.1, do I now have > >> to do something different? > >> > >> When deploying a GBean, which extends DeltaManager, in Geronimo 1.0 I > >> do not get a startup configuration error. > >> > >> > >> Error message after deployment: > >> - > >> org.apache.geronimo.kernel.config.LifecycleException: start of > >> wnode/wnode/1.0/jar failed > >> at > >> org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:529) > >> > >> at > >> org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:493) > >> > >> at > >> org.apache.geronimo.kernel.config.SimpleConfigurationManager$$FastClassByCGLIB$$ce77a924.invoke() > >> > >> ... snip ... > >> at > >> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707) > >> > >> at java.lang.Thread.run(Thread.java:595) > >> Caused by: org.apache.geronimo.kernel.config.InvalidConfigException: > >> Unknown start exception > >> at > >> org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:440) > >> > >> at > >> org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:187) > >> > >> at > >> org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:512) > >> > >> ... 36 more > >> Caused by: org.apache.geronimo.gbean.InvalidConfigurationException: > >> Special attribute objectName must have the type java.lang.String, but > >> is javax.management.ObjectName: targetClass=org.cait.wnode.hostinfoGBean > >> at > >> org.apache.geronimo.gbean.runtime.GBeanAttribute.(GBeanAttribute.java:85) > >> > >> at > >> org.apache.geronimo.gbean.runtime.GBeanAttribute.createSpecialAttribute(GBeanAttribute.java:68) > >> > >> at > >> org.apache.geronimo.gbean.runtime.GBeanInstance.addManagedObjectAttributes(GBeanInstance.java:1194) > >> > >> at > >> org.apache.geronimo.gbean.runtime.GBeanInstance.(GBeanInstance.java:245) > >> > >> at > >> org.apache.geronimo.kernel.basic.BasicKernel.loadGBean(BasicKernel.java:354) > >> > >> at > >> org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:362) > >> > >> ... 38 more > >> Error: Operation failed: start of wnode/wnode/1.0/jar failed > >> > >> Unknown start exception > >> > >> Special attribute objectName must have the type java.lang.String, > >> but is javax.management.ObjectName: > >> targetClass=org.cait.wnode.hostinfoGBean > >> > >> > >> Here is my deployment plan for hostinfoGBean: > >> - > >> > >> > >> > >> > >> wnode > >> wnode > >> 1.0 > >> jar > >> > >> > >> > >> tomcat > >> catalina-cluster > >> 5.5.15 > >> jar > >> > >> > >> tomcat > >> catalina > >> 5.5.15 > >> jar > >> > >> > >> org.apache.geronimo.specs > >> geronimo-j2ee_1.4_spec > >> 1.1 > >> jar > >> > >> > >> org.apache.geronimo.specs > >> geronimo-servlet_2.4_spec > >> 1.0.1 > >> jar > >> > >> > >> > >> >> class='org.cait.wnode.hostinfoGBean'> > >> > >> - > >> > >> > >> Here is my hostinfoGBean class: > >> org/cait/wnode/hostinfoGBean.java > >> - > >> package org.cait.wnode; > >> > >> import java.util.HashMap; > >> import org.apache.commons.logging.*; > >> > >> import org.apache.catalina.cluster.session.DeltaManager; > >> import org.apache.geronimo.gbean.GBeanInfo; > >> import org.apache.geronimo.gbean.GBeanInfoBuilder; > >> import org.apache.geronimo.gbean.GBeanLifecycle; > >> > >> public class hostinfoGBean extends DeltaManager implements > >> GBeanLifecycle { > >> > >> public static final GBeanInfo GBEAN_INFO; > >> > >> private static final Log glog = > >> LogFactory.getLog(hostinfoGBean.class); > >> > >> public static GBeanInfo getGBeanInfo(){ > >> return GBEAN_INFO; > >> } > >> static{ > >> GBeanInfoBuilder infoBuilder = new > >> GBeanInfoBuilder("hostinfoGBean",hostinfoGBean.class); > >> infoBuilder.addInterface(hostinfoGBean.class); > >> GBEAN_INFO = infoBuilder.getBeanInfo(); > >> } > >> > >> // public hostinfoGBean(String[] hostport) {} > >> > >> public void doFail() { > >> glog.info("Service failed"); > >> } > >> > >> public void doStart() throws Exception { > >> glog.info("Service started"); > >> } > >> > >> public void doStop() throws Exception { > >> glog.info("Service stopped"); > >> } > >> > >> public String getName() { > >> return "node1.domain-noc1.test.com"; > >> } > >> public String getPort() { > >> return "80"; > >> } > >> public int getSessionCount() { > >> HashMap SessionHashMap = this.sessions; > >> int NumberOfSessions = 0; > >> NumberOfSessions = SessionHashMap.size(); > >> return NumberOfSessions; > >> } > >> > >> } > >> - > >> > > > >