java.lang.NoClassDefFoundError toen ik <listener-class> aan web.xml java toevoegde

Alsjeblieft, ik vind de reden voor deze fout niet.

Ik heb een klasse LogoutListener.java gemaakt, dit implementeert HttpSessionListener, met zijn twee abstracte methoden: sessionCreated en sessionDestroyed. En ik heb de respectieve listener-tag toegevoegd aan web.xml:

... meer code


    Faces Servlet javax.faces.webapp.FacesServlet 1 


    Faces Servlet
    *.seam


<!-- Listeners used by application -->


     com.akson.encuesta.session.helper.LogoutListener



    Restrict raw XHTML Documents
    
        XHTML
        *.xhtml
    
    

... meer code

Wanneer ik de tag verwijder, treft de server geen fout, maar wanneer de tag zich in web.xml bevindt, is de serverfout (de volgende is onderdeel van het logboek):

    EjbSynchronizations/local - EJB3.x Default Local Business Interface
        EjbSynchronizations/local-org.jboss.seam.transaction.LocalEjbSynchroniza
tions - EJB3.x Local Business Interface

12:16:12,550 INFO  [SessionSpecContainer] Starting jboss.j2ee:jar=demoencuesta06
.war,name=TimerServiceDispatcher,service=EJB3
12:16:12,551 INFO  [EJBContainer] STARTED EJB: org.jboss.seam.async.TimerService
Dispatcher ejbName: TimerServiceDispatcher
12:16:12,557 INFO  [JndiSessionRegistrarBase] Binding the following Entries in G
lobal JNDI:

        TimerServiceDispatcher/local - EJB3.x Default Local Business Interface
        TimerServiceDispatcher/local-org.jboss.seam.async.LocalTimerServiceDispa
tcher - EJB3.x Local Business Interface

12:16:12,559 WARN  [TimerServiceContainer] EJBTHREE-2193: using deprecated Timer
ServiceFactory for restoring timers
12:16:12,763 INFO  [TomcatDeployment] deploy, ctxPath=/demoencuesta06
12:16:12,806 ERROR [[/demoencuesta06]] Error configurando escuchador de aplicaci
¾n de clase com.akson.encuesta.session.helper.LogoutListener: java.lang.ClassNot
FoundException: com.akson.encuesta.session.helper.LogoutListener
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202) [:1.6.0_33]
        at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_33
]
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190) [:1.6.0_33
]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306) [:1.6.0_33]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247) [:1.6.0_33]
        at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(Tom
catInjectionContainer.java:278) [:6.1.0.Final]
        at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(Tom
catInjectionContainer.java:264) [:6.1.0.Final]
        at org.apache.catalina.core.StandardContext.contextListenerStart(Standar
dContext.java:3319) [:6.1.0.Final]
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:3
828) [:6.1.0.Final]
        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy
Internal(TomcatDeployment.java:294) [:6.1.0.Final]
        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy
(TomcatDeployment.java:146) [:6.1.0.Final]
        at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeploy
ment.java:476) [:6.1.0.Final]
        at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118) [:6
.1.0.Final]
        at org.jboss.web.deployers.WebModule.start(WebModule.java:95) [:6.1.0.Fi
nal]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_3
3]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39) [:1.6.0_33]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25) [:1.6.0_33]
        at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_33]
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:157) [:6.0.0.GA]
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) [:6.0.0.G
A]
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) [:6.0.0.GA]

        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:271) [:6.0.0.GA]
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)
[:6.0.0.GA]
        at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java
:206) [:2.2.0.SP2]
        at $Proxy41.start(Unknown Source)       at org.jboss.system.microcontain
er.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:53) [:2.
2.0.SP2]
        at org.jboss.system.microcontainer.StartStopLifecycleAction.installActio
n(StartStopLifecycleAction.java:41) [:2.2.0.SP2]
        at org.jboss.dependency.plugins.action.SimpleControllerContextAction.sim
pleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.
2.0.SP2]
        at org.jboss.dependency.plugins.action.AccessControllerContextAction.ins
tall(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractControllerContextActions.install
(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra
ctControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.system.microcontainer.ServiceControllerContext.install(Serv
iceControllerContext.java:301) [:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.install(AbstractContr
oller.java:2044) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.incrementState(Abstra
ctController.java:1083) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.executeOrIncrementSta
teDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:1246) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:1139) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.change(AbstractContro
ller.java:939) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.change(AbstractContro
ller.java:654) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.system.ServiceController.doChange(ServiceController.java:67
1) [:6.1.0.Final (Build SVNTag:JBoss_6.1.0.Final date: 20110816)]
        at org.jboss.system.ServiceController.start(ServiceController.java:443)
[:6.1.0.Final (Build SVNTag:JBoss_6.1.0.Final date: 20110816)]
        at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java
:189) [:6.1.0.Final]
        at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.jav
a:102) [:6.1.0.Final]
        at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.jav
a:49) [:6.1.0.Final]
        at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.i
nternalDeploy(AbstractSimpleRealDeployer.java:63) [:2.2.2.GA]
        at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(
AbstractRealDeployer.java:55) [:2.2.2.GA]
        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(Deployer
Wrapper.java:179) [:2.2.2.GA]
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(Deployer
sImpl.java:1832) [:2.2.2.GA]
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFi
rst(DeployersImpl.java:1550) [:2.2.2.GA]
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFi
rst(DeployersImpl.java:1571) [:2.2.2.GA]
        at org.jboss.deployers.plugins.deployers.DeployersImpl.install(Deployers
Impl.java:1491) [:2.2.2.GA]
        at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra
ctControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.install(AbstractContr
oller.java:2044) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.incrementState(Abstra
ctController.java:1083) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.executeOrIncrementSta
teDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:1246) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:1139) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.change(AbstractContro
ller.java:939) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.change(AbstractContro
ller.java:654) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersI
mpl.java:1983) [:2.2.2.GA]
        at org.jboss.deployers.plugins.deployers.DeployersImpl.process(Deployers
Impl.java:1076) [:2.2.2.GA]
        at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeploye
rImpl.java:679) [:2.2.2.GA]
        at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.p
rocess(MainDeployerPlugin.java:106) [:6.1.0.Final]
        at org.jboss.profileservice.dependency.ProfileControllerContext$Delegate
Deployer.process(ProfileControllerContext.java:143) [:0.2.2]
        at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(Profil
eDeployAction.java:151) [:0.2.2]
        at org.jboss.profileservice.dependency.ProfileDeployAction.installAction
Internal(ProfileDeployAction.java:94) [:0.2.2]
        at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction
(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.SP2]
        at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction
(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.action.SimpleControllerContextAction.sim
pleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.
2.0.SP2]
        at org.jboss.dependency.plugins.action.AccessControllerContextAction.ins
tall(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractControllerContextActions.install
(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra
ctControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.install(AbstractContr
oller.java:2044) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.incrementState(Abstra
ctController.java:1083) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.executeOrIncrementSta
teDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:1246) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:1139) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.change(AbstractContro
ller.java:939) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.dependency.plugins.AbstractController.change(AbstractContro
ller.java:654) [jboss-dependency.jar:2.2.0.SP2]
        at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicPro
fileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]
        at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(Pr
ofileActivationWrapper.java:87) [:0.2.2]
        at org.jboss.profileservice.dependency.ProfileActivationService.activate
Profile(ProfileActivationService.java:215) [:0.2.2]
        at org.jboss.profileservice.dependency.ProfileActivationService.activate
(ProfileActivationService.java:159) [:0.2.2]
        at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.ac
tivate(AbstractProfileServiceBootstrap.java:112) [:0.2.2]
        at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolve
rFacade.deploy(BasicResolverFactory.java:87) [:0.2.2]
        at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.st
art(AbstractProfileServiceBootstrap.java:91) [:0.2.2]
        at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceB
ootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.1.0.Final]
        at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceB
ootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0.Final]
        at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(A
bstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
        at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.r
un(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
        at java.lang.Thread.run(Thread.java:662) [:1.6.0_33]

12:16:12,899 ERROR [[/demoencuesta06]] Se ha saltado la instalaci¾n de escuchado
res de aplicaci¾n debido a error(es) previo(s)
12:16:12,900 ERROR [StandardContext] Error listenerStart
12:16:12,900 ERROR [StandardContext] Fall¾ en arranque del Contexto [/demoencues
ta06] debido a errores previos
12:16:12,917 ERROR [AbstractKernelController] Error installing to Start: name=jb
oss.web.deployment:war=/demoencuesta06 state=Create mode=Manual requiredState=In
stalled: org.jboss.deployers.spi.DeploymentException: URL file:/D:/jboss-6.1.0.F
inal/server/default/deploy/demoencuesta06.war/ deployment failed
        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy
Internal(TomcatDeployment.java:325) [:6.1.0.Final]
        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy

Ik gebruik Eclipse Indigo, Jboss, Seam, RichFaces

dank je

1
ja ru de
Iedereen bedankt voor de antwoorden. Ik heb het probleem net opgelost. De bestanden .class werden gegenereerd in WEB-INF/dev, en toen jboss de implementatie deed, zocht het naar de .class in WEB/classes, maar in deze laatste map bevatte alleen de .class van het model meer. Ik heb build-dev.properties aangepast, actin.dir verwijderd ...
toegevoegd de auteur Sisi002, de bron

4 antwoord

Deze foutmelding verschijnt omdat u het klassenbestand voor com.akson.encuesta.session.helper.LogoutListener in uw klassenpad niet hebt. Controleer de .jar s in uw project voor dit bestand of voeg het toe als u het niet hebt.

Als dit je eigen klasse in je project is, probeer dan het project te hercompileren in Eclipse.

0
toegevoegd
Ik weet het niet. Het lijkt op uw eigen bestand, niet publiekelijk beschikbaar.
toegevoegd de auteur Sotirios Delimanolis, de bron
Bedankt voor het antwoord, wat .jars zou voor dit bestand zijn? , en ik heb het project opnieuw gecompileerd, ik heb een nieuwe .war en de fout gaat door ....
toegevoegd de auteur Sisi002, de bron

U moet de implementatiedirectory controleren waarin uw toepassing wordt geïmplementeerd. Controleer of uw klasse aanwezig is in WEB-INF/klassen of op zijn minst in een willekeurige pot in de map WEB-INF/lib. Als u de Eclipse WTP-plug-in gebruikt om uw toepassing te implementeren, moet u controleren of uw toepassingsbestanden correct worden geïmplementeerd. Soms wordt de runtime niet goed gesynchroniseerd met projectuitvoerbestanden.

0
toegevoegd
heeft deze bestanden gelijk?
toegevoegd de auteur Sisi002, de bron

Een ClassNotFoundException houdt in dat de volledig gekwalificeerde naam voor de gegeven klasse geen geldige referentie was (kort gezegd: de klasse werd niet gevonden door de classloader). Er zijn verschillende dingen die u moet controleren:

  • Is the class in your project?
  • Is the fully qualified name correct? (to be sure: right click > copy qualified name)
  • Are the proper jars referenced correctly?
  • Are there any errors in the build path?
  • If you provide the class inside a jar that is a library, is it properly added to the project?
  • If you package everything in an EAR, is this project (module) part of it? Did you check the deployment assembly to ensure the jars are loaded correctly? Are the shared libraries being correclty provided to each module inside the EAR?
0
toegevoegd
Bedankt Gamb, ik beantwoord de vraag, en mijn twijfel zit in de tweede, het pad wanneer ik het doe "klik met de rechtermuisknop> gekwalificeerde naam kopiëren" is/demoencuesta06/src/hot/com/akson/encuesta/session/helper/Lo & zwnj ; GoutListener.java en ik schreven in web.xml com.akson.encuesta.session.helper.LogoutListener
toegevoegd de auteur Sisi002, de bron

U moet ervoor zorgen dat com.akson.encuesta.session.helper.LogoutListener zich in het klassepad van uw toepassing bevindt.

0
toegevoegd
ja, de klas is op dat pad ...
toegevoegd de auteur Sisi002, de bron