RepastS: org.apache.commons.collections15.Predicate needet for DefaultContext (non-GUI Tutorial)

View: New views
4 Messages — Rating Filter:   Alert me  

RepastS: org.apache.commons.collections15.Predicate needet for DefaultContext (non-GUI Tutorial)

by Stefan Vitz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,


I'm trying the Repast Simphony ¿non-GUI¿ Tutorial mentioned on this list before.
(http://portal.ncess.ac.uk/access/wiki/site/mass/simphony%20tutorial.html)

When implementing the PeopleContext as Extension of DefaultContext<Person>
eclipse warns me (at package-definition line):

org.apache.commons.collections15.Predicate cannot be resolved.
It is indirectly referenced from required .class files
This must be bevouse auf the extend DefaultContext...

Well. I googled and found out that org.apache.commons.collections15.Predicate
is for example part of collections-generic-4.01.jar
(http://www.findjar.com/jar/net.sourceforge.collections/jars/collections-generic-4.01.jar.html?all=true)
I downloaded this jar-file and addet it to my project under
Properties -> Libaries -> Add external JAR.


Well the warning is gone. but when loading the model to repast and start the simulation
i get the following error message:

Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation
problems: The type org.apache.commons.collections15.Predicate cannot be resolved. It is
indirectly referenced from required .class files Only a type can be imported.
org.apache.commons resolves to a package

   at socnets.PeopleContext.<init>(PeopleContext.java:1)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance ...
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance ...
   at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
   at java.lang.Class.newInstance0(Class.java:372)
   at java.lang.Class.newInstance(Class.java:325)


So.. what to do?

I need org.apache.commons.collections15.Predicate but where to get/add it?
I don't really feal comfortably with eclipse. So perhaps someone can give me a hint.



one minor second thing:
peopleGeography.move(p, new GeometryFactory().createPoint(
                    new Coordinate(i,i+1)));
tells me that GeometryFactory() and Coordinate() cannot be resolved for a type.
I first fiddeld around with generic types but endet in leaving everything as mentioned
within the tutorial. but it doesn't work for me either.


Thanks,

Stefan Vitz


--
   ,---\----/  
   \____\  /    Stefan Vitz Bielefeld    public GnuPG key:
_______/ \/ stefan@... Germany      http://w148.de/~svitz/pubkey.asc


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Repast-interest mailing list
Repast-interest@...
https://lists.sourceforge.net/lists/listinfo/repast-interest

signature.asc (196 bytes) Download Attachment

Re: RepastS: org.apache.commons.collections15.Predicate needet for DefaultContext (non-GUI Tutorial)

by Nick Malleson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Stefan,

I think you're problems are to do with importing the correct classes. For example, when you get errors about objects not being resolved to a type, Eclipse should give you a little red icon just to the left of the offending line. If you click on this it should give you a list of possible classes to import which should fix the problem.

If you import the wrong class you can get some strange behaviour, which I think is what has happened with the Predicate errors (all the classes required to run the tutorial are supplied with Repast, you don't need to download anything).

If you have a look at the final code for the tutorial you should be able to see which classes you need to import.

Hope that helps,
Nick M


Stefan Vitz wrote:
Hi,


I'm trying the Repast Simphony ¿non-GUI¿ Tutorial mentioned on this list before.
(http://portal.ncess.ac.uk/access/wiki/site/mass/simphony%20tutorial.html)

When implementing the PeopleContext as Extension of DefaultContext<Person>
eclipse warns me (at package-definition line):

org.apache.commons.collections15.Predicate cannot be resolved.
It is indirectly referenced from required .class files
This must be bevouse auf the extend DefaultContext...

Well. I googled and found out that org.apache.commons.collections15.Predicate
is for example part of collections-generic-4.01.jar
(http://www.findjar.com/jar/net.sourceforge.collections/jars/collections-generic-4.01.jar.html?all=true)
I downloaded this jar-file and addet it to my project under
Properties -> Libaries -> Add external JAR.


Well the warning is gone. but when loading the model to repast and start the simulation
i get the following error message:

Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation
problems: The type org.apache.commons.collections15.Predicate cannot be resolved. It is
indirectly referenced from required .class files Only a type can be imported.
org.apache.commons resolves to a package

   at socnets.PeopleContext.<init>(PeopleContext.java:1)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance ...
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance ...
   at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
   at java.lang.Class.newInstance0(Class.java:372)
   at java.lang.Class.newInstance(Class.java:325)


So.. what to do?

I need org.apache.commons.collections15.Predicate but where to get/add it?
I don't really feal comfortably with eclipse. So perhaps someone can give me a hint.



one minor second thing:
peopleGeography.move(p, new GeometryFactory().createPoint(
                    new Coordinate(i,i+1)));
tells me that GeometryFactory() and Coordinate() cannot be resolved for a type.
I first fiddeld around with generic types but endet in leaving everything as mentioned
within the tutorial. but it doesn't work for me either.


Thanks,

Stefan Vitz


--
   ,---\----/  
   \____\  /    Stefan Vitz Bielefeld    public GnuPG key:
_______/ \/ stefan@vitz.tv Germany      http://w148.de/~svitz/pubkey.asc

 
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Repast-interest mailing list
Repast-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/repast-interest

Re: RepastS: org.apache.commons.collections15.Predicate needet for DefaultContext (non-GUI Tutorial)

by Tatara, Eric R. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 I tried Nick Malleson's (very nice) tutorial using RepastS v.1.0 and was unable to re-create the problem.  The collections jar is already included with RepastS suggesting that something is wrong with the repast install on your machine.  If you expand the project and expand the "Referenced Libraries" item, you should see collections-generic-4.01.jar there along with many other libraries which are bundled with RepastS.  I suggest re-creating the project again or re-installing, but make sure to backup your project source code (not the project config data) somewhere else.

eric


Eric Tatara, Ph.D.
Assistant Software Engineer
Center for Complex Adaptive Agent Systems Simulation
Decision and Information Sciences Division
Argonne National Laboratory

-----Original Message-----
From: repast-interest-bounces@... [mailto:repast-interest-bounces@...] On Behalf Of Stefan Vitz
Sent: Friday, June 20, 2008 5:25 AM
To: repast-interest@...
Subject: [Repast-interest] RepastS: org.apache.commons.collections15.Predicate needet for DefaultContext (non-GUI Tutorial)

Hi,


I'm trying the Repast Simphony ¿non-GUI¿ Tutorial mentioned on this list before.
(http://portal.ncess.ac.uk/access/wiki/site/mass/simphony%20tutorial.html)

When implementing the PeopleContext as Extension of DefaultContext<Person> eclipse warns me (at package-definition line):

org.apache.commons.collections15.Predicate cannot be resolved.
It is indirectly referenced from required .class files This must be bevouse auf the extend DefaultContext...

Well. I googled and found out that org.apache.commons.collections15.Predicate
is for example part of collections-generic-4.01.jar
(http://www.findjar.com/jar/net.sourceforge.collections/jars/collections-generic-4.01.jar.html?all=true)
I downloaded this jar-file and addet it to my project under Properties -> Libaries -> Add external JAR.


Well the warning is gone. but when loading the model to repast and start the simulation
i get the following error message:

Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation
problems: The type org.apache.commons.collections15.Predicate cannot be resolved. It is
indirectly referenced from required .class files Only a type can be imported.
org.apache.commons resolves to a package

   at socnets.PeopleContext.<init>(PeopleContext.java:1)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance ...
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance ...
   at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
   at java.lang.Class.newInstance0(Class.java:372)
   at java.lang.Class.newInstance(Class.java:325)


So.. what to do?

I need org.apache.commons.collections15.Predicate but where to get/add it?
I don't really feal comfortably with eclipse. So perhaps someone can give me a hint.



one minor second thing:
peopleGeography.move(p, new GeometryFactory().createPoint(
                    new Coordinate(i,i+1)));
tells me that GeometryFactory() and Coordinate() cannot be resolved for a type.
I first fiddeld around with generic types but endet in leaving everything as mentioned
within the tutorial. but it doesn't work for me either.


Thanks,

Stefan Vitz


--
   ,---\----/  
   \____\  /    Stefan Vitz Bielefeld    public GnuPG key:
_______/ \/ stefan@... Germany      http://w148.de/~svitz/pubkey.asc

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Repast-interest mailing list
Repast-interest@...
https://lists.sourceforge.net/lists/listinfo/repast-interest

Re: RepastS: org.apache.commons.collections15.Predicate needet for DefaultContext (non-GUI Tutorial)

by Stefan Vitz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I allready replied to Nick Malleson
(and tried to do so to the list, but used a wrong email-adress)


I'm sure I import all necessary classes, and also tried the final code
Nick provides within his tutorial.
Though i have problems with collections-generic, jts-1.8 and javax.units
packages. I had to download those three and add them as jars to my build path
for the tutorial to work.
Though I can use any Package provides within the repast.symphony-tree.

Seems as I'm having a major problem with my buildpath.
I did everything as mentioned within the installation-tutorial at the repast website.
(using Ubuntu Linux 8.04 with Repast Symphony 1.0)


With those three additions to my buildpath the tutorial can be run..
But as soon as i add the display the application crashes with an NullPointer
I even used nicks provided java-files to ensure that i haven't made a typo or
some minor glitch that causes this.


Uncaught error fetching image:
java.lang.NullPointerException
        at sun.awt.image.URLImageSource.getConnection(URLImageSource.java:115)
        at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:125)
        at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:258)
        at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:189)
        at sun.awt.image.ImageFetcher.run(ImageFetcher.java:153)



don't really know why this is happening...
I heard before repast symphony should cause some problems when used under linux.
I allready recreated the project a bunch of times and tried the tutorial on
differend linux-machines.
As soon as i can get a hand upon a windows-machine i will try if the OS
will give a difference.


Thanks,

Stefan Vitz


--
   ,---\----/  
   \____\  /    Stefan Vitz Bielefeld    public GnuPG key:
_______/ \/ stefan@... Germany      http://w148.de/~svitz/pubkey.asc


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Repast-interest mailing list
Repast-interest@...
https://lists.sourceforge.net/lists/listinfo/repast-interest

signature.asc (196 bytes) Download Attachment
LightInTheBox - Buy quality products at wholesale price