geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Krishnakumar B <>
Subject Re: Classloading problem
Date Tue, 13 Sep 2005 03:20:55 GMT

GBean plan

<?xml version="1.0" encoding="UTF-8"?>


    <gbean name="HelloGBean" class="">

The GBean Class

 * Class ClientGbean
public class HelloGBean implements GBeanLifecycle  {
	private static Log log = LogFactory.getLog(HelloGBean.class);
	private final ObjectName objectName;
	private static final GBeanInfo GBEAN_INFO;
	static {
	GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("HelloGBean",
		// attributes
		infoFactory.setConstructor(new String[]{"objectName"});
		GBEAN_INFO = infoFactory.getBeanInfo();

	public HelloGBean(String objectName) {

		this.objectName = JMXUtil.getObjectName(objectName);

	public void doFail() {"Client GBean has failed");

	public void doStart() throws WaitingException, Exception {
		Hello hello = new Hello();"Created Hello");"Reference to Hello"+hello.getHello());

	public void doStop() throws WaitingException, Exception {"Client GBean has stoped");
	public static GBeanInfo getGBeanInfo() {
		return GBEAN_INFO;

In doStart i create an instance of Hello hello = new Hello();


public class Hello

	public static Hello hello;
	public Hello()
		System.out.println("Creating the static reference :"+this);
		hello = this;

	public static Hello getHello()
		System.out.println("Returning the static reference :"+hello);
		return hello;

Hello has a static variable public static Hello hello;

In a web application i am trying to get a reference to Hello by calling


I get a null in my Web Application.

I have deployed GBean and Web Application successfully.

Thanks for any help.

Krishnakumar B

On 9/12/05, Krishnakumar B <> wrote:
> Hi,
> I am initializing a class and have created a static reference through
> a GBean. The GBean loads on starting the server and the Class is
> initialized and reference stored.
> I have a Web app deployed in Jetty. When i try getting this Class
> reference i get a null.
> I am stuck and unable to proceed. Any ideas how to proceed or fix?
> The Web App plan has in dependency the GBean jar and also jar
> containing the Class initialized.
> Regards
> Krishnakumar

View raw message