DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report

Apache ServiceMix Development Environment Setup

Ben O'Day user avatar by
Ben O'Day
·
Apr. 28, 12 · Interview
Like (1)
Save
Tweet
Share
20.60K Views

Join the DZone community and get the full member experience.

Join For Free
Here is a quick guide to setting up a development environment for working on Apache Servicemix projects... You can update some of these versions mentioned in the rundown, as it was written a little while ago.

Java 1.6

  • download the JDK and run installation
  • add the /jdk/bin directory to your system path
  • create JAVA_HOME environment variable pointing to the root JDK directory
Maven 2.1

  • download binary and unzip to a local directory
  • edit the /bin/mvn.bat file to increase the Maven heap size (MAVEN_OPTS=-Xmx512m)
  • add the /maven/bin directory to your system path
Eclipse 3.4

  • download Eclipse and run installation
  • open Eclipse

    • create a new workspace
    • create new project or import any existing projects 

  • setup m2eclipse plugin

    • go to Help->Software Updates->Available Software tab
    • then click 'Add Site' and add 'http://m2eclipse.sonatype.org/update/ and call it 'm2eclipse'
    • select the m2clipse components to install, click finish and restart Eclipse
    • go to Windows->Preferences->Maven->Installations
      • set the user settings to your maven settings.xml file
      • verify that this setup the M2_REPO variable to point to your local repo under Java->Build Path->Classpath Variables
    • go to Windows->Preferences->Maven->Archetypes
      • click 'Add Remote Catalog'
        • catalog file = http://repo.fusesource.com/maven2
        • name = Fuse Catalog
        • click OK
Fuse ESB 4.2 (aka ServiceMix)

  • donwload Fuse ESB 4.2 and run installation
basic development process

  • create a new project using an archetype (Maven template) that best matches your application needs

    • from Eclipse
      • File->New->Maven->Maven Project
      • check 'use default workspace location' and click next
      • choose the 'Fuse Catalog' and enter a desire filter
      • choose an archetype
      • click next
      • enter a group id of 'com.<company>.<project>'
      • enter an artifact of '<component>'
      • enter a package name of 'com.<company>.<project>.<component>'
      • click finish 
        • note: I have seen issues with some archetypes in Eclipse, if this happens, use the command line approach instead
    • from command line
      • mvn archetype:create
        -DarchetypeGroupId=org.apache.servicemix.tooling
        -DarchetypeArtifactId=servicemix-osgi-camel-archetype
        -DarchetypeVersion=2010.01.0-fuse-01-00
        -DremoteRepositories=http://repo.fusesource.com/maven2
        -DgroupId=com.mycompany.project1
        -DartifactId=component1
        -Dversion=0.0.1-SNAPSHOT
  •  build the project

    • in Eclipse
      • right click on the project, go to Run As->Maven install
    • from command line
      • run 'mvn install'
    • project JAR will be created under the /target directory and deployed it to your local Maven repository
  • deploying the project to Fuse ESB 4.2

    • run /<smx>/bin/servicemix to start the server
    • make sure any required features/bundles have been installed
      • activemq, camel, etc
    • from the karaf console, install your project bundle
      • osgi:install -s mvn:com.mycompany.project1/component1
    • assuming that worked, you now have a working project
  • customize project and repeat build/deploy process

Monitoring


  • watch the servicemix log file
    • tail -f /<smx>/data/log/karaf.log
  •  JConsole
    • <jdk>/bin/jconsole.exe
    • provides remote/local JVM monitoring
    • remote connection uri = service:jmx:rmi:///jndi/rmi://:1099/jmxrmi
    • default user/password = karaf/karaf
  • VisualVM
    • <jdk>/bin/jvisualvm.exe
    • provides remote/local JVM monitoring (slightly better than JConsole)
other recommended software (for Windows)

  • cygwin  - adds basic Linux command support for Windows
  • PowerCMD - tabbed command prompts...trial/not free
  • kdiff3 - excellent file/directory comparison tool
  • SoapUI - for testing HTTP endpoints

If you know of other configurations or tools that are relevant, let me know...
Apache ServiceMix

Published at DZone with permission of Ben O'Day, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Introduction to Spring Cloud Kubernetes
  • The Power of Docker Images: A Comprehensive Guide to Building From Scratch
  • Implementing PEG in Java
  • DevOps for Developers: Continuous Integration, GitHub Actions, and Sonar Cloud

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: