Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
94 lines (62 sloc) 3.6 KB
INTRODUCTION
============
This example shows different architectures that we can design on ServiceMix 4 platform :
- Messaging using Apache Camel framework
- OSGI Registry with Java Application (Service and DAO layers) to persist information into a DB
- Web using Apache Wicket framework and Spring Dynamic Module to retrieve service fron OSGI registry
More info about this project can be find here http://camel.apache.org/tutorial-osgi-camel-part2.html
Remark : This example does not longer use Hibernate but OpenJPA
COMPILING
=========
mvn clean install
H2 DATABASE
===========
STEP 1 : Open a DOS/UNIX console in the folder persistence/database
STEP 2 : Download H2 Database (http://www.h2database.com/html/download.html) and install it
STEP 3 : Start H2 Server using the bat or shell script
./h2.sh &
The H2 server is started and to manage the databases from your web browser, simply click on the following url http://192.168.1.2:8082/
STEP 4 : Next create the report database
In the login.jsp screen, select Generic (H2) - Server
Add as settings name : Generic H2 (Server) - Webinar
and modify the JDBC ur las such : jdbc:h2:tcp://localhost/~/reportdb
Next click on "connect" and the screen to manage the reportdb appears
STEP 5 : Create Schema and Tables using the script located in the file db/src/main/config/h2-script.sql
Execute the scripts 1), 2) and 3) defined in this file
Check that the records are well created using the command : SELECT * FROM REPORT.T_INCIDENT;
DEPLOYING
=========
STEP 1 : Download Fuse ESB Server from this repository : http://repo.fusesource.com/nexus/content/repositories/releases/org/apache/servicemix/apache-servicemix/4.4.1-fuse-01-06/
STEP 2 : Unzip the zip or tar.gz archive
STEP 3 : Open in a DOS windows or Unix terminal the directory bin
STEP 4 : Edit the file /etc/org.apache.karaf.features.cfg and add the following features to boot
featuresBoot=karaf-framework,config,war,activemq-broker,activemq-spring,camel,camel-cxf,camel-activemq,camel-jaxb,camel-bindy,jpa
STEP 5 : Start ServiceMix servicemix.bat or ./servicemix
STEP 6 : In the servicemix console, launch the commands to install features of reportincident demo
features:addUrl mvn:org.fusesource.devoxx.reportincident/features/1.0-SNAPSHOT/xml/features
features:install reportincident-jpa
STEP 7 : Check if the project works fine and connect to the following url in your browser
http://localhost:8282/cxf/camel-example/incident?wsdl
STEP 8 : Verify of the web site is operational
http://localhost:8181/reportincidentweb/
STEP 9 : Copy incident file
cp ~/wks-projects/tutorial-osgi-camel-part2/routing/src/data/csv-one-record.txt /Fuse/servers/apache-servicemix-4.4.1-fuse-01-06-devoxx/data/reportincident/
STEP 10 : Use SOAPUi client and send this envelope to the server
SOAP Enveloppe
**************
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rep="http://reportincident.devoxx.fusesource.org">
<soapenv:Header/>
<soapenv:Body>
<rep:inputReportIncident>
<incidentId>999</incidentId>
<incidentDate>10-05-2011</incidentDate>
<givenName>Charles</givenName>
<familyName>Moulliard</familyName>
<summary>Issue at the DevoXX</summary>
<details>Room is burning !</details>
<email>cmoulliard@fusesource.com</email>
<phone>+32473604014</phone>
</rep:inputReportIncident>
</soapenv:Body>
</soapenv:Envelope>
!!! Enjoy this DevoXX demo !!!