-
Notifications
You must be signed in to change notification settings - Fork 192
Developer Setup Instructions Eclipse OpenIoT v0.6.1
|
Eclipse Integrated Development Environment (IDE) – Latest Version
Java SDK 1.7+ - Latest Version
JBOSS AS 7.1.1 (Please use only this version)
Maven 3.1 (Or Latest)
- The following variables needs to be set for successful running of maven, JBOSS and java
- JAVA_HOME
- MAVEN_HOME
- The following path needs to be set
- Java bin directory
- Maven bin directory
http://www.mkyong.com/maven/how-to-install-maven-in-windows/
This document aims to provide a step-by-step instruction to deploy the OpenIoT components form scratch.
- UI Folder
-
- ui.requestCommons
- ui.requestDefinition
- ui.requestPresentation
- ide/ide.core
- ui.schemaeditor
- modules
- Scheduler
- scheduler.core
- scheduler.client
- SDUM
- sdum.core
- sdum.client
- LSM-Lite
- lsm-server
- lsm-client
- x-gsn
- security
- security-management
- security-client
- security-server
- CUPUS
- Scheduler
- Under utils
- utils.commons
- Install maven
- Set the path to the maven bin directory
- Ensure you can run the mvn –version command from terminal or command prompt
- Install Eclipse Juno (or latest version). The following eclipse plugins needs to be installed to get a working environment without any errors. If you use a different version of eclipse, please update the following tools with corresponding version.
- Maven 2 Eclipse plugin – This is required to run maven commands from Eclipse and also import POM files into Eclipse as a eclipse-maven project.
- Install JBOSS Maven Support and JBOSS Web and Java EE Development tools – http://download.jboss.org/jbosstools/updates/stable/juno
- Context and Dependency Injection Tools
- Forge Tools
- JBOSS JAX-RS Rools
- JBOSS Tools Java Standard Tools
- JBoss Tools JSF
- JBoss Tools RichFaces
- JBoss Tools Visual Page Editor
- JBoss WebService Tools
- JBossAS Tools
- JIBX Eclipse plugin 1.1.6a from
- Web Tools Platform 3.4.2
All these plugins can be installed from eclipse “install new software” option from under Help menu.
Note: If you use a more recent version of eclipse, please replace the URl with corresponding version specific plugins.
Note: When using Eclipse Kepler, as much as possible, install the above plugins from the Eclipse Marketplace by searching for plugins by name.
- Download JBoss 7.1.
- Unzip JBOSS to a directory in your hard drive.
- In Eclipse, under Windows->Show View->Other, search for servers.
- In the server window, right click and select new.
- If you have all the above plugin and tools installed, you will see an option for JBOSS 7.1 under the server options
- Select the location of JBOSS (the location on your drive previously unzipped).
- Start the JBOSS server from eclipse (a small play icon in the server window) to test and ensure JBOSS is starting and running successfully.
Download the OpenIoT sources from github using your favorite git client (https://github.com/OpenIotOrg/openiot) or if using bash using the command
git clone https://github.com/OpenIotOrg/openiot.git
Here we assume that JBoss AS7 is used in standalone mode. By $jboss-home we refer to JBoss AS7 directory.
Enabling SSL in JBoss
Assume that you store the required SSL files in a path YOUR_SSL_DIR_PATH (e.g., $jboss-home/standalone/configuration/ssl).
- If the directory structure does not exist, run mkdir -p YOUR_SSL_DIR_PATH
- Run cd YOUR_SSL_DIR_PATH
- Run keytool -genkey -alias jbosskey -keypass <password> -keyalg RSA -keystore server.keystore Use "localhost" as Common Name [as answer to "What is your first and last name?"]. If you are deploying on a server, use the DNS name of the server instead of "localhost". If you are deploying on a server with public IP (no DNS), use ip address as Common Name [as answer to "What is your first and last name?"]. Also add the following command to the keytool -genkey -ext san=ip:10.0.0.1
- Run keytool -export -alias jbosskey -keypass <password> -file server.crt -keystore server.keystore
- Run keytool -import -alias jbosscert -keypass <password> -file server.crt -keystore server.keystore Ignore the warning!
- In $jboss-home/standalone/configuration/standalone.xml add the following connector in <subsystem xmlns="urn:jboss:domain:web:1.1" ..
<ssl name="https" key-alias="jbosskey" password=<password> certificate-key-file="YOUR_SSL_DIR_PATH/server.keystore" />
</connector>
- Restart JBoss and go to https://localhost:8443 to see if SSL is enabled and works correctly.
- Next, you'll have to import this certificate into the java trust-store with the commandkeytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -file server.cert -alias incommon. In Linux you will have to do this as root.
If you encounter the error, unable to load the key (as documented by a bug report here https://issues.apache.org/bugzilla/show_bug.cgi?id=38217) follow the below steps
In step 3, 4, and 5 ensure the <password> parameter for keypass and the security store password (requested during command execution in the terminal) are identical.
To remove the previously registered key use the command
keytool -delete -noprompt -alias jbosskey -keystore server.keystore
SSL Troubleshooting
If you encounter the following error, follow the steps suggested here.
SunCertPathBuilderException: Unable To Find Valid Certification Path To Requested Target
Also you might find the solution for your ssl-related issues here.
Please follow the link below for detailed instructions for installing Virtuoso.
Note: for Linux installations, Virtuoso requires a 64 bit machine.
https://github.com/OpenIotOrg/openiot/wiki/InstallingVirtuosoOpensource7Ubuntu
- Start eclipse and create a new workspace.
- Import the following projects into eclipse using the file->import->maven project option.
- scheduler.core
- sdum.core
- security.server
- security.management
- security.client
- ui.requestCommons
- ui.requestDefinition
- ui.requestPresentation
- ui.schemaeditor
- utils.commons
- lsm.server
- lsm.client
- x-gsn
- Each project should import successfully, download all the POM dependencies.
- The above projects are dependent on the utils.commons, ui.requestCommons, lsm-client and security-client.
- Other project might pop up a missing dependency error. Don’t worry yet.
- Right click on the utils.commons project and choose run as-> maven build … (choose the one with three dots)
- In the new window, for goals enter the word “install”
- This will compile the project, generate the jar and install it in the maven repository.
- Repeat the same steps for the ui.requestCommons, security-client and lsm-client projects.
- Right Click on the other projects and run maven->update project
- Now all errors should be resolved and only x-gsn will indicate an error. Ignore this as the error is due to incompatibility to eclipse maven plugin with some x-gsn configurations.
- Copy the openiot.properties and the security.ini file from the utils.common/src/main/resources/properties to the jboss folder standalone/configuration
openiot.properties https://github.com/OpenIotOrg/openiot/blob/develop/utils/utils.commons/src/main/resources/properties/openiot.properties
security-config.ini https://github.com/OpenIotOrg/openiot/blob/develop/utils/utils.commons/src/main/resources/security-config.ini
More documentation on how to assign roles to users is available at https://github.com/OpenIotOrg/openiot/wiki/Security-Use-Console
- Assign the newly created user the above roles allowing this user to access all the services
- Logout
The schema editor interface can be access from http://localhost:8080/ui.schemaeditor
- Login with CAS
https://github.com/OpenIotOrg/openiot/wiki/Virtual-Sensor-RDF-Schema-Editor-Use
The first component setup was xGSN. This was to ensure that there was sensor data available to be used later on by the request application
Wiki reference
Update the X-GSN application.conf file under modules/x-gsn/src/resources as below
Note: The graph information in the application.conf must be identical to the graph information in the openiot.properties file.
Figure 2. LSM Configuration propertiesTo generate the metadata file, use the sensor schema editor which can be accessed from localhost:8080/ui.schemaeditor if the JBOSS is deployed to localhost. Please replace localhost with the public IP or host name if JBOSS depending on your installation.
Follow the instructions in the wiki below to generate sensor descriptions
https://github.com/OpenIotOrg/openiot/wiki/Virtual-Sensor-RDF-Schema-Editor-Use
The schema editor will register the sensor with LSM and provide the user with a metadata file which has to be place in the following directory along with the virtual sensor XML file /modules/x-gsn/virtual-sensors/
There are many sample XML files in the xGSN folder under the LSM directory. Below is a sample XML file that connects to a CSV wrapper to read data from a CSV file.
'Figure 3. Virtual Sensor DescriptionTo run xGSN from command prompt (windows), and shell (linux) the following command is executed
gsn-start.bat
gsn-start.sh
The scheduler core is the core service that will be deployed on JBOSS. The scheduler service can be tested by opening the following URL
http://localhost:8080/scheduler.core/rest/services
The scheduler client is a java application with Swing UI to test the services of the scheduler.core service.
The wiki / cookbook does not seem to provide any documentation on this client application. Here is a quick summary of the function. Some of the functions are still unclear.
Welcome - Will ping the server to test it is running
Discover – The discover service will discover the list of sensors within the given latitude and longitude
Register user – will register a new user with LSM (the new user will be stored into the graph as indicated by the configuration property file previously copied to the JBOSS store).
Login – the second register user section will test if a user is valid by authenticating the user against LSM.
Oamo and Osmo – These functions are used to get rdf information of users and services from the LSM store. More details on this needs to be updated by Nikos.
Figure 10. Scheduler clientThe SDUM core is the core service that will be deployed on JBOSS. The SDUM service can be tested by opening the following URL
http://localhost:8080/sdum.core/rest/services
The sdum client is a java application with Swing UI to test the services of the sdum.core service.
Similar to the scheduler client application, the wiki / cookbook does not seem to provide any documentation on this client application. This makes it difficult for user to start using.
From experimentation, the following is the function of the client UI
Welcome – will test if the sdum.core service has been successfully deployed
Poll – the poll for service will take a service id and get the rdf data related to the service id
note: currently, there is no way to find the service id when using the user interfaces. The scheduler API if used directly without the request definition ui can provide the user with service id’s
Figure 11. Sdum clientThe request definition interface can be access from http://localhost:8080/ui.requestDefinition
- Login with CAS
- Compose a new service
- Validate the design
- Save the design
The request definition interface can be access from http://localhost:8080/ui.requestPresentation
- Login with CAS
- Load your application
- Click on current application-force dashboard refresh
- Data should become available in the selected output format