Ummmm.... I?m a bit confused: are the Predicate classes registered to your ontology? NOTE that if you have
class A {
private B b;
...
public B getB() {
return b;
}
public void setB(B b) {
this.b = b;
}
...
}
and in your ontology you register A as
add(A.class)
B is automatically registered too.
Bye,
Giovanni
Da: henriquelopescardoso at gmail.com [mailto:henriquelopescardoso at gmail.com] Per conto di Henrique Lopes Cardoso
Inviato: venerd? 16 maggio 2014 10:37
A: Caire Giovanni
Cc: jade-develop at avalon.tilab.com
Oggetto: Re: [jade-develop] jade.content.onto.OntologyException: Non term object in aggregate
Thank you for the explanation. So, there seems to be no "magic" going on after all...
Is there a reason for it not to work when packing my classes in a jar file?
Henrique
On Thu, May 15, 2014 at 11:16 PM, Caire Giovanni <giovanni.caire at telecomitalia.it<mailto:giovanni.caire at telecomitalia.it>> wrote:
Hi,
The SerializableOntology is used unless the normal ontology is able to manage an object -->
If the class of a Predicate object that you insert in the jade.util.leap.List is registered in the Ontology, the ontology manages it and, since it is a Predicate (that cannot be used in an aggregate) --> it fails.
If on the other hand such class is not registered in the ontology --> the ontology does not manage it --> The SerializableOntology manages it and things will work.
Bye,
Giovanni
Da: henriquelopescardoso at gmail.com<mailto:henriquelopescardoso at gmail.com> [mailto:henriquelopescardoso at gmail<mailto:henriquelopescardoso at gmail>.com] Per conto di Henrique Lopes Cardoso
Inviato: gioved? 15 maggio 2014 17:14
A: Caire Giovanni
Cc: jade-develop at avalon.tilab.com<mailto:jade-develop at avalon.tilab.com>
Oggetto: Re: [jade-develop] jade.content.onto.OntologyException: Non term object in aggregate
Hi again,
I understand from your comments that even with the SerializableOntology I should still be getting the "No term object in aggregate" exception.
On Thu, May 15, 2014 at 3:34 PM, Caire Giovanni <giovanni.caire at telecomitalia.it<mailto:giovanni.caire at telecomitalia.it>> wrote:
Can you also details more the environment you are using when things ?magically? works? I mean: are you working inside an IDE such as Eclipse?
Yes, I am using Eclipse Juno, with JDK 1.7.
If so can you tell me the IDE and how the relevant classes are spread across projects?
I am using a single java project, and add to the java build path jade.jar, commons-codec-1.3.jar, among other jar files.
Another question: are the Predicate classes (I mean the classes of the objects that you include in the jade.util.leap.List) explicitly registered to the BeanOntology as
add(Pred1.class);
add(Pred2.class);
or through their package as
add("com.acme.rocket.ontology");
?
I am using the package version of add, using add(this.getClass().getPackage().getName());
My BeanOntology is in the same package as the predicates I want to use.
In any case, I've just tried using the add(Pred1.class) version and the results are the same.
Thanks.
Henrique
Bye,
Giovanni
Da: henriquelopescardoso at gmail.com<mailto:henriquelopescardoso at gmail.com> [mailto:henriquelopescardoso at gmail.com<mailto:henriquelopescardoso at gmail.com>] Per conto di Henrique Lopes Cardoso
Inviato: marted? 13 maggio 2014 18:53
A: Caire Giovanni
Cc: jade-develop
Oggetto: Re: [jade-develop] jade.content.onto.OntologyException: Non term object in aggregate
I have an update on this.
Apparently it does not have anything to do with the underlying platform (Windows/Ubunto). This was a misinterpretation of what was happening. Sorry for that.
What I did find out is that my project works fine if I use my classes as such.
The problem arises when I export my classes to a jar file and then try to use the jar in another Java project. That is when the "No term object in aggregate" exception is thrown (as explained before).
Any hints?
Henrique
On Tue, May 13, 2014 at 8:52 AM, Henrique Lopes Cardoso <hlc at fe.up.pt<mailto:hlc at fe.up.pt>> wrote:
I wonder if you have any update on this.
Is the use of SerializableOntology making it work under Windows?
If so, why doesn't it work under Ubunto?
Thank you in advance.
Henrique
On Fri, May 2, 2014 at 11:02 AM, Henrique Lopes Cardoso <hlc at fe.up.pt<mailto:hlc at fe.up.pt>> wrote:
Hi,
Answers in-line below.
On Fri, May 2, 2014 at 9:00 AM, Caire Giovanni <giovanni.caire at telecomitalia.it<mailto:giovanni.caire at telecomitalia.it>> wrote:
Hi,
This is really surprising.
Some questions to further investigate:
- Are the code and the jade libraries exactly the same in the 2 cases (Ubuntu and Windows)?
Yes.
- Is your ontology extending the BeanOntology class or directly the base Ontology class?
Extending BeanOntology.
- Is the list a java.util.List or a jade.util.leap.List?
The list is a jade.util.leap.List.
- Is your ontology including the SerializableOntology among its base ontologies?
Yes, it is using SerializableOntology.SERIALIZABLE (because I also need to use a HashMap in another Concept). This is how the ontology constructor looks like:
MyOntology() {
super(ONTOLOGY_NAME, new Ontology[]{BasicOntology.getInstance(), SerializableOntology.getInstance()});
...
...
}
- Can you provide the piece of code that creates the content whose encoding fails in Ubuntu and works in Windows?
Here it is:
Z z = new Z(); // this is a Predicate
z.setX(x); // this is a jade.util.leap.HashMap (that's why I am using serializable)
z.setY(y); // this is a jade.util.leap.List of Predicates
try {
myAgent.getContentManager().fillContent(response, z);
} catch (CodecException | OntologyException e) {
e.printStackTrace();
}
Now, let me remind you that this works fine under Windows (apparently not as expected).
Thank you for any hints,
Henrique
Bye,
Giovanni
Da: jade-develop-bounces at avalon.tilab.com<mailto:jade-develop-bounces at avalon.tilab.com> [mailto:jade-develop-bounces at avalon.tilab.com<mailto:jade-develop-bounces at avalon.tilab.com>] Per conto di Henrique Lopes Cardoso
Inviato: marted? 29 aprile 2014 10:30
A: jade-develop
Oggetto: [jade-develop] jade.content.onto.OntologyException: Non term object in aggregate
Hi,
The simplest way to describe the problem I am facing is this post:
http://sharon.cselt.it/pipermail/jade-develop/2013q3/019293.html
Now, this seems to be exactly what I am misusing: placing Predicates inside a List.
The thing is that I have only came across this problem when running my system under Ubuntu Gnome.
When using Windows no exception is thrown, and predicates flow inside lists without any problem.
Is there an explanation for this?
Thank you.
Henrique
--
----- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEI/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
VoIP: (+351) 220413355<tel:%28%2B351%29%20220413355>
Phone: (+351) 225081400 ext.1315<tel:%28%2B351%29%20225081400%20ext.1315>
hlc at fe.up.pt<mailto:hlc at fe.up.pt> | www.fe.up.pt/~hlc<http://www.fe.up.pt/~hlc>
----- - - - - - - - - - - - -
Questo messaggio e i suoi allegati sono indirizzati esclusivamente alle persone indicate. La diffusione, copia o qualsiasi altra azione derivante dalla conoscenza di queste informazioni sono rigorosamente vietate. Qualora abbiate ricevuto questo documento per errore siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione, Grazie.
This e-mail and any attachments is confidential and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender by return e-mail, Thanks.
Rispetta l'ambiente. Non stampare questa mail se non ? necessario.
--
----- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEI/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
VoIP: (+351) 220413355<tel:%28%2B351%29%20220413355>
Phone: (+351) 225081400 ext.1315<tel:%28%2B351%29%20225081400%20ext.1315>
hlc at fe.up.pt<mailto:hlc at fe.up.pt> | www.fe.up.pt/~hlc<http://www.fe.up.pt/~hlc>
----- - - - - - - - - - - - -
--
----- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEI/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
VoIP: (+351) 220413355<tel:%28%2B351%29%20220413355>
Phone: (+351) 225081400 ext.1315<tel:%28%2B351%29%20225081400%20ext.1315>
hlc at fe.up.pt<mailto:hlc at fe.up.pt> | www.fe.up.pt/~hlc<http://www.fe.up.pt/~hlc>
----- - - - - - - - - - - - -
--
----- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEI/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
VoIP: (+351) 220413355<tel:%28%2B351%29%20220413355>
Phone: (+351) 225081400 ext.1315<tel:%28%2B351%29%20225081400%20ext.1315>
hlc at fe.up.pt<mailto:hlc at fe.up.pt> | www.fe.up.pt/~hlc<http://www.fe.up.pt/~hlc>
----- - - - - - - - - - - - -
--
----- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEI/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
VoIP: (+351) 220413355<tel:%28%2B351%29%20220413355>
Phone: (+351) 225081400 ext.1315<tel:%28%2B351%29%20225081400%20ext.1315>
hlc at fe.up.pt<mailto:hlc at fe.up.pt> | www.fe.up.pt/~hlc<http://www.fe.up.pt/~hlc>
----- - - - - - - - - - - - -
--
----- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEI/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
VoIP: (+351) 220413355
Phone: (+351) 225081400 ext.1315
hlc at fe.up.pt<mailto:hlc at fe.up.pt> | www.fe.up.pt/~hlc<http://www.fe.up.pt/~hlc>
----- - - - - - - - - - - - -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://avalon.cselt.it/pipermail/jade-develop/attachments/20140516/fdc123ac/attachment-0001.html>