Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] JavaCodeGenerator error

Timothy Redmond tredmond at stanford.edu
Fri Oct 3 07:11:37 PDT 2008


On Oct 3, 2008, at 4:10 AM, Coffin, Daniel (EXP) wrote:

> All,
>
> I'm trying to utilise the JavaCodeGenerator class and even after  
> adding all the protege and protegex packages and all required  
> libraries, I'm still getting errors with ClipsKnowledgeBaseFactory  
> in edu.stanford.smi.protege.storage.clips. Specifically the error is  
> 'unable to resolve type: Parser'.

I am not sure exactly how you are getting to this situation.  But I am  
guessing the short answer is that the Parser.java file in the protege  
core sources is a generated source file.  You can generate it with  
"ant javacc".  You will need to configure the local.properties file to  
run this command. Essentially (see local.properties.template) you will  
need to include a pointer to the javacc library.  I have never  
understood why javacc doesn't come with the protege-core sources - I  
should figure out if there is a licensing problem sometime.

The Parser class will exist in any properly formed protege.jar file:

[tredmond at BlackHole dist]$ jar -tf protege.jar | grep Parser
edu/stanford/smi/protege/storage/clips/Parser$1.class
edu/stanford/smi/protege/storage/clips/Parser$JJCalls.class
edu/stanford/smi/protege/storage/clips/Parser$LookaheadSuccess.class
edu/stanford/smi/protege/storage/clips/Parser.class
edu/stanford/smi/protege/storage/clips/ParserConstants.class
edu/stanford/smi/protege/storage/clips/ParserTokenManager.class
[tredmond at BlackHole dist]$

as will the ClipKnowledgeBaseFactory.  But if you are working from  
checked out Protege sources then you will need to build the Parser  
source files in order for the Protege core sources to compile.

-Timothy





[tredmond at BlackHole protege-core]$ ant javacc
Buildfile: build.xml

init:

prepare:
     [mkdir] Created dir: /Volumes/BlackHole/Users/tredmond/dev/ 
workspaces/protege3/protege-core/classes
     [mkdir] Created dir: /Volumes/BlackHole/Users/tredmond/dev/ 
workspaces/protege3/protege-core/classes.junit
     [mkdir] Created dir: /Volumes/BlackHole/Users/tredmond/dev/ 
workspaces/protege3/protege-core/dist
     [mkdir] Created dir: /Volumes/BlackHole/Users/tredmond/dev/ 
workspaces/protege3/protege-core/docs/apidocs

check-clips:

maybe-clean-clips:

clean-clips:

javacc:
    [javacc] Java Compiler Compiler Version 3.2 (Parser Generator)
    [javacc] (type "javacc" with no arguments for help)
    [javacc] Reading from file /Volumes/BlackHole/Users/tredmond/dev/ 
workspaces/protege3/protege-core/bin/Parser.jj . . .
    [javacc] Note: UNICODE_INPUT option is specified. Please make sure  
you create the parser/lexer usig a Reader with the correct character  
encoding.
    [javacc] File "TokenMgrError.java" does not exist.  Will create one.
    [javacc] File "ParseException.java" does not exist.  Will create  
one.
    [javacc] File "Token.java" does not exist.  Will create one.
    [javacc] File "SimpleCharStream.java" does not exist.  Will create  
one.
    [javacc] Parser generated successfully.

BUILD SUCCESSFUL
Total time: 3 seconds
[tredmond at BlackHole protege-core]$

>
> All the imports are satisfied.....
>
> Thanks,
>
> Daniel Coffin
> Systems Engineer
>
> Lockheed Martin UK – IS&GS
> Chester House, 3rd Floor
> Farnborough Aerospace Centre
> Farnborough
> Hampshire
> GU14 6TQ
>
> Mob: 07824 992775
> Tel: 01252 553260
> P  Please don't print this e-mail unless you really need to
>
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20081003/a44b0f18/attachment.html>


More information about the protege-owl mailing list