Monday Apr 06, 2009

Fuji Milestone 4 has Logger configuration support. Runtime loggers and component loggers can be configured using Fuji admin CLI. Logger Configuration Support in Fuji leverages OSGi ConfigurationAdmin service.

Play with it !!

Download and setup FujiFelix distribution:

    (i)Download the M4 release from Fuji maven repository.
    (ii)Extract it in <FujiHome>
    (iii)cd <FujiHome>; java -jar bin/felix.jar

Listing Runtime Loggers:

    -> fuji list-loggers
    Fuji Runtime Loggers
    -----------------------------------
    com.sun.jbi = INFO
    com.sun.jbi.fuji = INFO
    com.sun.jbi.framework = INFO
    com.sun.jbi.messaging = INFO
    com.sun.jbi.interceptors = INFO
    com.sun.jbi.logging = INFO
    Command list-loggers executed successfully.

Listing Component Loggers:

    Now start a component, example, sun-file-binding
    -> start 20
    -> fuji list-loggers --component sun-file-binding
    Loggers For Component sun-file-binding
    -------------------------------------------------------------
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.OutboundMessageProcessor = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.InboundMessageProcessor = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.management.FileBCManagement = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.FileBindingDeployer = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.bootstrap.FileBindingBootstrap = INFO
    com.sun.jbi.sun-file-binding = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.FileBindingLifeCycle = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.bootstrap.InstallerExt = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.common.qos.messaging.MessagingChannel = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.RuntimeConfiguration = INFO
    Command list-loggers executed successfully.

Configuring a Runtime Logger:

    -> fuji set-logger com.sun.jbi.messaging=FINEST
    Command set-logger executed successfully.
    -> fuji list-loggers
    Fuji Runtime Loggers
    ----------------------------------
    com.sun.jbi = INFO
    com.sun.jbi.fuji = INFO
    com.sun.jbi.framework = INFO
    com.sun.jbi.messaging = FINEST
    com.sun.jbi.interceptors = INFO
    com.sun.jbi.logging = INFO
    Command list-loggers executed successfully.

Configuring a Component Logger:

    -> fuji set-logger --component sun-file-binding com.sun.jbi.sun-file-binding=FINE
    Command set-logger executed successfully.
    -> fuji list-loggers --component sun-file-binding
    Loggers For Component sun-file-binding
    --------------------------------------
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.OutboundMessageProcessor = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.InboundMessageProcessor = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.management.FileBCManagement = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.FileBindingDeployer = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.bootstrap.FileBindingBootstrap = FINE
    com.sun.jbi.sun-file-binding = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.FileBindingLifeCycle = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.bootstrap.InstallerExt = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.common.qos.messaging.MessagingChannel = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.RuntimeConfiguration = FINE
    Command list-loggers executed successfully.

Component Root logger:

When a JBI component is installed, the framework creates a component root logger with the name "com.sun.jbi.<component-name>". By configuring this component root logger, all other component logger could be configured.

System root logger:

When Fuji framework starts up, it creates a system a root logger with the name "com.sun.jbi". This is the parent logger for all other runtime loggers and component loggers. By changing this logger's level, all other Fuji loggers (that were created with the default level - inherits from parent) can be configured automatically.

More to come:

    (i)Logger configuration support from Netbeans - issue 1599
    (ii)Logger configuration support in Equinox - issue 1600
    (iii)Interceptor logger configuration - issue 1487

Thursday Nov 20, 2008

1. Framework Startlevel

The documentation says
org.osgi.framework.startlevel - The initial start level of the framework once it starts execution; the default value is 1.

This means, if you have a bundle installed at a start level that is higher than the framework start level, you won't be able to start it.
Want an example?

felix.auto.install.2= \
     file:bundle/test-bundle.jar

org.osgi.framework.startlevel=1

Now, if you do
"start   <test-bundle-id>"

it is a no-op. After checking your bundle activator again and again, you googled your way here and now you know what happened.

2. Install/Startup ordering

If you have bundles in different levels, like this

felix.auto.start.1= \
     file:bundle/bundle-1.jar
     file:bundle/bundle-2.jar

felix.auto.install.2=\
     file:bundle/bundle-3.jar

and you are betting on the fact that bundle-2 will be stared before bundle-3 is installed, you are in trouble.
Because you see, all bundles are installed first and then bundles in different levels are started up in order.

Wednesday Oct 22, 2008

Fuji Milestone 2 is out!! Check it out at Open ESB Downloads.

Fuji distribution includes a Felix instance, JBI components, some libraries and a cool demo application. It also includes Sun Database Binding, Derby Network Server bundle, Derby client bundle and a JNDI provider bundle.

When you start the Fuji instance, the derby server bundle starts up an instance of Derby Network Server in the port 1600. Thanks to SpringSource maven repository, a client bundle is also made readily available in the distribution. Simple JNDI is used to provide the JNDI solution.

Some pointers...

1)Create a table in Derby.

Refer to M2 demo instructions for details.

2)Edit JNDI configuration.

The configuration file for JNDI is in fuji/jndi/<resource-name>.properties. For more details on this config file see these instructions.

3)Edit message definition in database binding.

Provide the schema corresponding to your table in message.xsd. In interface.wsdl, replace msg:record with the actual element name.

Friday Apr 04, 2008

Here is some news to cheer up!!!
With some fixes that went in recently, bpelengine rocks in WebSphere.

Get some action!

1.Download required JBI Components

sun-bpel-engine
sun-file-binding
sun-sharedutil-library
sun-encoder-library

To learn more about these components, visit open-jbi-components

2.Get the Composite Application
Download the sample that Keith created to demo OpenESB in Java SE.
For more info about OpenESB in Java SE read Keith's blog

3. See them all work together
Install the components, deploy the composite application and start it.
Please refer to command listing below.

Create /temp/input.txt and see the contents get processed and appear in output.txt.
Yep! Very easy! Enjoy!!


Commands:
ant -f jbi_admin.xml -Djbi.port=2809 -Djbi.install.file=sharedutillib.jar install-shared-library

ant -f jbi_admin.xml -Djbi.port=2809 -Djbi.install.file=bpelserviceengine.jar install-component

ant -f jbi_admin.xml -Djbi.port=2809 -Djbi.component.name=sun-bpel-engine start-component

ant -f jbi_admin.xml -Djbi.port=2809 -Djbi.install.file=encoderlib.jar install-shared-library

ant -f jbi_admin.xml -Djbi.port=2809 -Djbi.install.file=filebc.jar install-component

ant -f jbi_admin.xml -Djbi.port=2809 -Djbi.component.name=sun-file-binding start-component

ant -f jbi_admin.xml -Djbi.port=2809 -Djbi.deploy.file=CompositeApp1.zip deploy-service-assembly

ant -f jbi_admin.xml -Djbi.port=2809 -Djbi.service.assembly.name=CompositeApp1 start-service-assembly
P.S: For classpath details please refer to the previous posting.

Monday Aug 13, 2007

Yes! Open ESB runs in WebSphere.

A servlet wrapped implementation of Open ESB has been developed as a proof of concept.

Instructions to run Open ESB in WebSphere 6.0

1)Download the war and deploy it following the default settings.

2)Now say, No Thanks!, to some of the attributes added to MBean names by WebSphere, by creating a custom property.

(i)Navigate to Servers > Application Servers > Server1(Server Infrastructure) >
Administration > Administration Services > Custom Properties.

(ii)Click New and supply the following values for name and value fields respectively
com.ibm.websphere.mbeans.disableRouting
<on>com.sun.jbi:*</on><on>com.sun.jbi.esb:*</on>

3)Start the application. Click on Enterprise Applications, select openesb-websphere-1_1_war and start it.

Instructions to administer Open ESB and run the demo

1)Download the client jar and unjar in <CLIENT_HOME>.

2)Configure the environment as follows and make sure ant is in your PATH.

set JAVA_HOME=<WAS_HOME>/AppServer/java

set CLASSPATH=<WAS_HOME>/AppServer/runtimes/com.ibm.ws.admin.client_6.1.0.
jar;<CLIENT_HOME>/jbi-admin-common.jar;<CLIENT_HOME>/jbi-ant-tasks.jar

3)Run the demo application. Note: For demo purposes, I am using the following experimental components: SunFileBinding and SunTransformationEngine. These two components are attached to this blog. You can find sources for these two experimental components in File Binding Source and Transformation Engine Source.
Fully functional Open ESB components can be downloaded here.

(i)Download sun-wsdl-library, SunFileBinding, SunTransformationEngine,
FileTransformApp, sample_input.xml.

(ii)ant -f <CLIENT_HOME>/jbi_admin.xml -Djbi.port=2809
-Djbi.host=<hostname> -Djbi.username=<username>
-Djbi.password=<password> -Djbi.install.file=wsdlsl.jar
install-shared-library

(iii)ant -f <CLIENT_HOME>/jbi_admin.xml -Djbi.port=2809
-Djbi.host=<hostname> -Djbi.username=<username>
-Djbi.password=<password> -Djbi.install.file=file-binding.jar
install-component

(iv)ant -f <CLIENT_HOME>/jbi_admin.xml -Djbi.port=2809
-Djbi.host=<hostname> -Djbi.username=<username>
-Djbi.password=<password> -Djbi.install.file=transformation-engine.jar
install-component

(v)ant -f <CLIENT_HOME>/jbi_admin.xml -Djbi.port=2809
-Djbi.host=<hostname> -Djbi.username=<username>
-Djbi.password=<password> -Djbi.deploy.file=FileTransformApp.zip
deploy-service-assembly

(vi)ant -f <CLIENT_HOME>/jbi_admin.xml -Djbi.port=2809
-Djbi.host=<hostname> -Djbi.username=<username>
-Djbi.password=<password> -Djbi.service.assembly.name=FileTransformApp
start-service-assembly

(vii)Copy sample_input.xml to c:\tmp\test\input\transforminout and
see it magically transform into a html file and go to c:\tmp\test\output.