IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JSF Java Discussion :

Tomahawk erreur : java.lang.NoClassDefFoundError: org/apache/myfaces/custom/tree/MutableTreeNode


Sujet :

JSF Java

  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    44
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2009
    Messages : 44
    Par défaut Tomahawk erreur : java.lang.NoClassDefFoundError: org/apache/myfaces/custom/tree/MutableTreeNode
    Bonjour,
    J'ai voulu essayer l'exemple tree de tomahawak fourni dans le site de tomahawk mais le serveur tomcat 7 a rencontré des problèmes:
    java.lang.NoClassDefFoundError: org/apache/myfaces/custom/tree/MutableTreeNode
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getConstructor(Class.java:1657)
    at com.sun.faces.mgbean.BeanBuilder.loadBeanClass(BeanBuilder.java:428)
    at com.sun.faces.mgbean.BeanBuilder.bake(BeanBuilder.java:379)
    at com.sun.faces.mgbean.ManagedBeanBuilder.bake(ManagedBeanBuilder.java:86)
    at com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:349)
    at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:258)
    at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:191)
    at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:73)
    at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:67)
    at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:71)
    at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:71)
    at org.apache.el.parser.AstValue.getValue(AstValue.java:147)
    at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
    at com.sun.faces.facelets.el.ELText$ELTextVariable.toString(ELText.java:210)
    at com.sun.faces.facelets.el.ELText$ELTextComposite.toString(ELText.java:151)
    at com.sun.faces.facelets.compiler.CommentInstruction.write(CommentInstruction.java:75)
    at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:78)
    at com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:179)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1646)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:389)
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:127)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:117)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:309)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:140)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.ClassNotFoundException: org.apache.myfaces.custom.tree.MutableTreeNode
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
    ... 45 more
    La classe Tree1Backer:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
     
    package org.apache.myfaces.examples.tree1;
     
    import org.apache.myfaces.custom.tree.model.TreeModel;
    import org.apache.myfaces.custom.tree.model.DefaultTreeModel;
    import org.apache.myfaces.custom.tree.DefaultMutableTreeNode;
     
    public class Tree1Backer {
     
        private TreeModel treeModel;
     
        public TreeModel getTreeModel() {
            if (treeModel == null) {
                DefaultMutableTreeNode root = new DefaultMutableTreeNode("XY");
                DefaultMutableTreeNode a = new DefaultMutableTreeNode("A");
                root.insert(a);
                DefaultMutableTreeNode b = new DefaultMutableTreeNode("B");
                root.insert(b);
                DefaultMutableTreeNode c = new DefaultMutableTreeNode("C");
                root.insert(c);
     
                DefaultMutableTreeNode node = new DefaultMutableTreeNode("a1");
                a.insert(node);
                node = new DefaultMutableTreeNode("a2 ");
                a.insert(node);
                node = new DefaultMutableTreeNode("b ");
                b.insert(node);
     
                a = node;
                node = new DefaultMutableTreeNode("x1");
                a.insert(node);
                node = new DefaultMutableTreeNode("x2");
                a.insert(node);
                treeModel = new DefaultTreeModel(root);
            }
            return treeModel;
        }
     
        public void setTreeModel(TreeModel treeModel) {
            this.treeModel = treeModel;
        }
    }
    Fichier faces-config.xml:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
    <?xml version="1.0" encoding="utf-8"?>
    <faces-config xmlns="http://java.sun.com/xml/ns/javaee" 
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" 
                  version="2.0">
     
    <managed-bean>  
    <managed-bean-name>tree1Backer</managed-bean-name>  
    <managed-bean-class>org.apache.myfaces.examples.tree1</managed-bean-class>  
    <managed-bean-scope>request</managed-bean-scope>  
    </managed-bean>
    </faces-config>
    Fichier web.xml:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
     
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
      <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>
      <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
     </context-param>
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
      </welcome-file-list>
    </web-app>
    fichier tree.xhtml:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
     
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:t="http://myfaces.apache.org/tomahawk">
     
    <body>
     <ui:composition template="/META-INF/templates/template.xhtml">
      <ui:define name="body">
        <h:form id="treeform">
            <t:tree id="tree1" value="#{tree1Backer.treeModel}"
                styleClass="tree"
                nodeClass="treenode"
                selectedNodeClass="treenodeSelected"
                expandRoot="true"
                    forceid="true">
            </t:tree>
        </h:form>
      </ui:define>
     </ui:composition>
    </body>
    </html>
    Librairies utilisées:
    Tomahawk20-1.1.10
    JSF mojarra-2.1.2-FCS
    pouvez vous m'indiquer la source de cette erreur ??
    merci d'avance

  2. #2
    Membre expérimenté Avatar de Shinzul
    Homme Profil pro
    Lecteur assidu de code source
    Inscrit en
    Janvier 2008
    Messages
    174
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Lecteur assidu de code source
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2008
    Messages : 174
    Par défaut
    Euh comme ca, après je suis pas un expert en configuration de projet ^^

    Ton projet ne trouve pas la classe org.apache.myfaces.custom.tree.MutableTreeNode, ce qui me semble plutot logique vu que ton implementation de JSF est mojarra.

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    44
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2009
    Messages : 44
    Par défaut
    Citation Envoyé par Shinzul Voir le message
    Euh comme ca, après je suis pas un expert en configuration de projet ^^

    Ton projet ne trouve pas la classe org.apache.myfaces.custom.tree.MutableTreeNode, ce qui me semble plutot logique vu que ton implementation de JSF est mojarra.
    alors je dois utiliser quelle implémentation ?

  4. #4
    Membre expérimenté Avatar de Shinzul
    Homme Profil pro
    Lecteur assidu de code source
    Inscrit en
    Janvier 2008
    Messages
    174
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Lecteur assidu de code source
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2008
    Messages : 174
    Par défaut
    Myfaces

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    44
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2009
    Messages : 44
    Par défaut
    Citation Envoyé par Shinzul Voir le message
    Myfaces
    Effectivement y avait un problème de configuration des librairies.

    merci Shinzul

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 0
    Dernier message: 06/01/2014, 18h25
  2. Réponses: 6
    Dernier message: 25/01/2010, 01h58
  3. erreur : java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlObject
    Par djolof dans le forum Format d'échange (XML, JSON...)
    Réponses: 1
    Dernier message: 05/10/2009, 10h13
  4. Réponses: 4
    Dernier message: 21/02/2007, 12h13
  5. [DisplayTag] java.lang.NoClassDefFoundError: org/apache/commons/lang/UnhandledException
    Par MAJIK_ENIS dans le forum Taglibs
    Réponses: 18
    Dernier message: 06/04/2006, 10h18

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo