atom feed6 messages in org.apache.geronimo.userExtending DeltaManager in GBean - NoC...
FromSent OnAttachments
Russell E GlaueJul 21, 2006 9:37 am 
Jason DillonJul 21, 2006 12:04 pm 
Russell E GlaueJul 21, 2006 12:43 pm 
Aaron MulderJul 21, 2006 12:51 pm 
Russell E GlaueJul 21, 2006 1:22 pm 
Aaron MulderJul 21, 2006 1:41 pm 
Subject:Extending DeltaManager in GBean - NoClassDefFoundError: javax/servlet/http/HttpSession
From:Russell E Glaue (rgl@cait.org)
Date:Jul 21, 2006 9:37:30 am
List:org.apache.geronimo.user

Okay. Thanks to Jason, I got the hostinfoGBean deployed successfully.

now the next error... I also want to report in the hostinfoGBean how many sessions are on a node in the cluster. So I edited my hostinfoGBean class to extend DeltaManager and then added a function getSessionCount.

It compiles successfully. And it deploys in Geronimo 1.1, although with an error on deployment:

deploy.sh deploy target/wnode-1.0.jar wnode-plan.xml - Exception in thread "Thread-4" java.lang.NoClassDefFoundError: javax/servlet/http/HttpSession at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at
org.apache.geronimo.kernel.classloader.JarFileClassLoader.access$200(JarFileClassLoader.java:51) at
org.apache.geronimo.kernel.classloader.JarFileClassLoader$6.run(JarFileClassLoader.java:275) at java.security.AccessController.doPrivileged(Native Method) ... snip ... at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707) at java.lang.Thread.run(Thread.java:595) -

When deploying a similar GBean that extends DeltaManager in Geronimo 1.0, I did not get this error. Do I have to add another dependency in the deployment plan? I could not find the artifact in the geronimo 1.1 repository that contains the javax HttpSession class (Did I not look hard enough?). Do I have to deploy a new artifact to Geronimo 1.1?

Here is my updated code, the deployment plan has not changed.

java file: 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 void doFail() { glog.info("Service failed"); // TODO Auto-generated method stub }

public void doStart() throws Exception { glog.info("Service started"); // TODO Auto-generated method stub }

public void doStop() throws Exception { glog.info("Service stopped"); // TODO Auto-generated method stub }

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; }

} -

deployment plan: wnode-plan.xml - <?xml version="1.0" encoding="UTF-8"?> <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1"> <environment> <moduleId> <groupId>wnode</groupId> <artifactId>wnode</artifactId> <version>1.0</version> <type>jar</type> </moduleId> <dependencies> <dependency> <groupId>tomcat</groupId> <artifactId>catalina-cluster</artifactId> <version>5.5.15</version> <type>jar</type> </dependency> <dependency> <groupId>tomcat</groupId> <artifactId>catalina</artifactId> <version>5.5.15</version> <type>jar</type> </dependency> </dependencies> </environment> <gbean name='hostinfoGBean' class='org.cait.wnode.hostinfoGBean'></gbean> </module> -