java.lang.ClassNotFoundException: demo.Valve1 not found by org.glassfish.web.glue [248]

Oracle Community | gernot1-JavaNet | 6 years ago
  1. 0

    See http://forums.java.net/jive/thread.jspa?messageID=391204: I have a problem trying to configure a custom valve on glassfish v3. I've coded the class (attached) and generated the jar file (attached). I put the jar file inside the lib directory (where I put for example jdbc drivers). That's /cc/glassfishv3/glassfish/lib. I've configured the 'server' virtual server to use the valve. I've done it through the admin console but here's the resulting domain.xml (fragment): <config name="server-config"> <http-service> <access-log /> <virtual-server id="server" network-listeners="http-listener-2,http-listener-1"> <property name="valve_1" value="net.sargue.glassfish.valve.StdOutAccessLogValve" /> </virtual-server> <virtual-server id="__asadmin" network-listeners="admin-listener" /> </http-service> So everything seems fine but upon starting the server this is what I get on the logs. [#|2010-03-11T12:25:25.027+0100|INFO|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=11;_ThreadName=Thread-1;|Created HTTP listener http-listener-2 on port 8181|#] [#|2010-03-11T12:25:25.036+0100|INFO|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=11;_ThreadName=Thread-1;|Created HTTP listener admin-listener on port 4848|#] [#|2010-03-11T12:25:25.062+0100|SEVERE|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=11;_ThreadName=FelixStartLevel;|WEB0148: Unable to load extension class [{0}] from web module [{1}] java.lang.ClassNotFoundException: net.sargue.glassfish.valve.StdOutAccessLogValve at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:744) at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:61) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1656) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at com.sun.enterprise.web.VirtualServer.loadInstance(VirtualServer.java:1063) at com.sun.enterprise.web.VirtualServer.addValve(VirtualServer.java:1030) at com.sun.enterprise.web.VirtualServer.configureCatalinaProperties(VirtualServer.java:904) at com.sun.enterprise.web.WebContainer.configureHost(WebContainer.java:1246) at com.sun.enterprise.web.WebContainer.createHost(WebContainer.java:1177) at com.sun.enterprise.web.WebContainer.createHosts(WebContainer.java:1116) at com.sun.enterprise.web.WebContainer.postConstruct(WebContainer.java:558) 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 org.glassfish.internal.data.EngineInfo.getContainer(EngineInfo.java:78) at com.sun.enterprise.v3.services.impl.WebContainerStarter.startWebContainer(WebContainerStarter.java:202) at com.sun.enterprise.v3.services.impl.WebContainerStarter.postConstruct(WebContainerStarter.java:144) 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) 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) |#] [#|2010-03-11T12:25:25.062+0100|SEVERE|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=11;_ThreadName=Thread-1;|WEB0148: Unable to load extension class [{0}] from web module [{1}] java.lang.ClassNotFoundException: net.sargue.glassfish.valve.StdOutAccessLogValve at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:744) at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:61) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1656) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at com.sun.enterprise.web.VirtualServer.loadInstance(VirtualServer.java:1063) at com.sun.enterprise.web.VirtualServer.addValve(VirtualServer.java:1030) at com.sun.enterprise.web.VirtualServer.configureCatalinaProperties(VirtualServer.java:904) at com.sun.enterprise.web.WebContainer.configureHost(WebContainer.java:1246) at com.sun.enterprise.web.WebContainer.createHost(WebContainer.java:1177) at com.sun.enterprise.web.WebContainer.createHosts(WebContainer.java:1116) at com.sun.enterprise.web.WebContainer.postConstruct(WebContainer.java:558) 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 org.glassfish.internal.data.EngineInfo.getContainer(EngineInfo.java:78) at com.sun.enterprise.v3.services.impl.WebContainerStarter.startWebContainer(WebContainerStarter.java:202) at com.sun.enterprise.v3.services.impl.WebContainerStarter.postConstruct(WebContainerStarter.java:144) 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) 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) |#] [#|2010-03-11T12:25:25.064+0100|WARNING|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=11;_ThreadName=FelixStartLevel;|WEB0158: Object of type classname [net.sargue.glassfish.valve.StdOutAccessLogValve] not an instance of Valve or GlassFishValve|#] [#|2010-03-11T12:25:25.064+0100|WARNING|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=11;_ThreadName=Thread-1;|WEB0158: Object of type classname [net.sargue.glassfish.valve.StdOutAccessLogValve] not an instance of Valve or GlassFishValve|#] [#|2010-03-11T12:25:25.142+0100|INFO|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=11;_ThreadName=Thread-1;|Created virtual server server|#] |#] [#|2010-03-11T12:25:25.144+0100|INFO|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=11;_ThreadName=FelixStartLevel;|Created virtual server __asadmin|#] Strange mix of messages! Not found but also not the correct type. Perhaps the second is a follow-up from the first one.

    Java.net JIRA | 7 years ago | jluehe
    java.lang.ClassNotFoundException: demo.Valve1 not found by org.glassfish.web.glue [248]
  2. 0

    Valve not found - where to put Valves?

    Oracle Community | 6 years ago | gernot1-JavaNet
    java.lang.ClassNotFoundException: demo.Valve1 not found by org.glassfish.web.glue [248]
  3. 0

    ERROR in Shutdown of Tomcat 6.0.32 (Tomcat forum at Coderanch)

    coderanch.com | 5 months ago
    java.lang.NoClassDefFoundError: org/apache/log4j/spi/ThrowableInformation
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [openengsb] CIT workflow report - SUCCESS

    Google Groups | 6 years ago | openengsb admin
    java.lang.NoClassDefFoundError: org/apache/activemq/util/IOExceptionSupport
  6. 0

    [jira] Resolved: (KARAF-312) Refresh of bundles does not always work after new feature install

    karaf-issues | 6 years ago | Achim Nierbeck (JIRA)
    java.lang.NoClassDefFoundError: org/osgi/service/event/EventAdmin

  1. poroszd 1 times, last 1 month ago
3 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    demo.Valve1 not found by org.glassfish.web.glue [248]

    at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation()
  2. Apache Felix Framework
    ModuleImpl$ModuleClassLoader.loadClass
    1. org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787)
    2. org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
    3. org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
    3 frames
  3. Java RT
    ClassLoader.loadClass
    1. java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    1 frame