You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by MikeGeorge <mi...@yahoo.com> on 2006/08/02 14:28:51 UTC
Component & SU in SA: PackageProblem
My aim here is to add the component provided in the link
https://wiki.objectweb.org/petals/Wiki.jsp?page=GettingStarted.WriteAComponent
https://wiki.objectweb.org/petals/Wiki.jsp?page=GettingStarted.WriteAComponent
to the examples/soap-binding in ServiceMix, replacing the jsr181 component.
I exploded the Helloworld files and added to soap-binding example. Then I
deleted the contents from engine-su folder. I also changed the jbi.xml. My
codebase now is as below:
ComponentInAssembly
|
+-build.xml
|
+-client.html
|
+-servicemix.xml
|
+--src
|
+-binding-su
| |
| +-xbean.xml
|
+-components
| |
| +-org
| |
| +-objectweb
| |
| +-petals
| |
| +-engine
| |
| +-helloworld
| |
| +-Helloworld.java
| |
| +-HelloworldBootstrapImpl.java
| |
| +-HelloworldListener.java
|
+-engine-su
|
+-sa
|
+-META-INF
|
+-jbi.xml
I made slight change to Helloworld.java:
private static final String SERVICE = "simple-service";
private static final String ENDPOINT = "simple-service";
ServiceEndpoint endpointReference = this.context.activateEndpoint(new
QName("urn:servicemix:soap-binding", SERVICE), ENDPOINT);
Now, if my jbi.xml is like below:
<?xml version="1.0" encoding="UTF-8"?>
<jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0">
<service-assembly>
<identification>
<name>soap-demo</name>
<description>Soap demo</description>
</identification>
<service-unit>
<identification>
<name>binding-su</name>
<description>Contains the binding</description>
</identification>
<target>
<artifacts-zip>binding-su.zip</artifacts-zip>
<component-name>servicemix-http</component-name>
</target>
</service-unit>
</service-assembly>
</jbi>
I am getting following output in ServiceMix console:
D:\esb\ServiceMix\ServiceAssembly\ComponentInAssembly>D:\Applns\ServiceMix\incubating-servicemix-3.0-SNAPSHOT_2006-05-27\bin\servicemix
servicemix.xml
Apache ServiceMix ESB: 3.0-SNAPSHOT
Loading Apache ServiceMix from file: servicemix.xml
log4j:WARN Continuable parsing error 47 and column 23
log4j:WARN An element with the identifier "FILE" must appear in the
document.
log4j:ERROR No appender named [FILE] could be found.
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=#SubscriptionManager#] with service: null
component: org.apache.servicemix.jbi.nmr.SubscriptionManager@7ecd78
INFO - ComponentMBeanImpl - Initializing component:
#SubscriptionManager#
INFO - DeploymentService - Restoring service assemblies
INFO - JBIContainer - ServiceMix JBI Container
(http://servicemix.org/) name: ServiceMix running version: 3.0-SNAPSHOT
INFO - AutoDeploymentService - Directory: install: Archive
changed: processing servicemix-http-3.0-SNAPSHOT-installer.zip ...
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=servicemix-http] with service: null component:
org.apache.servicemix.http.HttpComponent@1eb5666
INFO - ComponentMBeanImpl - Starting component: servicemix-http
INFO - ComponentMBeanImpl - Initializing component:
servicemix-http
INFO - log - Logging to
org.slf4j.impl.JCLLoggerAdapter@14eaec9 via org.mortbay.log.Slf4jLog
INFO - AutoDeploymentService - Directory: install: Finished
installation of archive: servicemix-http-3.0-SNAPSHOT-installer.zip
INFO - AutoDeploymentService - Directory: deploy: Archive changed:
processing soap-demo-sa.zip ...
INFO - ServiceAssemblyLifeCycle - Starting service assembly:
soap-demo
INFO - ServiceUnitLifeCycle - Initializing service unit:
binding-su
INFO - ServiceUnitLifeCycle - Starting service unit:
binding-suINFO - log - jetty 6.0.0beta15
INFO - log - Started SelectChannelConnector @
localhost:8192
INFO - AutoDeploymentService - Directory: deploy: Finished
installation of archive: soap-demo-sa.zip
My Intention:
is to package a SU and another component (perhaps as another SU) together in
the same SA. So I tried with following jbi.xml (and many variations of it)
jbi.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0">
<component type="service-engine">
<identification>
<name>HelloworldComponentTest</name>
<description>A Helloworld Component</description>
</identification>
<component-class-name>org.objectweb.petals.engine.helloworld.Helloworld</component-class-name>
<component-class-path>
<path-element>engine-su.jar</path-element>
</component-class-path>
<bootstrap-class-name>org.objectweb.petals.engine.helloworld.HelloworldBootstrapImpl</bootstrap-class-name>
<bootstrap-class-path>
<path-element>engine-su.jar</path-element>
</bootstrap-class-path>
</component>
<service-assembly>
<identification>
<name>soap-demo</name>
<description>Soap demo</description>
</identification>
<service-unit>
<identification>
<name>binding-su</name>
<description>Contains the binding</description>
</identification>
<target>
<artifacts-zip>binding-su.zip</artifacts-zip>
<component-name>servicemix-http</component-name>
</target>
</service-unit>
<service-unit>
<identification>
<name>engine-su</name>
<description>Contains the service</description>
</identification>
<target>
<artifacts-zip>engine-su.jar</artifacts-zip>
<component-name>HelloworldComponentTest</component-name>
</target>
</service-unit>
</service-assembly>
</jbi>
With this jbi.xml, I am getting following output in ServiceMix console:
D:\esb\ServiceMix\ServiceAssembly\ComponentInAssembly>D:\Applns\ServiceMix\incubating-servicemix-3.0-SNAPSHOT_2006-05-27\bin\servicemix
servicemix.xml
Apache ServiceMix ESB: 3.0-SNAPSHOT
Loading Apache ServiceMix from file: servicemix.xml
log4j:WARN Continuable parsing error 47 and column 23
log4j:WARN An element with the identifier "FILE" must appear in the
document.
log4j:ERROR No appender named [FILE] could be found.
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=#SubscriptionManager#] with service: null
component: org.apache.servicemix.jbi.nmr.SubscriptionManager@7ecd78
INFO - ComponentMBeanImpl - Initializing component:
#SubscriptionManager#
INFO - DeploymentService - Restoring service assemblies
INFO - JBIContainer - ServiceMix JBI Container
(http://servicemix.org/) name: ServiceMix running version: 3.0-SNAPSHOT
INFO - AutoDeploymentService - Directory: install: Archive
changed: processing servicemix-http-3.0-SNAPSHOT-installer.zip ...
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=servicemix-http] with service: null component:
org.apache.servicemix.http.HttpComponent@1e4a47e
INFO - ComponentMBeanImpl - Starting component: servicemix-http
INFO - ComponentMBeanImpl - Initializing component:
servicemix-http
INFO - log - Logging to
org.slf4j.impl.JCLLoggerAdapter@633d51 via org.mortbay.log.Slf4jLog
INFO - AutoDeploymentService - Directory: install: Finished
installation of archive: servicemix-http-3.0-SNAPSHOT-installer.zip
INFO - AutoDeploymentService - Directory: deploy: Archive changed:
processing soap-demo-sa.zip ...
*** HelloworldBootstrapImpl.init...
*** HelloworldBootstrapImpl.onInstall...
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=HelloworldComponentTest] with service: null
component: org.objectweb.petals.engine.helloworld.Helloworld@1b22920
*** HelloworldBootstrapImpl.cleanUp...
INFO - ComponentMBeanImpl - Starting component:
HelloworldComponentTest
INFO - ComponentMBeanImpl - Initializing component:
HelloworldComponentTest
*** Helloworld.init...
*** Helloworld.start...
*** HelloworldListener.HelloworldListener...
*** Helloworld.start. End.
INFO - AutoDeploymentService - Directory: deploy: Finished
installation of archive: soap-demo-sa.zip
I have noticed:
In the second case, we are missing the following lines:
INFO - ServiceAssemblyLifeCycle - Starting service assembly:
soap-demo
INFO - ServiceUnitLifeCycle - Initializing service unit:
binding-su
INFO - ServiceUnitLifeCycle - Starting service unit: binding-su
My build.xml is as follows:
<project name="jms-binding" default="setup" basedir=".">
<property name="ServiceMix.home"
value="D:/Applns/ServiceMix/incubating-servicemix-3.0-SNAPSHOT_2006-05-27"/>
<property name="build.dir" value="build"/>
<property name="comp.build.dir" value="${build.dir}/components"/>
<property name="client.build.dir" value="${build.dir}/client"/>
<property name="src.dir" value="src"/>
<property name="comp.src.dir" value="${src.dir}/components"/>
<property name="client.src.dir" value="${src.dir}/client"/>
<property name="su.engine.src.dir" value="${src.dir}/engine-su"/>
<property name="su.binding.src.dir" value="${src.dir}/binding-su"/>
<property name="sa.src.dir" value="${src.dir}/sa"/>
<target name="clean">
<delete dir="target" quiet="true"/>
<delete dir="${build.dir}" quiet="true"/>
</target>
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${comp.build.dir}"/>
<mkdir dir="${client.build.dir}"/>
<path id="javac.classpath">
<pathelement path="${comp.build.dir}"/>
<pathelement path="${client.build.dir}"/>
<pathelement path="${ServiceMix.home}/conf"/>
<fileset dir="${ServiceMix.home}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${ServiceMix.home}">
<include name="*.jar"/>
</fileset>
</path>
</target>
<target name="build-components" depends="init" description="Build
components">
<javac srcdir="${comp.src.dir}" destdir="${comp.build.dir}" debug="on"
source="1.4" target="1.4">
<classpath refid="javac.classpath"/>
</javac>
</target>
<target name="build-engine-su" depends="build-components"
description="Build the engine service unit">
<jar jarfile="${build.dir}/engine-su.jar" update="true">
<fileset dir="${comp.build.dir}"/>
</jar>
</target>
<target name="build-binding-su" description="Build the binding service
unit">
<zip destfile="${build.dir}/binding-su.zip">
<fileset dir="${su.binding.src.dir}"/>
</zip>
</target>
<target name="build-sa" depends="build-engine-su, build-binding-su"
description="Build the service assembly">
<zip destfile="${build.dir}/soap-demo-sa.zip">
<fileset dir="${build.dir}" includes="engine-su.jar"/>
<fileset dir="${build.dir}" includes="binding-su.zip"/>
<fileset dir="${sa.src.dir}"/>
</zip>
</target>
<target name="setup" depends="build-sa" description="Setup servicemix">
<mkdir dir="install"/>
<mkdir dir="deploy"/>
<copy todir="install">
<!--fileset dir="${ServiceMix.home}/components"
includes="*jsr181*"/-->
<fileset dir="${ServiceMix.home}/components" includes="*http*"/>
</copy>
<copy file="${build.dir}/soap-demo-sa.zip" todir="deploy"/>
</target>
</project>
The Problem:
The service is not accessible @ http://localhost:8192/Service/ and I am
getting "STATUS: 12029" at client. I assume my packaging is not correct.
Can someone help me how to do the packaging correctly.
--
View this message in context: http://www.nabble.com/Component---SU-in-SA%3A-PackageProblem-tf2039538.html#a5612794
Sent from the ServiceMix - User forum at Nabble.com.