Installing Petals View

Petals View Configuration and Installation

Introduction

Overview

Petals View is a webapplication dedicated to Petals ESB flows monitoring.

Installation in a nutshell:

  • download these JBI components: petals-se-notification-X.zip and petals-se-kpi-X.zip;
  • download the petals view's war (petals-view-ui-X.war);
  • create all the service assemblies for the KPI. You need to get the infos you want (with prior installation and configuration of related components and services assemblies).

How does it work?

  • You configure a component so that when it is installed, it will register in petals-se-notification base: "I can send notifications to you".
  • Upon reception, petals-se-notification forwards these notifications to petals-se-kpi (configured with its own services assemblies – sa-kpi).
  • What is a sa-kpi? It's a set of filters that will select specific information among the whole flow data. Whenever an exchange fits with a sa-kpi, a notification (with selected data only) is send from the component and will be saved in a relational database. This database has to be shared between KPI Service Engine and Petals View.
  • Petals View then connects to this database to retrieve informations.
  • Messages are saved into the database in a "raw" format. Petals View will give them meaning by naming and organizing them in a human-readable way.

This diagram presents monitoring-related relationships between Petals ESB, various components, SE-notification, SE-KPI, configured sa-kpi and Petals View.

This documentation details Petals View installation in 5 steps:

  • First one is to set up the persistent environment, and configuration file for database access.
  • Second one is to add to some configurations to make the persistent environment common between Petals View and SE-kpi component.
  • Third one is to set up the notification environment, in other words configure the components so that they register in petals-se-notification.
  • Fourth one is, through practical examples, to create the sa-kpi which will filter notification (select only the ones we really want to know about).
  • Fifth one is to configure the referential in Petals View, to give meaning to the raw data stored in the database.

Servers tested

  • Tomcat: versions: 5.5.27, 6.0.29
  • JBoss: versions: 4.0.5.GA, 4.2.3.GA, 5.0.1.GA, 5.1.0.GA
  • Glassfish: version 3
  • Jonas: version 5.1.5

Databases tested

  • H2
  • MySQL: version: 5.0
  • PostgreSQL: version:8.3
  • Oracle: version 10g

First stage: setting up persistent environment

The default configuration uses an H2 database that we don't recommend to use in a production environment.

If you don't have any MySQL (or PostgreSQL) database server up and ready yet, download and install it following your system's procedure.

  • Create a database for Petals View:
    example: petalview
  • Create a user with all rights granted to this database
    example: user: view
    pwd: view
  • Create the database access configuration file. The name of this file is mandatory:
    petals-view.properties
    This file will hold the following informations.
    All database tables will be automatically created at Petals View's first launch.
    An exemple petals-view.properties is provided here with H2 datasource implementation (and MySQL and PostgreSQL examples):

Display code example

Stage 2: Configuring Petals View

petals-se-kpi component

  • Download the KPI component (petals-se-kip.zip)
  • Browse to petals-se-kip.zip/META-INF
  • Open the jbi.xml file.
  • On the line <petals-se-kpi:hibernateURL>: fill in the path of the file petals-view.properties (that you created in Stage 1).

example:

<petals-se-kpi:hibernateURL xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:petals-se-kpi="http://petals.ow2.org/components
/petals-se-kpi/version-1.0-SNAPSHOT" xmlns:kpi-config="http://petals.ow2.org/components/petals\-
se-kpi/specific" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-x">[file:///yourPath/petals-view.properties]
</petals-se-kpi:hibernateURL>

If you use MySQL or Oracle database, You need to copy mysql-connector-java-5.1.x.jar or oracle-jdbc-10g.jar in your petals-se-kpi component with the others dependencies.
Save the changes.

PetalsView.war

  • Download Petals View (PetalsView.war)
  • Browse to PetalsView.war/WEB-INF/spring
  • Open the file petals-view-hibernate.xml
  • Change the hibernate dialect and configure others informations (if necessary):

Display code example

  • Save the changes.
  • If you use MySQL database or Oracle database, you need to copy mysql-connector-java-5.1.x.jar (PetalsView does not work with mysql-connector.java-5.0.x) or oracle-jdbc-10g.jar in your server repository.
  • Define the jndi name to access database in your server: it must be named PetalsViewDataSource (for JBoss, Jonas and WebLogic) or jdbc/PetalsViewDataSource (for Glassfish).

If you use Tomcat, you must change the file PetalsView.war/META-INF/context.xml and configure here your informations. An exemple context.xml is provided here with H2 datasource configuration uncommented and MySQL, PostgreSQL and Oracle configuration commented:

Display code example

If you use WebLogic, you must delete comments in the web.xml file (in PetalsView.war/WEB-INF/ repository) and package PetalsView.war in .ear (with in ear/META-INF repository weblogic-application.xml file).

An exemple weblogic-application.xml is provided here:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-application>
	<prefer-application-packages>
		<package-name>antlr.*</package-name>
		<package-name>javax.persistence.*</package-name>
	</prefer-application-packages>
</weblogic-application>

Stage 3: Configuring and setting up notification environment

  • Setting up Petals ESB and its components:
  • Download and install Petals ESB
  • Install the SE-Notification component
You HAVE to install this component BEFORE ANY OTHER, otherwise there could be configuration conflict preventing notifications to work.
  • Install all components that you don't need to emit notifications
  • Install the SE-KPI component (petals-se-kpi.zip) using the configuration created at Stage 2
  • Configuring the components which will emit notifications: follow this procedure for each one of them:
    • Browse to yourcomponent.zip/META-INF/
    • Open the jbi.xml file
    • Find the following line and set up its value to "true" and save it :
<petalsCDK:notifications xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:soap="http://petals.ow2.org/components/soap/version-x"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-x">
true
</petalsCDK:notifications>
  • Install the component in Petals ESB
  • Install all Services Assemblies you want to use with these components.

Stage 4: Creating your SA-KPI.zip and corresponding SU-KPI.zip

You can use Petals Studio to create the SA-KPI needed for notification configuration. For this guide, we'll use an example of SA/SU batch to show you how to create them.
A SA-KPI is composed of: a META-INF folder which will contain jbi.xml file and the su-kpi.zip.

example of a jbi.xml file from a sa-kpi.zip:

Display code example

A SU-KPI is composed of: a META-INF folder containing SU's jbi.xml file and a special file, modelNotification.xls

example of jbi.xml file of a SU:

Display code example

  • <kpi:TopicExpressionContent>petals:component/cdk/producer/in[]</kpi:TopicExpressionContent> for which state you configure the present SU: in – out – status --fault.
  • define the filtering you want to apply to notifications:
    • If you want to apply filtering criteria on content fields, as long as they are present in the messages change 'publishBusinessEntity' value:
      <kpi:MessageContentXpath>boolean(/*[local-name()='publishBusinessEntity'])</kpi:MessageContentXpath>
    • If you don't want any content filtering, set the value to "true":
      <kpi:MessageContentXpath>boolean(true())</kpi:MessageContentXpath>
    • You can filter directly on service's endpoint or interface (these fields are not mandatory). You can also filter on endpoint:
      <kpi:MessageContentSOAInterfaceNamespace>http://org.ow2.petals/demo/travelagency/agency/</kpi:MessageContentSOAInterfaceNamespace>
      <kpi:MessageContentSOAInterfaceName>travelAgency</kpi:MessageContentSOAInterfaceName>
      <kpi:MessageContentSOAServiceNamespace>http://org.ow2.petals/demo/travelagency/agency/</kpi:MessageContentSOAServiceNamespace>
      <kpi:MessageContentSOAServiceName>travelAgencyService</kpi:MessageContentSOAServiceName>
      <kpi:MessageContentSOAEndpoint>travelAgencyEndpoint</kpi:MessageContentSOAEndpoint>
  • <kpi:TransformPolicy>modelNotification.xsl</kpi:TransformPolicy> defines the name of the file which will be used as a model for the notifications.

example of the modelNotification.xls file:

<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<wsnebm:NotifyContent xmlns:wsnebm="http://www.ebmwebsourcing.com/WS-BaseNotification/NotifyContent"
processType="1" xmlns:age="\[http://org.ow2.petals/demo/travelagency/agency/">
<wsnebm:params>
<wsnebm:param><xsl:value-of select="//age:lastname/text()"/></wsnebm:param>
<wsnebm:param><xsl:value-of select="//email/text()"/></wsnebm:param>
</wsnebm:params>
</wsnebm:NotifyContent>
</xsl:template>
</xsl:stylesheet>

processType: here you have to type the same integer value as in Petals View's referential for this type of flows.
xmlns:age="http://org.ow2.petals/demo/travelagency/agency/": here, you define a parameter

<wsnebm:params>
<wsnebm:param><xsl:value-of select="//age:lastname/text()"/></wsnebm:param>
<wsnebm:param><xsl:value-of select="//email/text()"/></wsnebm:param>
</wsnebm:params>

Here you define the parameters you want to attach to your step.

Stage 5: Configuring the Referential in Petals View

  • Deploy Petals View's war in an application server
  • Connect to Petals View through any web browser (http://server/PetalsView|http://server/PetalsView).
  • To connect for the first time, use the default admin user (login/password: admin/admin)

For more details on configuring a referential in Petals View, check our PetalsView-UserGuide.pdf
Click on "Referential Management" in left menu panel.

If you already launched at least one flow in PetalsESB:

  • Click on the "Unknown" flow type:
    • its type is automatically filled in and cannot be changed
    • define its human-readable name.
  • Click on "CREATE"'
    • You'll arrive directly on the flow type's edition page. Normally, all steps composing this flow should appear together with their service/interface name.

To configure each one and any of the unknown steps:

  • Click on an "unknown" step:
    • Functional (human-readable) name: give it the name of your choice
    • Interface name / Service name: these are automatically filled in with the right info
    • Start flow? and End flow? checkboxes are used to define whether this step is first and/or last one of the flow.
    • Success message: the message which will be displayed when step is in "Success" status.
    • Error message: the message which will be displayed when your step is in "Error" status.
  • Click on "Submit" to save changes and come back on flow type's edition screen.

You can notice that now, the step you defined is not shown on "Unknown tables" anymore, but instead in the referential table.
Click on any defined step to access its edition screen.

To configure a parameter in:

  • In functional fields click on "ADD" and fill in the following informations:
    • Index: relates to its rank in notification, will be automatically incremented.
    • Name: give it the human-readable name of your choice
    • Global: if you check it, this parameter will not only be visible in step view, but also in global view of any flow of this flow type.
  • Click on "Submit" to save changes and come back on step's edition screen.

Repeat the procedure to configure any and all steps and parameters in.

To configure a parameter out or fault:

  • In functional fields click on "ADD" and fill in the following informations:
    • Name: give it the human-readable name of your choice
  • Click on "Submit" to save changes and come back on step's edition screen.

Repeat the procedure to configure any and all steps and parameters out or fault.

If you didn't launch any flow in Petals ESB yet:

  • Click on ''ADD'' button
    • Give a numerical value type (this value corresponds to ProcessType you define in your model notification)
    • define its human-readable name.
  • Click on "CREATE" to save it and go to edition screen of the flow type's referential you just created. Here you can add steps.
  • Click on "Add" to add and configure steps to your referential (fields in yellow are mandatory)
    • Functional name: give it the name of your choice
      example: Travel agency
    • Interface name: fill in the qualified name of your interface
      example: {[http://org.ow2.petals/demo/travelagency/agency/]} travelAgency
    • Service name: fill in the qualified name of your Service
      example: {[http://org.ow2.petals/demo/travelagency/agency]} travelAgencyService
    • Start flow? and End flow? checkboxes are used to define whether this step is first and/or last one of the flow.
    • Success message: the message which will be displayed when step is in "Success" status.
    • Error message: the message which will be displayed when your step is in "Error" status.
  • Click on "Submit" to save and go to the edition screen of the step you just created. You can then configure parameters.
  • Click on "Add" to add parameters to your step.
    • Index: relates to its rank in notification, will be automatically incremented.
    • Name: give it the human-readable name of your choice
    • Global: if checked, this parameter will be visible in step view AND in global view of any flow of this flow type.
  • Click on "Submit" to save the changes.

Repeat the procedure to configure all steps and parameters you want to be shown in Petals View.

Known problems

Unable to start the application under tomcat 6

Under some Operating System (checked on Red Hat Entreprise 5), by default, the Tomcat Security Manager doesn't allow the access to classes with a restricted user. So the application doesn't start. So you must add this lines into the catalina.policy file (you can found it into the conf directory of your tomcat installation):

 grant codeBase "file:${catalina.home}/webapps/petals-view-ui-X/WEB-INF/classes/-" { };

Then you restart the tomcat server, and now the application may start.

Exception opening port H2 TCP Server

If you use the SE KPI with its default configuration (using H2 database - File mode and server enabled), on RedHat like distribution (RHEL, Federo, CentOS) you can get the following error:

Could not obtain connection to query metadata org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Exception opening port H2 TCP Server (tcp://localhost:40374) (port may be in use), cause: timeout [90061-114])

This error is due to the default classic security policy of the previously listed operating systems that allow only to use port lower than 8900.

Two solutions:

  1. break this default security configuration: more performant, less secure
  2. using the H2 database file mode and server disabled: more secure, less performant. To do this replace into the configuration the line 'jdbc.url = jdbc:h2:~/test/db/petalsview;AUTO_SERVER=TRUE' by the line 'jdbc.url = jdbc:h2:file:~/test/db/petalsview'
  3. replace the H2 database, that is not recommended, by another database engine.

Petal View not deploy in JBoss 6

PetalsView does not run with JBoss Application Server 6 because of incompatible versions of CXF. JAS provides a version of CXF that can't be used by PetalsView, and the classloader isolation of JBoss does not work correctly.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.