• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SWRLRuleEninge does not work in a servlet with tomcat7

 
Nada Bajnaid
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I manipulated ontology in a web application using eclipse and tomcat7. When I create OWLModel everything works fine but when I use bridge to create inferred model through jess I got the following error

NoClassDefFoundError: edu/stanford/smi/protege/model/KnowledgeBase

I use the following code that works in a simple java program but not with tomcat7

FileInputStream file = new FileInputStream ("C:/Program Files/Protege_3.4.6/examples/SQOntology/SQOntologyNewView.owl");
Reader in = new InputStreamReader (file);
OWLModel owlModel = ProtegeOWL.createJenaOWLModelFromReader(in);
System.out.println ("I'm here");

SWRLRuleEngine ruleEngine = SWRLRuleEngineFactory.create(owlModel);

Collection clses = owlModel.getUserDefinedOWLNamedClasses();
model = new JenaCreator(owlModel, false, true, clses, null).createOntModel();


I use protege_3.4.6 and I placed the following jars to the project build path
protege.jar
unicode_panel.jar
looks.jar
jess.jar
ProtegeOWL (a library containing all jars from protegex.owl plugin)
Jena/lib jars

I also copied all jars from jena/lib and protegex.owl plugin into the lib directory of my web application

still not working
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The build path is irrelevant. Whatever you need at runtime must be in WEB-INF/lib.
 
Nada Bajnaid
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does that mean that I need to move all jars to the lib direcory of my application? What about the OWL Model the code works fine with it but not with the SWRL Rule Engine? Would you please clarify what exactly I need to place in the lib directory

thanks
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. What have you tried?
 
Nada Bajnaid
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot it works eventhough it is a bit slow
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic