You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Charles Souillard <Ch...@ext.bull.net> on 2006/01/18 17:32:48 UTC

ServiceUnit

Hi all,

I have written my first Service Engine (which is not already completed...).
I want to make a service available for the new SE. I think I have to 
deploy a serviceUnit to do that...

Does anybody knows how I can do that ?
Is there any ant task doing this ?

My serviceUnit will contain at least 2 files (one wsdl and one bpel) and 
perhaps some others...

Thanks for your help.
Cheers
Charles

Re: ServiceUnit

Posted by Simon Čarni <si...@gmail.com>.
Hi Charles!
As far as I understand, the way you should package SU depends on how your
ServiceUnitManager is implemeted (take a look at test cases)

If you allready packaged your SU you should just copy it to SM\deploy dir...

Cheers,
Simon


2006/1/18, Charles Souillard <Ch...@ext.bull.net>:
>
> Hi all,
>
> I have written my first Service Engine (which is not already
> completed...).
> I want to make a service available for the new SE. I think I have to
> deploy a serviceUnit to do that...
>
> Does anybody knows how I can do that ?
> Is there any ant task doing this ?
>
> My serviceUnit will contain at least 2 files (one wsdl and one bpel) and
> perhaps some others...
>
> Thanks for your help.
> Cheers
> Charles
>

Re: ServiceUnit

Posted by Charles Souillard <Ch...@ext.bull.net>.
I just want to give a detail...

When I extract my zip file :

orchestra-jbi.zip
|
|_ jbi.xsd
|_ service.xsd
|_ orchestra-lib
  |_ orchestra-jbi.jar
|_ META-INF
  |_ jbi.xml

orchestra-jbi.jar contains all the jbi classes of my component 
(Component, Endpoint, BootStrap...)

My jbi.xml contains :

<?xml version="1.0"?>

<jbi
  version="1.0"
  xmlns="http://java.sun.com/xml/ns/jbi"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/jbi ./jbi.xsd">

  <!-- identification information about this engine -->
  <component
    type="service-engine">
    <identification>
      <name>Orchestra</name>
      <description> This is the Orchestra BPEL engine, adapter for JBI..
      </description>
    </identification>

    <component-class-name 
description="ComponentImplementation">com.bull.bsoap.bpel.jbi.OrchestraComponent</component-class-name>
    <component-class-path>

        <path-element>orchestra-lib/bpelapi.jar</path-element>
        <path-element>orchestra-lib/bpeladmin.jar</path-element>
        <path-element>orchestra-lib/orchestra-jbi.jar</path-element>

    </component-class-path>
    
<bootstrap-class-name>com.bull.bsoap.bpel.jbi.OrchestraBootstrap</bootstrap-class-name>
    <bootstrap-class-path>
        <path-element>orchestra-lib/bpelapi.jar</path-element>
        <path-element>orchestra-lib/bpeladmin.jar</path-element>
        <path-element>orchestra-lib/orchestra-jbi.jar</path-element>
    </bootstrap-class-path>
  </component>
</jbi>




Thanks
Charles


Charles Souillard wrote:

> Thanks a lot for your help !!!
>
> I have build my first Service Assembly !
>
> I have launched the jmx console, but I think my Service Engine is not 
> deployed...
> So I tried :
> org.servicemix.jbi.framework.InstallationService.install :
> My zip file is found but  I get the folllowing error in servicemix 
> terminal :
> component class com.bull.bsoap.bpel.jbi.OrchestraComponent not found
>
> In addition I get an error popup :
> Error
> Problem Invoking Install : java.rmi.UnmarshalException : Error 
> unmarshaling return; nested exception is :
> java.lang.ClassNotFoundException : 
> javax.jbi.management.DeploymentException : (no security manager RMI 
> classloader disabled)
> Can you help me with that ?
>
> I saw in pxe jbi installer that a lot of jars are included...
> Do you know wich classes I need to package with my installer ?
>
> Thanks
> Charles
>
> Hossam Karim wrote:
>
>> Charles,
>> You might need to read the specification, but here is a quick solution:
>>
>>
>> - The specification does define ANT tasks for deployment, but not for
>> building artifacts
>>
>> - You MUST implement the ServiceUnitManager interface, and return an
>> instance of the implementation to the container from
>> 'getServiceUnitManager()' method of your component implementation class.
>> ServiceMix has many adaptor and helper classes that simplify this 
>> task, but
>> I am keeping with the standard in my example.
>>
>> - You will need to package your service unit (ZIP file) in a service
>> assembly (ZIP file), following is a sample jbi.xml (descriptor) file for
>> your service assembly, and this should go under the META-INF 
>> directory of
>> your service assembly zip file: (let's call the zip file
>> my-first-service-assembly.zip)
>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>> <jbi version="1" xsi:schemaLocation="http://java.sun.com/xml/ns/jbi
>> ./jbi.xsd"
>>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns="http://java.sun.com/xml/ns/jbi">
>>  <service-assembly>
>>    <identification>
>>      <name>my-first-service-assembly</name>
>>      <description>My Service Assembly</description>
>>    </identification>
>>
>>    <service-unit>
>>      <identification>
>>        <name>my-first-service-unit</name>
>>        <description>My Service Unit</description>
>>      </identification>
>>      <target>
>>        <artifacts-zip>my-first-service-unit.zip</artifacts-zip>
>>        <component-name>MyServiceEngine</component-name>
>>      </target>
>>    </service-unit>
>>
>>  </service-assembly>
>> </jbi>
>>
>> - The < artifacts-zip> element's text in the previous listing should 
>> point
>> to your service unit zip file, so this is another zip file that 
>> should be
>> contained inside my-first-service-assembly.zip. The specification 
>> requires
>> that you add a descriptor for the service unit as well, but 
>> ServiceMix does
>> not complain if you don't.
>>  The layout of the files should look like:
>>
>>  my-first-service-assembly.zip
>>  |
>>  |_META-INF
>>    |_jbi.xml
>>  |_ my-first-service-unit.zip
>>    |
>>    |_META-INF
>>    |_myprocess.bpel
>>    |_myservice.wsdl
>>
>> - I never used hot deployment in ServiceMix, I only use JMX. So if 
>> you can
>> connect to ServiceMix JMX services, you should find the class
>> org.servicemix.jbi.framework.DeploymentService exposed as an MBean.
>> Use the method java.lang.String deploy() supplying the full path name of
>> your service assembly.
>>
>> - Now if you already implemented ServiceUnitManager interface, your
>> implementation should be notified by the container that a new service 
>> unit
>> has been deployed. This happens through firing:
>> public String deploy(String serviceUnitName, String 
>> serviceUnitRootPath).
>> You should be able to read your files here. Notice that you should 
>> return a
>> string explaining the status of the deployment. Have a look at the 
>> javadoc
>> for the exact format of this string, it is an XML message.
>>
>> - Now that the service unit is deployed, it has to be started. To do 
>> so, use
>> the mentioned MBean again, with the method
>> java.lang.String start() supplying the name of your service unit. 
>> This is
>> just the name without paths or extensions. You should start executing 
>> your
>> logic here.
>>
>> Hope this helps,
>> Hossam Karim
>>
>> -----Original Message-----
>> From: Charles Souillard [mailto:Charles.Souillard@ext.bull.net] Sent: 
>> Wednesday, January 18, 2006 6:33 PM
>> To: servicemix-users@geronimo.apache.org
>> Subject: ServiceUnit
>>
>> Hi all,
>>
>> I have written my first Service Engine (which is not already 
>> completed...).
>> I want to make a service available for the new SE. I think I have to 
>> deploy a serviceUnit to do that...
>>
>> Does anybody knows how I can do that ?
>> Is there any ant task doing this ?
>>
>> My serviceUnit will contain at least 2 files (one wsdl and one bpel) 
>> and perhaps some others...
>>
>> Thanks for your help.
>> Cheers
>> Charles
>>
>>
>>  
>>
>

Re: ServiceUnit

Posted by Charles Souillard <Ch...@ext.bull.net>.
Thanks a lot for your help !!!

I have build my first Service Assembly !

I have launched the jmx console, but I think my Service Engine is not 
deployed...
So I tried :
org.servicemix.jbi.framework.InstallationService.install :
My zip file is found but  I get the folllowing error in servicemix 
terminal :
component class com.bull.bsoap.bpel.jbi.OrchestraComponent not found

In addition I get an error popup :
Error
Problem Invoking Install : java.rmi.UnmarshalException : Error 
unmarshaling return; nested exception is :
java.lang.ClassNotFoundException : 
javax.jbi.management.DeploymentException : (no security manager RMI 
classloader disabled)
Can you help me with that ?

I saw in pxe jbi installer that a lot of jars are included...
Do you know wich classes I need to package with my installer ?

Thanks
Charles

Hossam Karim wrote:

>Charles,
>You might need to read the specification, but here is a quick solution:
>
>
>- The specification does define ANT tasks for deployment, but not for
>building artifacts
>
>- You MUST implement the ServiceUnitManager interface, and return an
>instance of the implementation to the container from
>'getServiceUnitManager()' method of your component implementation class.
>ServiceMix has many adaptor and helper classes that simplify this task, but
>I am keeping with the standard in my example.
>
>- You will need to package your service unit (ZIP file) in a service
>assembly (ZIP file), following is a sample jbi.xml (descriptor) file for
>your service assembly, and this should go under the META-INF directory of
>your service assembly zip file: (let's call the zip file
>my-first-service-assembly.zip)
><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
><jbi version="1" xsi:schemaLocation="http://java.sun.com/xml/ns/jbi
>./jbi.xsd"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>xmlns="http://java.sun.com/xml/ns/jbi">
>  <service-assembly>
>    <identification>
>      <name>my-first-service-assembly</name>
>      <description>My Service Assembly</description>
>    </identification>
>
>    <service-unit>
>      <identification>
>        <name>my-first-service-unit</name>
>        <description>My Service Unit</description>
>      </identification>
>      <target>
>        <artifacts-zip>my-first-service-unit.zip</artifacts-zip>
>        <component-name>MyServiceEngine</component-name>
>      </target>
>    </service-unit>
>
>  </service-assembly>
></jbi>
>
>- The < artifacts-zip> element's text in the previous listing should point
>to your service unit zip file, so this is another zip file that should be
>contained inside my-first-service-assembly.zip. The specification requires
>that you add a descriptor for the service unit as well, but ServiceMix does
>not complain if you don't.
>  The layout of the files should look like:
>
>  my-first-service-assembly.zip
>  |
>  |_META-INF
>    |_jbi.xml
>  |_ my-first-service-unit.zip
>    |
>    |_META-INF
>    |_myprocess.bpel
>    |_myservice.wsdl
>
>- I never used hot deployment in ServiceMix, I only use JMX. So if you can
>connect to ServiceMix JMX services, you should find the class
>org.servicemix.jbi.framework.DeploymentService exposed as an MBean.
>Use the method java.lang.String deploy() supplying the full path name of
>your service assembly.
>
>- Now if you already implemented ServiceUnitManager interface, your
>implementation should be notified by the container that a new service unit
>has been deployed. This happens through firing:
>public String deploy(String serviceUnitName, String serviceUnitRootPath).
>You should be able to read your files here. Notice that you should return a
>string explaining the status of the deployment. Have a look at the javadoc
>for the exact format of this string, it is an XML message.
>
>- Now that the service unit is deployed, it has to be started. To do so, use
>the mentioned MBean again, with the method
>java.lang.String start() supplying the name of your service unit. This is
>just the name without paths or extensions. You should start executing your
>logic here.
>
>Hope this helps,
>Hossam Karim
> 
>-----Original Message-----
>From: Charles Souillard [mailto:Charles.Souillard@ext.bull.net] 
>Sent: Wednesday, January 18, 2006 6:33 PM
>To: servicemix-users@geronimo.apache.org
>Subject: ServiceUnit
>
>Hi all,
>
>I have written my first Service Engine (which is not already completed...).
>I want to make a service available for the new SE. I think I have to 
>deploy a serviceUnit to do that...
>
>Does anybody knows how I can do that ?
>Is there any ant task doing this ?
>
>My serviceUnit will contain at least 2 files (one wsdl and one bpel) and 
>perhaps some others...
>
>Thanks for your help.
>Cheers
>Charles
>
>
>  
>

RE: ServiceUnit

Posted by Hossam Karim <hr...@gmail.com>.
Charles,
You might need to read the specification, but here is a quick solution:


- The specification does define ANT tasks for deployment, but not for
building artifacts

- You MUST implement the ServiceUnitManager interface, and return an
instance of the implementation to the container from
'getServiceUnitManager()' method of your component implementation class.
ServiceMix has many adaptor and helper classes that simplify this task, but
I am keeping with the standard in my example.

- You will need to package your service unit (ZIP file) in a service
assembly (ZIP file), following is a sample jbi.xml (descriptor) file for
your service assembly, and this should go under the META-INF directory of
your service assembly zip file: (let's call the zip file
my-first-service-assembly.zip)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jbi version="1" xsi:schemaLocation="http://java.sun.com/xml/ns/jbi
./jbi.xsd"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/jbi">
  <service-assembly>
    <identification>
      <name>my-first-service-assembly</name>
      <description>My Service Assembly</description>
    </identification>

    <service-unit>
      <identification>
        <name>my-first-service-unit</name>
        <description>My Service Unit</description>
      </identification>
      <target>
        <artifacts-zip>my-first-service-unit.zip</artifacts-zip>
        <component-name>MyServiceEngine</component-name>
      </target>
    </service-unit>

  </service-assembly>
</jbi>

- The < artifacts-zip> element's text in the previous listing should point
to your service unit zip file, so this is another zip file that should be
contained inside my-first-service-assembly.zip. The specification requires
that you add a descriptor for the service unit as well, but ServiceMix does
not complain if you don't.
  The layout of the files should look like:

  my-first-service-assembly.zip
  |
  |_META-INF
    |_jbi.xml
  |_ my-first-service-unit.zip
    |
    |_META-INF
    |_myprocess.bpel
    |_myservice.wsdl

- I never used hot deployment in ServiceMix, I only use JMX. So if you can
connect to ServiceMix JMX services, you should find the class
org.servicemix.jbi.framework.DeploymentService exposed as an MBean.
Use the method java.lang.String deploy() supplying the full path name of
your service assembly.

- Now if you already implemented ServiceUnitManager interface, your
implementation should be notified by the container that a new service unit
has been deployed. This happens through firing:
public String deploy(String serviceUnitName, String serviceUnitRootPath).
You should be able to read your files here. Notice that you should return a
string explaining the status of the deployment. Have a look at the javadoc
for the exact format of this string, it is an XML message.

- Now that the service unit is deployed, it has to be started. To do so, use
the mentioned MBean again, with the method
java.lang.String start() supplying the name of your service unit. This is
just the name without paths or extensions. You should start executing your
logic here.

Hope this helps,
Hossam Karim
 
-----Original Message-----
From: Charles Souillard [mailto:Charles.Souillard@ext.bull.net] 
Sent: Wednesday, January 18, 2006 6:33 PM
To: servicemix-users@geronimo.apache.org
Subject: ServiceUnit

Hi all,

I have written my first Service Engine (which is not already completed...).
I want to make a service available for the new SE. I think I have to 
deploy a serviceUnit to do that...

Does anybody knows how I can do that ?
Is there any ant task doing this ?

My serviceUnit will contain at least 2 files (one wsdl and one bpel) and 
perhaps some others...

Thanks for your help.
Cheers
Charles