Special Notes for the 2015-2016 platform -- Download and Installation
- iCASA teaching distribution:
- For Java versions 8 to 11:
- JDK versions available here (java.net) or here (oracle)
- Java 1.8:
jdk1.8.0_65 (local);
or from the Oracle website (requires user account)(local) - To use a particular java version (e.g. 1.8) you need to set the PATH and JAVA_HOME environment variables in every command terminal in which you run the iCASA platform:
> PATH=<path-to-your-java-directory>/bin:$PATH
> JAVA_HOME=<path-to-your-java-directory>
- To check that the variables were correctly set:
echo $JAVA_HOME
echo $PATH
- To check that you are using the java version you intend to:
> java -version
- If you work on the lab machines:
- eclipse is already installed
--> you just need to install the iCASA IDE plug-in and configure it as described on the website
- eclipse is already installed
- If you are using your own laptop, you need to install eclipse -- please refer to eclipse download website: https://www.eclipse.org/downloads/; then follow the instructions on the website to to install the iCASA IDE plug-in and configure it
- configure eclipse to not use a proxy for network connections:
Window --> Preferences --> General --> Network Connections => select 'Direct' option for the Active Provider
- Firefox: Preferences --> Network tab --> Connection Settings --> No Proxy --> Ok
- Chrome: Settings --> Show advanced settings --> Network --> Change Proxy Settings
- Konqueror --> should work with the default proxy configurations
Notes for the Download section
- Java (versions 1.8 to 1.11) is needed to execute the available iCASA teaching distribution.
Please see notes above for more details on how to correctly install and configure your Java environment. - Make sure you use the iCASA teaching distribution that is compatible with your java environment. Please see above.
- The Wisdom Monitor (localhost:9000/monitor) may not work properly under Firefox (e.g. may fail to display new iPOJO instances). Please try different browsers - e.g. Chrome or Internet Explorer
Also, please ignore all references to the previous web-based monitor that was available athttp://localhost:8080/system/console<-- this address is now deprecated. - iCASA simulator can be accessed at: http://localhost:9000/simulator (the default house map can be selected from the main screen or accessed directly: http://localhost:9000/simulator/map/default)
- Eclipse should already be available on the lab workstations.
There is no need to install it in this case. Please make sure to have a Juno distribution (4.2.1) or higher - e.g. Kepler, Luna, Mars etc.. Please see instructions above for how to correctly install and configure your eclipse distrubution.
Manually exporting your project as a .jar archive
This section only concerns the case when the iPOJO Deployment plugin fails to install correctly within the Eclipse platform. This means that the iCASA --> iCASA Bundle Deployment option is not available for your projects (i.e. when right clicking on an iPOJO project). If the iCASA deployment option is available you may safely ignore this section. Otherwise keep reading. In case the iPOJO Deployment plugin malfunctions you may create the .jar archives (bundles) for your project manually and copy them directly into the iCASA platform's applications directory. To determine if this option is available to you, please first check that the iPOJO Manipulator is installed correctly within your Eclipse platform. To do so, right-click on your iPOJO project, then select Properties. In the 'Builders' section of the Properties window, make sure that the following four Builders are present:- Java Builder,
- Plug-in Manifest Builder,
- Extension Point Schema Builder,
- iPOJO Manipulator.
- Right-click on your iPOJO project and select the 'Export' option;
- Select 'Java' then 'JAR file' as exported type; (Next)
- JAR File Specification window: select your project that you want to export and make sure all resources are selected (including the META-INF directory containing your MANIFEST.MF file!); in the same window, also browse to the destination of your .jar archive; (Next)
- JAR Packaging Options window: the default options should do here; (Next)
- JAR Manifest Specification window: select the option 'Use existing manifest from workspace' then browse and select the MANIFEST.MF file of your project; (Finish)
Notes for the Getting Started section
- iPOJO Project Creation: make sure to select the right Java Execution Environment (compatible with you r iCASA teaching distribution). Refer to the notes for the Download and Installation section above.
- Java Execution Environment configuration in MANIFEST.MF file: Felix distribution provided with iCASA only includes the Java Execution Environment up to version 9.
Please make sure you select Java 1.8 as the Execution Environment in your MANIFEST.MF file (see sample snapshot below). You may compile your project (e.g. via eclipse) with more recent java versions.
- Make sure to save your files every time you modify them (e.g. *.java, metadata.xml)
(Eclipse indicates non-saved modifications by adding a * in front of the file name) - Do not empty the iCASA application directory - i.e. do not use iCASA --> "Clean Application Directory" feature, from iCASA IDE. This will remove all archives from iCASA application directory, including the Monitoring application.
Instead, remove un-needed archives manually from the applications directory (e.g. *.jar archives containing your projects). - Implementing the DeviceListener interface: the correct signature for the method devicePropertyModified is
public synchronized void devicePropertyModified(GenericDevice device, String propertyName, Object oldValue, Object newValue)
Notes for the Light Follow Me exercises (Exo1)
- The Command component: do not declare and/or instantiate the Command component twice - e.g. first via the iCASA IDE and second via the @Component and @Instantiate annotations. Only use the annotations to declare all iPOJO aspects instead.
Your metadata.xml file for this component should only contain something like:
<?xml version="1.0" encoding="UTF-8"?>
<ipojo xmlns="org.apache.felix.ipojo"/>
Avoid Common Mistakes
- Make sure to create at least one instance for every component you define. Otherwise, deploying the component will have no effect;
- Make sure to register at least one component as Listener for events emitted by devices you would like to monitor;
- Make sure to unregister Listeners in the component's stop method ;
- Avoid declaring and/or instantiating the Command component twice (e.g. first via the iCASA IDE and second via the @Component and @Instantiate annotations). Doing so will cause random behaviour, difficult to debug.