geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell E Glaue <rgl...@cait.org>
Subject Re: Extending DeltaManager in GBean - NoClassDefFoundError: javax/servlet/http/HttpSession
Date Fri, 21 Jul 2006 19:43:07 GMT

The two jar libraries contain the javax/servlet/http/HttpSession class
geronimo-j2ee_1.4_spec-1.x.jar
geronimo-servlet_2.4_spec-1.x.ja

In Geronimo 1.0 these two JARs exist in the repository as:
<geronimo>/repository/org.apache.geronimo.specs/jars/geronimo-j2ee_1.4_spec-1.0.jar
<geronimo>/repository/org.apache.geronimo.specs/jars/geronimo-servlet_2.4_spec-1.0.jar

However in Geronimo 1.1 they exist in this structure as:
<geronimo>/repository/org/apache/geronimo/specs/geronimo-j2ee_1.4_spec/1.1/geronimo-j2ee_1.4_spec-1.1.jar
<geronimo>/repository/org/apache/geronimo/specs/geronimo-servlet_2.4_spec/1.0.1/geronimo-servlet_2.4_spec-1.0.1.jar

Is this new multi-directory structure not allowing these JARs to be read by 
Geronimo 1.1 on startup??
-RG


Geronimo 1.0 repository:
-
JAR: org.apache.geronimo.specs/jars/geronimo-j2ee_1.4_spec-1.0.jar
    626 Tue Dec 13 10:04:06 CST 2005 javax/servlet/http/HttpSessionEvent.class
    264 Tue Dec 13 10:04:06 CST 2005 javax/servlet/http/HttpSessionListener.class
    288 Tue Dec 13 10:04:06 CST 2005 javax/servlet/http/HttpSessionContext.class
    872 Tue Dec 13 10:04:06 CST 2005 javax/servlet/http/HttpSession.class
    317 Tue Dec 13 10:04:06 CST 2005 
javax/servlet/http/HttpSessionAttributeListener.class
   1109 Tue Dec 13 10:04:06 CST 2005 
javax/servlet/http/HttpSessionBindingEvent.class
    292 Tue Dec 13 10:04:06 CST 2005 
javax/servlet/http/HttpSessionActivationListener.class
    277 Tue Dec 13 10:04:06 CST 2005 
javax/servlet/http/HttpSessionBindingListener.class

JAR: org.apache.geronimo.specs/jars/geronimo-servlet_2.4_spec-1.0.jar
    872 Tue Dec 13 10:04:06 CST 2005 javax/servlet/http/HttpSession.class
    288 Tue Dec 13 10:04:06 CST 2005 javax/servlet/http/HttpSessionContext.class
    264 Tue Dec 13 10:04:06 CST 2005 javax/servlet/http/HttpSessionListener.class
    626 Tue Dec 13 10:04:06 CST 2005 javax/servlet/http/HttpSessionEvent.class
    317 Tue Dec 13 10:04:06 CST 2005 
javax/servlet/http/HttpSessionAttributeListener.class
   1109 Tue Dec 13 10:04:06 CST 2005 
javax/servlet/http/HttpSessionBindingEvent.class
    292 Tue Dec 13 10:04:06 CST 2005 
javax/servlet/http/HttpSessionActivationListener.class
    277 Tue Dec 13 10:04:06 CST 2005 
javax/servlet/http/HttpSessionBindingListener.class
-


Jason Dillon wrote:
> Dunno about that... need to defer to the classloading gurus for the 
> proper solution.  Might have something to do with class hiding or 
> something... but really not sure.
> 
> --jason
> 
> 
> On Jul 21, 2006, at 9:37 AM, Russell E Glaue wrote:
> 
>> 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>
>> -
>>
>>
> 


Mime
View raw message