Votre question

Java lang NoClassDefFoundError Exception in thread main

Tags :
  • Thread
  • Programmation
Dernière réponse : dans Programmation
13 Mars 2011 11:54:45

Bonjour,
j'ai essai de tester deux programmes l'un pour parcourir un fichier xml et l'autre pour parcourir un fichier txt ....
Lors de l'exécution une erreur se produit :
java.lang.NoClassDefFoundError: ParcourirFichier
Exception in thread "main"


Qelqu'un a-t-il une solution,
merci d'avance
marie

Autres pages sur : java lang noclassdeffounderror exception thread main

a c 232 L Programmation
13 Mars 2011 18:05:07

Salut,

Sans avoir ton code c'est difficile. Mais ça veut dire que la classe ParcourirFichier n'a pas été trouvée.
m
0
l
13 Mars 2011 18:35:06

Quelle est la commande que tu tapes pour lancer ton appli ?
m
0
l
Contenus similaires
20 Mars 2011 18:45:26

je travail avec Eclipse. j'exécute directement avec Eclipse sans utilisé des commandes dans le terminale.
m
0
l
23 Mars 2011 19:44:59

salut,
j'ai essayé de tester un programme qui permet de charger une ontologie (c à d charger un fichier owl).
Mais une exception se produit lors de l'exécution :

test1
test2
Exception in thread "main" java.lang.NoClassDefFoundError: edu/stanford/smi/protege/model/ClientInitializerKnowledgeBaseFactory
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at edu.stanford.smi.protegex.owl.ProtegeOWL.createJenaOWLModel(Unknown Source)
at edu.stanford.smi.protegex.owl.ProtegeOWL.createJenaOWLModelFromInputStream(Unknown Source)
at TestOWlLoad.main(TestOWlLoad.java:22)



Voici le code :
  1. import java.io.FileInputStream;
  2. import edu.stanford.smi.protege.model.Cls;
  3. import edu.stanford.smi.protegex.owl.ProtegeOWL;
  4. import edu.stanford.smi.protegex.owl.jena.JenaOWLModel;
  5. public class TestOWlLoad {
  6.  
  7. /**
  8. * @param args the command line arguments
  9. */
  10. public static void main(String[] args) {
  11.  
  12. System.out.println("test1");
  13. JenaOWLModel owlModel = null;
  14. FileInputStream is;
  15.  
  16. try {
  17. is = new FileInputStream("E:/projet_protege/aller_a_hotel2.owl");
  18. System.out.println("test2");
  19. // Load the owl file using an InputStream, but you can use also URIs.
  20. owlModel = ProtegeOWL.createJenaOWLModelFromInputStream(is);
  21. System.out.println("test3");[/b]
  22. [b] }
  23. catch (Exception e) {
  24. e.printStackTrace();
  25. }
  26. }
  27. //Cls myCls = knowledge.getCls("NameOfTheClass");
  28.  
  29. }
m
0
l
a c 232 L Programmation
23 Mars 2011 21:51:36

Salut,

Fais voir le contenu de ton fichier owl
Il doit générer la création d'une classe qui n'existe pas.
m
0
l
24 Mars 2011 22:32:19

Bonjour,
Voici le contenu de fichier owl :

  1. <?xml version="1.0"?>
  2. <rdf:RDF
  3. xmlns:service="http://www.daml.org/services/owl-s/1.2/Service.owl#"
  4. xmlns:process="http://www.daml.org/services/owl-s/1.2/Process.owl#"
  5. xmlns="http://www.owl-ontologies.com/Ontology1297614324.owl#"
  6. xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
  7. xmlns:list="http://www.daml.org/services/owl-s/1.2/generic/ObjectList.owl#"
  8. xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  9. xmlns:expr="http://www.daml.org/services/owl-s/1.2/generic/Expression.owl#"
  10. xmlns:owl="http://www.w3.org/2002/07/owl#"
  11. xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
  12. xmlns:swrl="http://www.w3.org/2003/11/swrl#"
  13. xmlns:grounding="http://www.daml.org/services/owl-s/1.2/Grounding.owl#"
  14. xmlns:profile="http://www.daml.org/services/owl-s/1.2/Profile.owl#"
  15. xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  16. xmlns:time="http://www.isi.edu/~pan/damltime/time-entry.owl#"
  17. xml:base="http://www.owl-ontologies.com/Ontology1297614324.owl">
  18. <owl:Ontology rdf:about="">
  19. <owl:imports rdf:resource="http://www.daml.org/services/owl-s/1.2/Profile.owl"/>
  20. <owl:imports rdf:resource="http://www.daml.org/services/owl-s/1.2/Service.owl"/>
  21. <owl:imports rdf:resource="http://www.daml.org/services/owl-s/1.2/Grounding.owl"/>
  22. <owl:imports rdf:resource="http://www.w3.org/2003/11/swrlb"/>
  23. <owl:imports rdf:resource="http://www.w3.org/2003/11/swrl"/>
  24. </owl:Ontology>
  25. <owl:Class rdf:ID="ListHotel"/>
  26. <owl:Class rdf:ID="Nom"/>
  27. <owl:Class rdf:ID="Hotel"/>
  28. <owl:Class rdf:ID="Adress"/>
  29. <process:Perform rdf:ID="PerformChoisirHotel">
  30. <process:process>
  31. <process:AtomicProcess rdf:ID="ChoisirHotel">
  32. <process:hasOutput>
  33. <process:Output rdf:ID="HôtelDésiré">
  34. <process:parameterType rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI"
  35. >http://www.owl-ontologies.com/Ontology1297614324.owl#Hotel</process:parameterType>
  36. </process:Output>
  37. </process:hasOutput>
  38. <process:hasInput>
  39. <process:Input rdf:ID="ListHôteles">
  40. <process:parameterType rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI"
  41. >http://www.owl-ontologies.com/Ontology1297614324.owl#ListHotel</process:parameterType>
  42. </process:Input>
  43. </process:hasInput>
  44. <process:hasInput>
  45. <process:Input rdf:ID="Prix">
  46. <process:parameterType rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI"
  47. >http://www.w3.org/2001/XMLSchema#float</process:parameterType>
  48. </process:Input>
  49. </process:hasInput>
  50. </process:AtomicProcess>
  51. </process:process>
  52. </process:Perform>
  53. <process:CompositeProcess rdf:ID="AllerHotel">
  54. <process:composedOf>
  55. <process:Sequence rdf:ID="Sequence_17">
  56. <process:components>
  57. <process:ControlConstructList rdf:ID="ControlConstructList_19">
  58. <list:rest>
  59. <process:ControlConstructList rdf:ID="ControlConstructList_23">
  60. <list:first>
  61. <process:Perform rdf:ID="PerformChoisirPeriode">
  62. <process:process>
  63. <process:AtomicProcess rdf:ID="ChoisirPeriode">
  64. <process:hasInput>
  65. <process:Input rdf:ID="DateArrive">
  66. <process:parameterType rdf:datatype=
  67. "http://www.w3.org/2001/XMLSchema#anyURI"
  68. >http://www.w3.org/2001/XMLSchema#date</process:parameterType>
  69. </process:Input>
  70. </process:hasInput>
  71. <process:hasInput>
  72. <process:Input rdf:ID="DateDepart">
  73. <process:parameterType rdf:datatype=
  74. "http://www.w3.org/2001/XMLSchema#anyURI"
  75. >http://www.w3.org/2001/XMLSchema#date</process:parameterType>
  76. </process:Input>
  77. </process:hasInput>
  78. <process:hasOutput>
  79. <process:Output rdf:ID="Confirmation">
  80. <process:parameterType rdf:datatype=
  81. "http://www.w3.org/2001/XMLSchema#anyURI"
  82. >http://www.w3.org/2001/XMLSchema#boolean</process:parameterType>
  83. </process:Output>
  84. </process:hasOutput>
  85. </process:AtomicProcess>
  86. </process:process>
  87. </process:Perform>
  88. </list:first>
  89. <list:rest>
  90. <process:ControlConstructList rdf:ID="ControlConstructList_25">
  91. <list:rest rdf:resource="http://www.daml.org/services/owl-s/1.2/generic/ObjectList.owl#nil"/>
  92. <list:first>
  93. <process:Perform rdf:ID="PerformReserverHotel">
  94. <process:hasDataFrom>
  95. <process:InputBinding rdf:ID="InputBinding_1">
  96. <process:toParam>
  97. <process:Input rdf:ID="Confirmation1">
  98. <process:parameterType rdf:datatype=
  99. "http://www.w3.org/2001/XMLSchema#anyURI"
  100. >http://www.w3.org/2001/XMLSchema#boolean</process:parameterType>
  101. </process:Input>
  102. </process:toParam>
  103. <process:valueSource>
  104. <process:ValueOf rdf:ID="ValueOf_2">
  105. <process:theVar rdf:resource="#Confirmation"/>
  106. <process:fromProcess rdf:resource="#PerformChoisirPeriode"/>
  107. </process:ValueOf>
  108. </process:valueSource>
  109. </process:InputBinding>
  110. </process:hasDataFrom>
  111. <process:hasDataFrom>
  112. <process:InputBinding rdf:ID="InputBinding_3">
  113. <process:toParam>
  114. <process:Input rdf:ID="HôtelDésirée">
  115. <process:parameterType rdf:datatype=
  116. "http://www.w3.org/2001/XMLSchema#anyURI"
  117. >http://www.owl-ontologies.com/Ontology1297614324.owl#Hotel</process:parameterType>
  118. </process:Input>
  119. </process:toParam>
  120. <process:valueSource>
  121. <process:ValueOf rdf:ID="ValueOf_4">
  122. <process:fromProcess rdf:resource="#PerformChoisirHotel"/>
  123. </process:ValueOf>
  124. </process:valueSource>
  125. </process:InputBinding>
  126. </process:hasDataFrom>
  127. <process:process>
  128. <process:AtomicProcess rdf:ID="ReserverHotel">
  129. <process:hasInput rdf:resource="#Confirmation1"/>
  130. <process:hasInput>
  131. <process:Input rdf:ID="CINPerson">
  132. <process:parameterType rdf:datatype=
  133. "http://www.w3.org/2001/XMLSchema#anyURI"
  134. >http://www.w3.org/2001/XMLSchema#int</process:parameterType>
  135. </process:Input>
  136. </process:hasInput>
  137. <process:hasInput rdf:resource="#HôtelDésirée"/>
  138. <process:hasInput>
  139. <process:Input rdf:ID="PrenomPerson">
  140. <process:parameterType rdf:datatype=
  141. "http://www.w3.org/2001/XMLSchema#anyURI"
  142. >http://www.owl-ontologies.com/Ontology1297614324.owl#Nom</process:parameterType>
  143. </process:Input>
  144. </process:hasInput>
  145. <process:hasInput>
  146. <process:Input rdf:ID="NomPerson">
  147. <process:parameterType rdf:datatype=
  148. "http://www.w3.org/2001/XMLSchema#anyURI"
  149. >http://www.owl-ontologies.com/Ontology1297614324.owl#Nom</process:parameterType>
  150. </process:Input>
  151. </process:hasInput>
  152. <process:hasInput>
  153. <process:Input rdf:ID="AdressePerson">
  154. <process:parameterType rdf:datatype=
  155. "http://www.w3.org/2001/XMLSchema#anyURI"
  156. >http://www.owl-ontologies.com/Ontology1297614324.owl#Adress</process:parameterType>
  157. </process:Input>
  158. </process:hasInput>
  159. <process:hasOutput>
  160. <process:Output rdf:ID="ReservationValide">
  161. <process:parameterType rdf:datatype=
  162. "http://www.w3.org/2001/XMLSchema#anyURI"
  163. >http://www.w3.org/2001/XMLSchema#boolean</process:parameterType>
  164. </process:Output>
  165. </process:hasOutput>
  166. </process:AtomicProcess>
  167. </process:process>
  168. </process:Perform>
  169. </list:first>
  170. </process:ControlConstructList>
  171. </list:rest>
  172. </process:ControlConstructList>
  173. </list:rest>
  174. <list:first rdf:resource="#PerformChoisirHotel"/>
  175. </process:ControlConstructList>
  176. </process:components>
  177. </process:Sequence>
  178. </process:composedOf>
  179. </process:CompositeProcess>
  180. <process:InputBinding rdf:ID="InputBinding_30"/>
  181. <process:InputBinding rdf:ID="InputBinding_31"/>
  182. </rdf:RDF>
  183.  
  184. <!-- Created with Protege (with OWL Plugin 3.2.1, Build 365) http://protege.stanford.edu -->


Et merci d'avance
m
0
l
a c 232 L Programmation
24 Mars 2011 23:15:10

Euh, je ne saurais pas quoi te répondre désolé :s
m
0
l
Tom's guide dans le monde
  • Allemagne
  • Italie
  • Irlande
  • Royaume Uni
  • Etats Unis
Suivre Tom's Guide
Inscrivez-vous à la Newsletter
  • ajouter à twitter
  • ajouter à facebook
  • ajouter un flux RSS