users@glassfish.java.net

configure life cycle module

From: <forums_at_java.net>
Date: Sun, 22 May 2011 12:24:30 -0500 (CDT)

hi all :)

 i need to creat a lifecycle module this is the code of the class

package config; import com.sun.appserv.server.ServerLifecycleException;
import com.sun.appserv.server.LifecycleEvent; import
com.sun.appserv.server.LifecycleListener; public class ServerLifeCycle
implements LifecycleListener { @Override public void
handleEvent(LifecycleEvent event) throws ServerLifecycleException { if
(LifecycleEvent.INIT_EVENT == event.getEventType()) {
System.out.println("-----------------LifecycleListener: INIT_EVENT"); return;
} if (LifecycleEvent.STARTUP_EVENT == event.getEventType()) {
System.out.println("-------------------LifecycleListener: START_EVENT");
return; } if (LifecycleEvent.READY_EVENT == event.getEventType()) {
System.out.println("------------------LifecycleListener: READY_EVENT");
return; } if (LifecycleEvent.SHUTDOWN_EVENT == event.getEventType()) {
System.out.println("---------------------LifecycleListener: SHUTDOWN_EVENT");
return; } if (LifecycleEvent.TERMINATION_EVENT == event.getEventType()) {
System.out.println("--------------LifecycleListener: TERMINATION_EVENT");
return; } }
 

i tried to creat the lifecycle module from the visual interface of glassfish
but ever time glassfish wouldn't start up and give me this exception

ATTENTION: Exception while starting bundle com.sun.enterprise.osgi-adapter
[14] org.osgi.framework.BundleException: Activator start error in bundle
com.sun.enterprise.osgi-adapter [14]. at
org.apache.felix.framework.Felix.activateBundle(Felix.java:1751) at
org.apache.felix.framework.Felix.startBundle(Felix.java:1622) at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:915) at
org.jvnet.hk2.osgimain.Main.start(Main.java:140) at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:640)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1700) at
org.apache.felix.framework.Felix.startBundle(Felix.java:1622) at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1077) at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264) at
java.lang.Thread.run(Thread.java:619) Caused by:
java.lang.NoClassDefFoundError: ServerLifeCycle (wrong name:
config/ServerLifeCycle) at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at
java.lang.ClassLoader.defineClass(ClassLoader.java:616) at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at
java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at
java.net.URLClassLoader.access$000(URLClassLoader.java:58) at
java.net.URLClassLoader$1.run(URLClassLoader.java:197) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:190) at
java.lang.ClassLoader.loadClass(ClassLoader.java:307) at
java.lang.ClassLoader.loadClass(ClassLoader.java:296) at
java.lang.ClassLoader.loadClass(ClassLoader.java:248) at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:247) at
com.sun.enterprise.v3.server.ServerLifecycleModule.loadServerLifecycle(ServerLifecycleModule.java:157)
at
com.sun.enterprise.v3.server.LifecycleModuleService.onInitialization(LifecycleModuleService.java:173)
at
com.sun.enterprise.v3.server.LifecycleModuleService.postConstruct(LifecycleModuleService.java:90)
at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:174)
at com.sun.hk2.component.ConstructorWomb$1.run(ConstructorWomb.java:87) at
java.security.AccessController.doPrivileged(Native Method) at
com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:84) at
com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:77) at
com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:58) at
com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:107) at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:60)
at
com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:236)
at
com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:128)
at com.sun.enterprise.module.bootstrap.Main.launch(Main.java:457) at
com.sun.enterprise.module.bootstrap.Main.launch(Main.java:401) at
org.jvnet.hk2.osgiadapter.HK2Main.start(HK2Main.java:125) at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:640)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1700)
my questions are : where should i put my class ?  what is the format of the
classpath?? and how to configure glassfish to accept it??

i work with netbeans 6.9.1 and glassfish 3.01 

i work on windows7

 


--
[Message sent by forum member 'fithwith']
View Post: http://forums.java.net/node/805028