geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell E Glaue <>
Subject InvalidConfigurationException: Could not find a valid constructor for GBean
Date Fri, 21 Jul 2006 15:31:23 GMT
I seem to be having an issue with my GBean for Geronimo 1.1

My GBean deployed in Geronimo 1.0.
I upgraded to Geronimo 1.1
I followed all the steps outline in documentation I found to upgrade my GBean 
I read through all the posts on dev and user of these geronimo mail lists.
I even searched the Geronimo commits to look for changes in syntax and coding.

But I cannot get past this error which I get when deploying my GBean:

Caused by: org.apache.geronimo.gbean.InvalidConfigurationException: Could not 
find a valid constructor for GBean: org.cait.wnode.hostinfoGBean

Error message: deploy target/wnode-1.0.jar wnode-plan.xml
Exception in thread "Thread-3" java.lang.ExceptionInInitializerError
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
... snip ...
Caused by: org.apache.geronimo.gbean.InvalidConfigurationException: Could not 
find a valid constructor for GBean: org.cait.wnode.hostinfoGBean
         at org.cait.wnode.hostinfoGBean.<clinit>(
         ... 55 more

I have one simple GBean I want to deploy.
The GBean simply reports the host name (String) of a node. It will eventually 
read from a file, but now just spits out an example string.

(Eventually, in our testing process, I want our web apps to write debug messages 
to the web page which will include the hostname of the server in our geronimo 
cluster the error was experienced on. This will be tied into a monitoring system 
in our auto-build/test process, etc..)

Below is the code - One single Java file, one deployer file.
What do I have wrong... this similar configuration worked in Geronimo 1.0.

java file: org/cait/wnode/
package org.cait.wnode;

import org.apache.commons.logging.*;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoBuilder;
import org.apache.geronimo.gbean.GBeanLifecycle;

public class hostinfoGBean implements GBeanLifecycle {

         public static final GBeanInfo GBEAN_INFO;

         private static final Log glog = LogFactory.getLog(hostinfoGBean.class);

         public static GBeanInfo getGBeanInfo(){
                 return GBEAN_INFO;
                 GBeanInfoBuilder infoBuilder = new 
                 infoBuilder.addAttribute("HostName", String.class, false);
                 infoBuilder.addAttribute("HostPort", int.class, true);
                 infoBuilder.setConstructor(new String[]{"HostName","HostPort"});
                 GBEAN_INFO = infoBuilder.getBeanInfo();

         public void doFail() {
       "Service failed");

         public void doStart() throws Exception {
       "Service started");

         public void doStop() throws Exception {
       "Service stopped");

         public String getName() {
                 return "";
         public String getPort() {
                 return "80";

deployment plan: wnode-plan.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="">
   <gbean name='hostinfoGBean' class='org.cait.wnode.hostinfoGBean'></gbean>

View raw message