Internal action was not loaded. Error: java.lang.ClassNotFoundException

I am trying to run an implementation of jason code that uses some internal actions. The interpreter shows that the internal action java code could not be found, as shown:

Server running on http://191.36.8.42:3272
[aslparser] [peleus.asl:29] warning: The internal action class for 'org.soton.peleus.act.plan(Goals)' was not loaded! Error:
java.lang.ClassNotFoundException: org.soton.peleus.act.plan
[aslparser] [peleus.asl:42] warning: The internal action class for 'org.soton.peleus.act.isTrue(H)' was not loaded! Error:
java.lang.ClassNotFoundException: org.soton.peleus.act.isTrue
[peleus] Could not finish intention: intention 1:  +des([on(b3,table),on(b2,b3),on(b1,b2)])[source(self)] <- ... org.soton.peleus.act.plan(Goals); !checkGoals(Goals); .print("Goals ",Goals," were satisfied") /
{Goals=[on(b3,table),on(b2,b3),on(b1,b2)]}Trigger: +des([on(b3,table),on(b2,b3),on(b1,b2)])[noenv,code(org.soton.peleus.act.plan([on(b3,table),on(b2,b3),on(b1,b2)])),code_line(29),code_src("peleus.asl"),error(action_failed),error_msg("no environment configured!"),source(self)]
[peleus] Adding belief clear(table)

This mas2j file is as follows:

MAS peleus {
    infrastructure: Centralised
    agents: 
        peleus;            
}

Part of the agent code (written by Felipe Meneguzzi) is shown below:

//The next line is line 28
+des(Goals) : true
     <- org.soton.peleus.act.plan(Goals);
         !checkGoals(Goals);
         .print("Goals ",Goals," were satisfied").

+!checkGoals([]) : true <- true.

//The next line is line 40
+!checkGoals([H|T]) : true
    <- .print("Checking ", H);
        org.soton.peleus.act.isTrue(H);
        !checkGoals(T).

I guess this is about the folder structure, how do I configure Jason to search java files in specific places?

The folder structure is as follows:

 Peleus\src\org\soton\peleus for java files
 Peleus\examples for mas2j and asl tested project
+4
source share
1 answer

It all depends on how you run the application.

  • If you are using java, CLASSPATH must be defined to include the missing classes.
  • jason script ( Ant), .mas2j .

FAQ. , CLASSPATH - , .class, .java. , .

+3

Source: https://habr.com/ru/post/1689469/


All Articles