• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SWRLRuleEninge does not work in a servlet with tomcat7

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. What have you tried?
 
Nada Bajnaid
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot it works eventhough it is a bit slow
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic