You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by beppe82 <g....@jumpy.it> on 2007/04/04 17:46:55 UTC

help for a novice

Hi all, please help me because it's three days I'm wasting my time into
things that I think are not too difficult (but I can't do that!).
I have a simple SU, written following the tutorial about hello world SE. My
process() method just receive a "in" message, print a phrase (using
System.out.println(...)... can I use this method to write on standard
output?) and sets exchange status to "done". I'd like to use it together
with the ready component ftp-poller... can you write me a step-by-step guide
to do that? I'm not able to integrate, build and deploy this very simple
application... I'm a bit confused about using maven, or using ant, using
servicexml.xml... I don't exactly know what to do! Thank you very much,
Giuseppe
-- 
View this message in context: http://www.nabble.com/help-for-a-novice-tf3526390s12049.html#a9839099
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: help for a novice

Posted by netflexity <mf...@netflexity.com>.
Here is a start.....

1. Create a top level project folder, for example "sample". 
I suggest to give it a meaningful business name, without any abbreviations.

2. Change directory to newly created parent folder.

3. Create Service Engine project (-se suffix) by running the following maven
command:

mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling
-DarchetypeArtifactId=servicemix-service-engine
-DremoteRepositories=http://people.apache.org/maven-snapshot-repository
-DarchetypeVersion=3.1-incubating-SNAPSHOT -DgroupId=com.sample
-DartifactId=sample-se

4. Convert generated Service Engine project to eclipse project by running
the following maven command:

mvn eclipse:eclipse -e

NOTE: Command might fail due to lack of libraries in Maven repository. Add
libraries if necessary.

5. Implement service engine logic.

6. To connect this component to flows, you will need to generate a Service
Unit and configure it with the help of xbean.xml.

7. To enable Java 5, add additional <plugin> to Service Engine project's
pom.xml:

	<plugin>
		<artifactId>maven-compiler-plugin</artifactId>
		<configuration>
			<source>1.5</source>
			<target>1.5</target>
		</configuration>
	</plugin>

8. IMPORTANT, MISSING IN TUTORIALS!!!!!!!Edit Service Engine project's
pom.xml to have <parent> element defined at the top:

	<parent>
		<groupId>org.apache.servicemix</groupId>
		<artifactId>serviceengines</artifactId>
		<version>3.1-incubating</version>
	</parent>
9. Change directory to Service Engine project and run the following maven
command to generate component installer.

mvn clean install

10. Deploy Service Engine by copying generated (in Maven repository)
installer sample-se-installer.zip 
to %SERVICEMIX_HOME%/install directory.


beppe82 wrote:
> 
> Hi all, please help me because it's three days I'm wasting my time into
> things that I think are not too difficult (but I can't do that!).
> I have a simple SU, written following the tutorial about hello world SE.
> My process() method just receive a "in" message, print a phrase (using
> System.out.println(...)... can I use this method to write on standard
> output?) and sets exchange status to "done". I'd like to use it together
> with the ready component ftp-poller... can you write me a step-by-step
> guide to do that? I'm not able to integrate, build and deploy this very
> simple application... I'm a bit confused about using maven, or using ant,
> using servicexml.xml... I don't exactly know what to do! Thank you very
> much, Giuseppe
> 

-- 
View this message in context: http://www.nabble.com/help-for-a-novice-tf3526390s12049.html#a9859809
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: help for a novice

Posted by Gert Vanthienen <ge...@skynet.be>.
Guiseppe,

501 - Connection refused would mean that your FTP server actively 
refused the connection. Try to disable any allow/deny access rules 
you've set...

Gert

beppe82 wrote:
> Thank you so much! Now it deploy successfully, but I can't use the ftp
> component.... it says "ERROR - FtpComponent                   - Caught
> exception while polling: javax.j
> bi.JBIException: org.apache.servicemix.ftp.ConnectionRefusedException:
> Connectio
> n refused with return code: 501"... why can't he connect? The uri in
> xbean.xml is
> uri="ftp://beppe:0000@localhost:21/smx/test". I use TYPSoft FTP Server,
> allowing connections from localhost to a user named beppe with pwd
> 0000...... the server recognise someone is trying to connect, but the
> connection isn't established (it seems).
> thans again, Giuseppe
>
>
> Gert Vanthienen wrote:
>   
>> Guiseppe,
>>
>>
>> Namespaces are used in the XML file to provide context to the elements 
>> and to disambiguate whenever multiple element have the same name, e.g. 
>> jms:endpoint, http:endpoint, ... in the case of servicemix.  Your 
>> xml-elab-su xbean.xml is missing the namespace declaration for your own 
>> service engine.  It should look about like this:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns:beppe="http://giuseppe.org/beppe"
>> xmlns:se="http://namespace/of/your/se">
>>    <se:endpoint service="beppe:xmlelab" endpoint="endpoint"/>
>> </beans> 
>>
>> You can find out your SE's namespace by looking in your source
>> xml-elab-se/target/xbean/xml-elab-se.xsd at the targetNamespace.
>>
>>
>> Next, there is difference in installing the SE and deploying your SA. 
>> Have a look at [1] for a more detailed description of what goes in which
>> directory, but for your project:
>> - you install the SE by copying it to <SERVICEMIX_HOME>/install (in your
>> case, copy xml-elab-se.zip there)
>> - you deploy the SA by copying it to <SERVICEMIX_HOME>deploy (in your
>> case, copy xml-elab-sa.zip there)
>>
>> There is no need to deploy/install the separate service units, as they are
>> already part of your service assembly.  Only copy the two files mentioned
>> above.
>>
>>
>> Gert
>>
>>
>> [1] http://incubator.apache.org/servicemix/6-configuring-servicemix.html
>>
>> beppe82 wrote:
>>     
>>> Hi, so this is my situation: I created a eval-smx folder; under that, I
>>> have
>>> xml-elab-se, created with maven archetype, which just does a
>>> Systtem.out.println() and sends back "done" when it receives a "in"
>>> message;
>>> a xml-elab-su, created with maven, contains the following xbean.xml file
>>> under src/main/resources:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <beans xmlns:beppe="http://giuseppe.org/beppe">
>>>        <endpoint service="beppe:xmlelab" endpoint="endpoint"/>
>>>     </beans> 
>>>
>>> Further, I have a ftp-poller-su which contains the following xbean.xml:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0"
>>> 	xmlns:beppe="http://giuseppe.org/beppe">
>>>         <ftp:poller service="beppe:ftp" endpoint="poller"
>>>                 targetService="beppe:xmlelab" targetEndpoint="endpoint"
>>>                 uri="ftp://localhost" />
>>>     </beans> 
>>>
>>> At the end, I created a SA whit the following pom.xml:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>> http://maven.apache.org/maven-v4_0_0.xsd">
>>>   <modelVersion>4.0.0</modelVersion>
>>>   <groupId>eval.smx</groupId>
>>>   <artifactId>eval-smx-sa</artifactId>
>>>   <packaging>jbi-service-assembly</packaging>
>>>   <version>1.0</version>
>>>   <name>SA per eval-smx</name>
>>>   <url>http://www.myorganization.org</url>
>>>   <pluginRepositories>
>>>     <pluginRepository>
>>>       <id>apache.incubating</id>
>>>       <name>Apache Incubating Repository</name>
>>>       <url>http://people.apache.org/repo/m2-incubating-repository</url>
>>>     </pluginRepository>
>>>   </pluginRepositories>
>>>   <repositories>
>>>     <repository>
>>>       <id>apache.incubating</id>
>>>       <name>Apache Incubating Repository</name>
>>>       <url>http://people.apache.org/repo/m2-incubating-repository</url>
>>>     </repository>
>>>   </repositories>
>>> 	<properties>
>>> 	  <servicemix-version>3.1-incubating</servicemix-version>
>>> 	</properties>
>>>   <dependencies>    
>>>     <dependency>
>>>       <groupId>junit</groupId>
>>>       <artifactId>junit</artifactId>
>>>       <version>3.8.1</version>
>>>       <scope>test</scope>
>>>     </dependency>
>>> 	  <dependency>
>>>       <groupId>eval.smx</groupId>
>>>       <artifactId>xml-elab-su</artifactId>
>>>       <version>1.0</version>
>>>     </dependency>
>>> 	  <dependency>
>>>     <groupId>eval.smx</groupId>
>>>     <artifactId>ftp-poller-su</artifactId>
>>>     <version>1.0</version>
>>>   </dependency>
>>>   </dependencies>
>>>   <build>
>>>     <plugins>
>>>       <plugin>
>>>         <groupId>org.apache.servicemix.tooling</groupId>
>>>         <artifactId>jbi-maven-plugin</artifactId>
>>>         <version>${servicemix-version}</version>      
>>>         <extensions>true</extensions>
>>>         <configuration>
>>>           <type>service-assembly</type>         
>>>         </configuration>
>>>       </plugin>
>>>     </plugins>
>>>   </build>
>>> </project>
>>>
>>> Now, I copied xml-elab-se, xml-elab-su and ftp-poller-su to install
>>> directory under servicemix. I launch servicemix with bin\servicemix and,
>>> from another prompt and under eval-smx-sa directory, I write mvn
>>> jbi:projectDeploy.
>>> Here's what I get:
>>>
>>> ERROR - AutoDeploymentService          - Failed to update Service
>>> Assembly:
>>> eval
>>> -smx-sa
>>> java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>
>>> <jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>>> version="1.0
>>> ">
>>> <jbi-task-result>
>>> <frmwk-task-result>
>>> <frmwk-task-result-details>
>>> <task-result-details>
>>> <task-id>deploy</task-id>
>>> <task-result>FAILED</task-result>
>>> <message-type>ERROR</message-type>
>>> </task-result-details>
>>> </frmwk-task-result-details>
>>> </frmwk-task-result>
>>> <component-task-result
>>> xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>>>   
>>>         <component-name>xml-elab-se</component-name>
>>>         <component-task-result-details>
>>>                 <task-result-details>
>>>                         <task-id>deploy</task-id>
>>>                         <task-result>FAILED</task-result>
>>>                         <message-type>ERROR</message-type>
>>>                         <task-status-msg>
>>> <msg-loc-info>
>>> <loc-token/>
>>> <loc-message>No endpoints found</loc-message>
>>> </msg-loc-info>
>>> </task-status-msg>
>>>                 </task-result-details>
>>>         </component-task-result-details>
>>> </component-task-result>
>>> <component-task-result
>>> xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>>>   
>>>         <component-name>servicemix-ftp</component-name>
>>>         <component-task-result-details>
>>>                 <task-result-details>
>>>                         <task-id>deploy</task-id>
>>>                         <task-result>SUCCESS</task-result>
>>>                 </task-result-details>
>>>         </component-task-result-details>
>>> </component-task-result>
>>> </jbi-task-result>
>>> </jbi-task>
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.ManagementSupport.failure(Managem
>>> entSupport.java:121)
>>>         at
>>> org.apache.servicemix.jbi.framework.ManagementSupport.failure(Managem
>>> entSupport.java:107)
>>>         at
>>> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAs
>>> sembly(DeploymentService.java:563)
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchi
>>> ve(AutoDeploymentService.java:334)
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateExter
>>> nalArchive(AutoDeploymentService.java:201)
>>>         at
>>> org.apache.servicemix.jbi.container.JBIContainer.updateExternalArchiv
>>> e(JBIContainer.java:473)
>>>         at
>>> org.apache.servicemix.jbi.container.JBIContainer.updateExternalArchiv
>>> e(JBIContainer.java:483)
>>>         at
>>> org.apache.servicemix.jbi.framework.AdminCommandsService.deployServic
>>> eAssembly(AdminCommandsService.java:229)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>>> java:39)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>>> sorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>>         at
>>> org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.jav
>>> a:216)
>>>         at
>>> org.apache.servicemix.jbi.management.BaseStandardMBean.invoke(BaseSta
>>> ndardMBean.java:318)
>>>         at
>>> com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImp
>>> l.java:213)
>>>         at
>>> com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
>>>         at
>>> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM
>>> BeanServerInterceptor.java:815)
>>>         at
>>> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784
>>> )
>>>         at
>>> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnecti
>>> onImpl.java:1408)
>>>         at
>>> javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectio
>>> nImpl.java:81)
>>>         at
>>> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run
>>> (RMIConnectionImpl.java:1245)
>>>         at java.security.AccessController.doPrivileged(Native Method)
>>>         at
>>> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(R
>>> MIConnectionImpl.java:1348)
>>>         at
>>> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImp
>>> l.java:782)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>>> java:39)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>>> sorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>>         at
>>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
>>>         at sun.rmi.transport.Transport$1.run(Transport.java:153)
>>>         at java.security.AccessController.doPrivileged(Native Method)
>>>         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
>>>         at
>>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
>>> 60)
>>>         at
>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
>>> .java:701)
>>>         at java.lang.Thread.run(Thread.java:595)
>>>
>>> What happens? Thanks for the patience...
>>>
>>> P.S.: Can you also explain me how to use xml namespaces, please?
>>>
>>>
>>>
>>> Gert Vanthienen wrote:
>>>   
>>>       
>>>> You have to add an xbean.xml file to your service unit project, to 
>>>> describe the configuration for your service unit.  Add an xbean.xml file 
>>>> to hello-world-su/src/main/resources with this contents and rebuild the 
>>>> project.
>>>>     <beans 
>>>> xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0" 
>>>> xmlns:beppe="http://guiseppe.org">
>>>>        <hello:endpoint service="beppe:service" endpoint="endpoint"/>
>>>>     </beans>
>>>>
>>>> Now, create a second service unit project, now containing this
>>>> xbean.xml:
>>>>     <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0" 
>>>> xmlns:beppe="http://guiseppe.org">
>>>>         <ftp:poller service="beppe:ftp" endpoint="poller"
>>>>                 targetService="beppe:service" targetEndpoint="endpoint"
>>>>                 uri="ftp://anonymous:nemonemini@localhost" />
>>>>     </beans>
>>>>
>>>>
>>>> beppe82 wrote:
>>>>     
>>>>         
>>>>> Hi all, please help me because it's three days I'm wasting my time into
>>>>> things that I think are not too difficult (but I can't do that!).
>>>>> I have a simple SU, written following the tutorial about hello world
>>>>> SE.
>>>>> My
>>>>> process() method just receive a "in" message, print a phrase (using
>>>>> System.out.println(...)... can I use this method to write on standard
>>>>> output?) and sets exchange status to "done". I'd like to use it
>>>>> together
>>>>> with the ready component ftp-poller... can you write me a step-by-step
>>>>> guide
>>>>> to do that? I'm not able to integrate, build and deploy this very
>>>>> simple
>>>>> application... I'm a bit confused about using maven, or using ant,
>>>>> using
>>>>> servicexml.xml... I don't exactly know what to do! Thank you very much,
>>>>> Giuseppe
>>>>>   
>>>>>       
>>>>>           
>>>>     
>>>>         
>>>   
>>>       
>>
>>     
>
>   


Re: help for a novice

Posted by beppe82 <g....@jumpy.it>.
Thank you so much! Now it deploy successfully, but I can't use the ftp
component.... it says "ERROR - FtpComponent                   - Caught
exception while polling: javax.j
bi.JBIException: org.apache.servicemix.ftp.ConnectionRefusedException:
Connectio
n refused with return code: 501"... why can't he connect? The uri in
xbean.xml is
uri="ftp://beppe:0000@localhost:21/smx/test". I use TYPSoft FTP Server,
allowing connections from localhost to a user named beppe with pwd
0000...... the server recognise someone is trying to connect, but the
connection isn't established (it seems).
thans again, Giuseppe


Gert Vanthienen wrote:
> 
> Guiseppe,
> 
> 
> Namespaces are used in the XML file to provide context to the elements 
> and to disambiguate whenever multiple element have the same name, e.g. 
> jms:endpoint, http:endpoint, ... in the case of servicemix.  Your 
> xml-elab-su xbean.xml is missing the namespace declaration for your own 
> service engine.  It should look about like this:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:beppe="http://giuseppe.org/beppe"
> xmlns:se="http://namespace/of/your/se">
>    <se:endpoint service="beppe:xmlelab" endpoint="endpoint"/>
> </beans> 
> 
> You can find out your SE's namespace by looking in your source
> xml-elab-se/target/xbean/xml-elab-se.xsd at the targetNamespace.
> 
> 
> Next, there is difference in installing the SE and deploying your SA. 
> Have a look at [1] for a more detailed description of what goes in which
> directory, but for your project:
> - you install the SE by copying it to <SERVICEMIX_HOME>/install (in your
> case, copy xml-elab-se.zip there)
> - you deploy the SA by copying it to <SERVICEMIX_HOME>deploy (in your
> case, copy xml-elab-sa.zip there)
> 
> There is no need to deploy/install the separate service units, as they are
> already part of your service assembly.  Only copy the two files mentioned
> above.
> 
> 
> Gert
> 
> 
> [1] http://incubator.apache.org/servicemix/6-configuring-servicemix.html
> 
> beppe82 wrote:
>> Hi, so this is my situation: I created a eval-smx folder; under that, I
>> have
>> xml-elab-se, created with maven archetype, which just does a
>> Systtem.out.println() and sends back "done" when it receives a "in"
>> message;
>> a xml-elab-su, created with maven, contains the following xbean.xml file
>> under src/main/resources:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns:beppe="http://giuseppe.org/beppe">
>>        <endpoint service="beppe:xmlelab" endpoint="endpoint"/>
>>     </beans> 
>>
>> Further, I have a ftp-poller-su which contains the following xbean.xml:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0"
>> 	xmlns:beppe="http://giuseppe.org/beppe">
>>         <ftp:poller service="beppe:ftp" endpoint="poller"
>>                 targetService="beppe:xmlelab" targetEndpoint="endpoint"
>>                 uri="ftp://localhost" />
>>     </beans> 
>>
>> At the end, I created a SA whit the following pom.xml:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>> http://maven.apache.org/maven-v4_0_0.xsd">
>>   <modelVersion>4.0.0</modelVersion>
>>   <groupId>eval.smx</groupId>
>>   <artifactId>eval-smx-sa</artifactId>
>>   <packaging>jbi-service-assembly</packaging>
>>   <version>1.0</version>
>>   <name>SA per eval-smx</name>
>>   <url>http://www.myorganization.org</url>
>>   <pluginRepositories>
>>     <pluginRepository>
>>       <id>apache.incubating</id>
>>       <name>Apache Incubating Repository</name>
>>       <url>http://people.apache.org/repo/m2-incubating-repository</url>
>>     </pluginRepository>
>>   </pluginRepositories>
>>   <repositories>
>>     <repository>
>>       <id>apache.incubating</id>
>>       <name>Apache Incubating Repository</name>
>>       <url>http://people.apache.org/repo/m2-incubating-repository</url>
>>     </repository>
>>   </repositories>
>> 	<properties>
>> 	  <servicemix-version>3.1-incubating</servicemix-version>
>> 	</properties>
>>   <dependencies>    
>>     <dependency>
>>       <groupId>junit</groupId>
>>       <artifactId>junit</artifactId>
>>       <version>3.8.1</version>
>>       <scope>test</scope>
>>     </dependency>
>> 	  <dependency>
>>       <groupId>eval.smx</groupId>
>>       <artifactId>xml-elab-su</artifactId>
>>       <version>1.0</version>
>>     </dependency>
>> 	  <dependency>
>>     <groupId>eval.smx</groupId>
>>     <artifactId>ftp-poller-su</artifactId>
>>     <version>1.0</version>
>>   </dependency>
>>   </dependencies>
>>   <build>
>>     <plugins>
>>       <plugin>
>>         <groupId>org.apache.servicemix.tooling</groupId>
>>         <artifactId>jbi-maven-plugin</artifactId>
>>         <version>${servicemix-version}</version>      
>>         <extensions>true</extensions>
>>         <configuration>
>>           <type>service-assembly</type>         
>>         </configuration>
>>       </plugin>
>>     </plugins>
>>   </build>
>> </project>
>>
>> Now, I copied xml-elab-se, xml-elab-su and ftp-poller-su to install
>> directory under servicemix. I launch servicemix with bin\servicemix and,
>> from another prompt and under eval-smx-sa directory, I write mvn
>> jbi:projectDeploy.
>> Here's what I get:
>>
>> ERROR - AutoDeploymentService          - Failed to update Service
>> Assembly:
>> eval
>> -smx-sa
>> java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>
>> <jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>> version="1.0
>> ">
>> <jbi-task-result>
>> <frmwk-task-result>
>> <frmwk-task-result-details>
>> <task-result-details>
>> <task-id>deploy</task-id>
>> <task-result>FAILED</task-result>
>> <message-type>ERROR</message-type>
>> </task-result-details>
>> </frmwk-task-result-details>
>> </frmwk-task-result>
>> <component-task-result
>> xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>>   
>>         <component-name>xml-elab-se</component-name>
>>         <component-task-result-details>
>>                 <task-result-details>
>>                         <task-id>deploy</task-id>
>>                         <task-result>FAILED</task-result>
>>                         <message-type>ERROR</message-type>
>>                         <task-status-msg>
>> <msg-loc-info>
>> <loc-token/>
>> <loc-message>No endpoints found</loc-message>
>> </msg-loc-info>
>> </task-status-msg>
>>                 </task-result-details>
>>         </component-task-result-details>
>> </component-task-result>
>> <component-task-result
>> xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>>   
>>         <component-name>servicemix-ftp</component-name>
>>         <component-task-result-details>
>>                 <task-result-details>
>>                         <task-id>deploy</task-id>
>>                         <task-result>SUCCESS</task-result>
>>                 </task-result-details>
>>         </component-task-result-details>
>> </component-task-result>
>> </jbi-task-result>
>> </jbi-task>
>>
>>         at
>> org.apache.servicemix.jbi.framework.ManagementSupport.failure(Managem
>> entSupport.java:121)
>>         at
>> org.apache.servicemix.jbi.framework.ManagementSupport.failure(Managem
>> entSupport.java:107)
>>         at
>> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAs
>> sembly(DeploymentService.java:563)
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchi
>> ve(AutoDeploymentService.java:334)
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateExter
>> nalArchive(AutoDeploymentService.java:201)
>>         at
>> org.apache.servicemix.jbi.container.JBIContainer.updateExternalArchiv
>> e(JBIContainer.java:473)
>>         at
>> org.apache.servicemix.jbi.container.JBIContainer.updateExternalArchiv
>> e(JBIContainer.java:483)
>>         at
>> org.apache.servicemix.jbi.framework.AdminCommandsService.deployServic
>> eAssembly(AdminCommandsService.java:229)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>> java:39)
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> sorImpl.java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>         at
>> org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.jav
>> a:216)
>>         at
>> org.apache.servicemix.jbi.management.BaseStandardMBean.invoke(BaseSta
>> ndardMBean.java:318)
>>         at
>> com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImp
>> l.java:213)
>>         at
>> com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
>>         at
>> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM
>> BeanServerInterceptor.java:815)
>>         at
>> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784
>> )
>>         at
>> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnecti
>> onImpl.java:1408)
>>         at
>> javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectio
>> nImpl.java:81)
>>         at
>> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run
>> (RMIConnectionImpl.java:1245)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at
>> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(R
>> MIConnectionImpl.java:1348)
>>         at
>> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImp
>> l.java:782)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>> java:39)
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> sorImpl.java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>         at
>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
>>         at sun.rmi.transport.Transport$1.run(Transport.java:153)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
>>         at
>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
>> 60)
>>         at
>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
>> .java:701)
>>         at java.lang.Thread.run(Thread.java:595)
>>
>> What happens? Thanks for the patience...
>>
>> P.S.: Can you also explain me how to use xml namespaces, please?
>>
>>
>>
>> Gert Vanthienen wrote:
>>   
>>> You have to add an xbean.xml file to your service unit project, to 
>>> describe the configuration for your service unit.  Add an xbean.xml file 
>>> to hello-world-su/src/main/resources with this contents and rebuild the 
>>> project.
>>>     <beans 
>>> xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0" 
>>> xmlns:beppe="http://guiseppe.org">
>>>        <hello:endpoint service="beppe:service" endpoint="endpoint"/>
>>>     </beans>
>>>
>>> Now, create a second service unit project, now containing this
>>> xbean.xml:
>>>     <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0" 
>>> xmlns:beppe="http://guiseppe.org">
>>>         <ftp:poller service="beppe:ftp" endpoint="poller"
>>>                 targetService="beppe:service" targetEndpoint="endpoint"
>>>                 uri="ftp://anonymous:nemonemini@localhost" />
>>>     </beans>
>>>
>>>
>>> beppe82 wrote:
>>>     
>>>> Hi all, please help me because it's three days I'm wasting my time into
>>>> things that I think are not too difficult (but I can't do that!).
>>>> I have a simple SU, written following the tutorial about hello world
>>>> SE.
>>>> My
>>>> process() method just receive a "in" message, print a phrase (using
>>>> System.out.println(...)... can I use this method to write on standard
>>>> output?) and sets exchange status to "done". I'd like to use it
>>>> together
>>>> with the ready component ftp-poller... can you write me a step-by-step
>>>> guide
>>>> to do that? I'm not able to integrate, build and deploy this very
>>>> simple
>>>> application... I'm a bit confused about using maven, or using ant,
>>>> using
>>>> servicexml.xml... I don't exactly know what to do! Thank you very much,
>>>> Giuseppe
>>>>   
>>>>       
>>>
>>>     
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/help-for-a-novice-tf3526390s12049.html#a9858557
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: help for a novice

Posted by Gert Vanthienen <ge...@skynet.be>.
Guiseppe,


Namespaces are used in the XML file to provide context to the elements 
and to disambiguate whenever multiple element have the same name, e.g. 
jms:endpoint, http:endpoint, ... in the case of servicemix.  Your 
xml-elab-su xbean.xml is missing the namespace declaration for your own 
service engine.  It should look about like this:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:beppe="http://giuseppe.org/beppe" xmlns:se="http://namespace/of/your/se">
   <se:endpoint service="beppe:xmlelab" endpoint="endpoint"/>
</beans> 

You can find out your SE's namespace by looking in your source xml-elab-se/target/xbean/xml-elab-se.xsd at the targetNamespace.


Next, there is difference in installing the SE and deploying your SA.  Have a look at [1] for a more detailed description of what goes in which directory, but for your project:
- you install the SE by copying it to <SERVICEMIX_HOME>/install (in your case, copy xml-elab-se.zip there)
- you deploy the SA by copying it to <SERVICEMIX_HOME>deploy (in your case, copy xml-elab-sa.zip there)

There is no need to deploy/install the separate service units, as they are already part of your service assembly.  Only copy the two files mentioned above.


Gert


[1] http://incubator.apache.org/servicemix/6-configuring-servicemix.html

beppe82 wrote:
> Hi, so this is my situation: I created a eval-smx folder; under that, I have
> xml-elab-se, created with maven archetype, which just does a
> Systtem.out.println() and sends back "done" when it receives a "in" message;
> a xml-elab-su, created with maven, contains the following xbean.xml file
> under src/main/resources:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:beppe="http://giuseppe.org/beppe">
>        <endpoint service="beppe:xmlelab" endpoint="endpoint"/>
>     </beans> 
>
> Further, I have a ftp-poller-su which contains the following xbean.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0"
> 	xmlns:beppe="http://giuseppe.org/beppe">
>         <ftp:poller service="beppe:ftp" endpoint="poller"
>                 targetService="beppe:xmlelab" targetEndpoint="endpoint"
>                 uri="ftp://localhost" />
>     </beans> 
>
> At the end, I created a SA whit the following pom.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>eval.smx</groupId>
>   <artifactId>eval-smx-sa</artifactId>
>   <packaging>jbi-service-assembly</packaging>
>   <version>1.0</version>
>   <name>SA per eval-smx</name>
>   <url>http://www.myorganization.org</url>
>   <pluginRepositories>
>     <pluginRepository>
>       <id>apache.incubating</id>
>       <name>Apache Incubating Repository</name>
>       <url>http://people.apache.org/repo/m2-incubating-repository</url>
>     </pluginRepository>
>   </pluginRepositories>
>   <repositories>
>     <repository>
>       <id>apache.incubating</id>
>       <name>Apache Incubating Repository</name>
>       <url>http://people.apache.org/repo/m2-incubating-repository</url>
>     </repository>
>   </repositories>
> 	<properties>
> 	  <servicemix-version>3.1-incubating</servicemix-version>
> 	</properties>
>   <dependencies>    
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>       <scope>test</scope>
>     </dependency>
> 	  <dependency>
>       <groupId>eval.smx</groupId>
>       <artifactId>xml-elab-su</artifactId>
>       <version>1.0</version>
>     </dependency>
> 	  <dependency>
>     <groupId>eval.smx</groupId>
>     <artifactId>ftp-poller-su</artifactId>
>     <version>1.0</version>
>   </dependency>
>   </dependencies>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.servicemix.tooling</groupId>
>         <artifactId>jbi-maven-plugin</artifactId>
>         <version>${servicemix-version}</version>      
>         <extensions>true</extensions>
>         <configuration>
>           <type>service-assembly</type>         
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
> </project>
>
> Now, I copied xml-elab-se, xml-elab-su and ftp-poller-su to install
> directory under servicemix. I launch servicemix with bin\servicemix and,
> from another prompt and under eval-smx-sa directory, I write mvn
> jbi:projectDeploy.
> Here's what I get:
>
> ERROR - AutoDeploymentService          - Failed to update Service Assembly:
> eval
> -smx-sa
> java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>
> <jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message"
> version="1.0
> ">
> <jbi-task-result>
> <frmwk-task-result>
> <frmwk-task-result-details>
> <task-result-details>
> <task-id>deploy</task-id>
> <task-result>FAILED</task-result>
> <message-type>ERROR</message-type>
> </task-result-details>
> </frmwk-task-result-details>
> </frmwk-task-result>
> <component-task-result
> xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>   
>         <component-name>xml-elab-se</component-name>
>         <component-task-result-details>
>                 <task-result-details>
>                         <task-id>deploy</task-id>
>                         <task-result>FAILED</task-result>
>                         <message-type>ERROR</message-type>
>                         <task-status-msg>
> <msg-loc-info>
> <loc-token/>
> <loc-message>No endpoints found</loc-message>
> </msg-loc-info>
> </task-status-msg>
>                 </task-result-details>
>         </component-task-result-details>
> </component-task-result>
> <component-task-result
> xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>   
>         <component-name>servicemix-ftp</component-name>
>         <component-task-result-details>
>                 <task-result-details>
>                         <task-id>deploy</task-id>
>                         <task-result>SUCCESS</task-result>
>                 </task-result-details>
>         </component-task-result-details>
> </component-task-result>
> </jbi-task-result>
> </jbi-task>
>
>         at
> org.apache.servicemix.jbi.framework.ManagementSupport.failure(Managem
> entSupport.java:121)
>         at
> org.apache.servicemix.jbi.framework.ManagementSupport.failure(Managem
> entSupport.java:107)
>         at
> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAs
> sembly(DeploymentService.java:563)
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchi
> ve(AutoDeploymentService.java:334)
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateExter
> nalArchive(AutoDeploymentService.java:201)
>         at
> org.apache.servicemix.jbi.container.JBIContainer.updateExternalArchiv
> e(JBIContainer.java:473)
>         at
> org.apache.servicemix.jbi.container.JBIContainer.updateExternalArchiv
> e(JBIContainer.java:483)
>         at
> org.apache.servicemix.jbi.framework.AdminCommandsService.deployServic
> eAssembly(AdminCommandsService.java:229)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.jav
> a:216)
>         at
> org.apache.servicemix.jbi.management.BaseStandardMBean.invoke(BaseSta
> ndardMBean.java:318)
>         at
> com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImp
> l.java:213)
>         at
> com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
>         at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM
> BeanServerInterceptor.java:815)
>         at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784
> )
>         at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnecti
> onImpl.java:1408)
>         at
> javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectio
> nImpl.java:81)
>         at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run
> (RMIConnectionImpl.java:1245)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(R
> MIConnectionImpl.java:1348)
>         at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImp
> l.java:782)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
>         at sun.rmi.transport.Transport$1.run(Transport.java:153)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
>         at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
> 60)
>         at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
> .java:701)
>         at java.lang.Thread.run(Thread.java:595)
>
> What happens? Thanks for the patience...
>
> P.S.: Can you also explain me how to use xml namespaces, please?
>
>
>
> Gert Vanthienen wrote:
>   
>> You have to add an xbean.xml file to your service unit project, to 
>> describe the configuration for your service unit.  Add an xbean.xml file 
>> to hello-world-su/src/main/resources with this contents and rebuild the 
>> project.
>>     <beans 
>> xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0" 
>> xmlns:beppe="http://guiseppe.org">
>>        <hello:endpoint service="beppe:service" endpoint="endpoint"/>
>>     </beans>
>>
>> Now, create a second service unit project, now containing this xbean.xml:
>>     <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0" 
>> xmlns:beppe="http://guiseppe.org">
>>         <ftp:poller service="beppe:ftp" endpoint="poller"
>>                 targetService="beppe:service" targetEndpoint="endpoint"
>>                 uri="ftp://anonymous:nemonemini@localhost" />
>>     </beans>
>>
>>
>> beppe82 wrote:
>>     
>>> Hi all, please help me because it's three days I'm wasting my time into
>>> things that I think are not too difficult (but I can't do that!).
>>> I have a simple SU, written following the tutorial about hello world SE.
>>> My
>>> process() method just receive a "in" message, print a phrase (using
>>> System.out.println(...)... can I use this method to write on standard
>>> output?) and sets exchange status to "done". I'd like to use it together
>>> with the ready component ftp-poller... can you write me a step-by-step
>>> guide
>>> to do that? I'm not able to integrate, build and deploy this very simple
>>> application... I'm a bit confused about using maven, or using ant, using
>>> servicexml.xml... I don't exactly know what to do! Thank you very much,
>>> Giuseppe
>>>   
>>>       
>>
>>     
>
>   


extending FileMarshaler

Posted by beppe82 <g....@jumpy.it>.
Now, I would like to extend FileMarshaler to make ftp-poller-su able to read
arbitrary files. Where should I place the java code of my class? Can I
create another SU so to reuse it as a stand alone component? I doubt of this
because I read that ftp-poller's "marshaler" property must be "class"...
what do you suggest me?
Thanks


beppe82 wrote:
> 
> Hi, so this is my situation: I created a eval-smx folder; under that, I
> have xml-elab-se, created with maven archetype, which just does a
> Systtem.out.println() and sends back "done" when it receives a "in"
> message; a xml-elab-su, created with maven, contains the following
> xbean.xml file under src/main/resources:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:beppe="http://giuseppe.org/beppe">
>        <endpoint service="beppe:xmlelab" endpoint="endpoint"/>
>     </beans> 
> 
> Further, I have a ftp-poller-su which contains the following xbean.xml:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0"
> 	xmlns:beppe="http://giuseppe.org/beppe">
>         <ftp:poller service="beppe:ftp" endpoint="poller"
>                 targetService="beppe:xmlelab" targetEndpoint="endpoint"
>                 uri="ftp://localhost" />
>     </beans> 
> 
> At the end, I created a SA whit the following pom.xml:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>eval.smx</groupId>
>   <artifactId>eval-smx-sa</artifactId>
>   <packaging>jbi-service-assembly</packaging>
>   <version>1.0</version>
>   <name>SA per eval-smx</name>
>   <url>http://www.myorganization.org</url>
>   <pluginRepositories>
>     <pluginRepository>
>       <id>apache.incubating</id>
>       <name>Apache Incubating Repository</name>
>       <url>http://people.apache.org/repo/m2-incubating-repository</url>
>     </pluginRepository>
>   </pluginRepositories>
>   <repositories>
>     <repository>
>       <id>apache.incubating</id>
>       <name>Apache Incubating Repository</name>
>       <url>http://people.apache.org/repo/m2-incubating-repository</url>
>     </repository>
>   </repositories>
> 	<properties>
> 	  <servicemix-version>3.1-incubating</servicemix-version>
> 	</properties>
>   <dependencies>    
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>       <scope>test</scope>
>     </dependency>
> 	  <dependency>
>       <groupId>eval.smx</groupId>
>       <artifactId>xml-elab-su</artifactId>
>       <version>1.0</version>
>     </dependency>
> 	  <dependency>
>     <groupId>eval.smx</groupId>
>     <artifactId>ftp-poller-su</artifactId>
>     <version>1.0</version>
>   </dependency>
>   </dependencies>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.servicemix.tooling</groupId>
>         <artifactId>jbi-maven-plugin</artifactId>
>         <version>${servicemix-version}</version>      
>         <extensions>true</extensions>
>         <configuration>
>           <type>service-assembly</type>         
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
> </project>
> 
> Now, I copied xml-elab-se, xml-elab-su and ftp-poller-su to install
> directory under servicemix. I launch servicemix with bin\servicemix and,
> from another prompt and under eval-smx-sa directory, I write mvn
> jbi:projectDeploy.
> Here's what I get:
> 
> ERROR - AutoDeploymentService          - Failed to update Service
> Assembly: eval
> -smx-sa
> java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>
> <jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message"
> version="1.0
> ">
> <jbi-task-result>
> <frmwk-task-result>
> <frmwk-task-result-details>
> <task-result-details>
> <task-id>deploy</task-id>
> <task-result>FAILED</task-result>
> <message-type>ERROR</message-type>
> </task-result-details>
> </frmwk-task-result-details>
> </frmwk-task-result>
> <component-task-result
> xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>>
>         <component-name>xml-elab-se</component-name>
>         <component-task-result-details>
>                 <task-result-details>
>                         <task-id>deploy</task-id>
>                         <task-result>FAILED</task-result>
>                         <message-type>ERROR</message-type>
>                         <task-status-msg>
> <msg-loc-info>
> <loc-token/>
> <loc-message>No endpoints found</loc-message>
> </msg-loc-info>
> </task-status-msg>
>                 </task-result-details>
>         </component-task-result-details>
> </component-task-result>
> <component-task-result
> xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>>
>         <component-name>servicemix-ftp</component-name>
>         <component-task-result-details>
>                 <task-result-details>
>                         <task-id>deploy</task-id>
>                         <task-result>SUCCESS</task-result>
>                 </task-result-details>
>         </component-task-result-details>
> </component-task-result>
> </jbi-task-result>
> </jbi-task>
> 
>         at
> org.apache.servicemix.jbi.framework.ManagementSupport.failure(Managem
> entSupport.java:121)
>         at
> org.apache.servicemix.jbi.framework.ManagementSupport.failure(Managem
> entSupport.java:107)
>         at
> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAs
> sembly(DeploymentService.java:563)
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchi
> ve(AutoDeploymentService.java:334)
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateExter
> nalArchive(AutoDeploymentService.java:201)
>         at
> org.apache.servicemix.jbi.container.JBIContainer.updateExternalArchiv
> e(JBIContainer.java:473)
>         at
> org.apache.servicemix.jbi.container.JBIContainer.updateExternalArchiv
> e(JBIContainer.java:483)
>         at
> org.apache.servicemix.jbi.framework.AdminCommandsService.deployServic
> eAssembly(AdminCommandsService.java:229)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.jav
> a:216)
>         at
> org.apache.servicemix.jbi.management.BaseStandardMBean.invoke(BaseSta
> ndardMBean.java:318)
>         at
> com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImp
> l.java:213)
>         at
> com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
>         at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM
> BeanServerInterceptor.java:815)
>         at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784
> )
>         at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnecti
> onImpl.java:1408)
>         at
> javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectio
> nImpl.java:81)
>         at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run
> (RMIConnectionImpl.java:1245)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(R
> MIConnectionImpl.java:1348)
>         at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImp
> l.java:782)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
>         at sun.rmi.transport.Transport$1.run(Transport.java:153)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
>         at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
> 60)
>         at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
> .java:701)
>         at java.lang.Thread.run(Thread.java:595)
> 
> What happens? Thanks for the patience...
> 
> P.S.: Can you also explain me how to use xml namespaces, please?
> 
> 
> 
> Gert Vanthienen wrote:
>> 
>> You have to add an xbean.xml file to your service unit project, to 
>> describe the configuration for your service unit.  Add an xbean.xml file 
>> to hello-world-su/src/main/resources with this contents and rebuild the 
>> project.
>>     <beans 
>> xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0" 
>> xmlns:beppe="http://guiseppe.org">
>>        <hello:endpoint service="beppe:service" endpoint="endpoint"/>
>>     </beans>
>> 
>> Now, create a second service unit project, now containing this xbean.xml:
>>     <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0" 
>> xmlns:beppe="http://guiseppe.org">
>>         <ftp:poller service="beppe:ftp" endpoint="poller"
>>                 targetService="beppe:service" targetEndpoint="endpoint"
>>                 uri="ftp://anonymous:nemonemini@localhost" />
>>     </beans>
>> 
>> 
>> beppe82 wrote:
>>> Hi all, please help me because it's three days I'm wasting my time into
>>> things that I think are not too difficult (but I can't do that!).
>>> I have a simple SU, written following the tutorial about hello world SE.
>>> My
>>> process() method just receive a "in" message, print a phrase (using
>>> System.out.println(...)... can I use this method to write on standard
>>> output?) and sets exchange status to "done". I'd like to use it together
>>> with the ready component ftp-poller... can you write me a step-by-step
>>> guide
>>> to do that? I'm not able to integrate, build and deploy this very simple
>>> application... I'm a bit confused about using maven, or using ant, using
>>> servicexml.xml... I don't exactly know what to do! Thank you very much,
>>> Giuseppe
>>>   
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/help-for-a-novice-tf3526390s12049.html#a9884477
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: help for a novice

Posted by beppe82 <g....@jumpy.it>.
Hi, so this is my situation: I created a eval-smx folder; under that, I have
xml-elab-se, created with maven archetype, which just does a
Systtem.out.println() and sends back "done" when it receives a "in" message;
a xml-elab-su, created with maven, contains the following xbean.xml file
under src/main/resources:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:beppe="http://giuseppe.org/beppe">
       <endpoint service="beppe:xmlelab" endpoint="endpoint"/>
    </beans> 

Further, I have a ftp-poller-su which contains the following xbean.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0"
	xmlns:beppe="http://giuseppe.org/beppe">
        <ftp:poller service="beppe:ftp" endpoint="poller"
                targetService="beppe:xmlelab" targetEndpoint="endpoint"
                uri="ftp://localhost" />
    </beans> 

At the end, I created a SA whit the following pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>eval.smx</groupId>
  <artifactId>eval-smx-sa</artifactId>
  <packaging>jbi-service-assembly</packaging>
  <version>1.0</version>
  <name>SA per eval-smx</name>
  <url>http://www.myorganization.org</url>
  <pluginRepositories>
    <pluginRepository>
      <id>apache.incubating</id>
      <name>Apache Incubating Repository</name>
      <url>http://people.apache.org/repo/m2-incubating-repository</url>
    </pluginRepository>
  </pluginRepositories>
  <repositories>
    <repository>
      <id>apache.incubating</id>
      <name>Apache Incubating Repository</name>
      <url>http://people.apache.org/repo/m2-incubating-repository</url>
    </repository>
  </repositories>
	<properties>
	  <servicemix-version>3.1-incubating</servicemix-version>
	</properties>
  <dependencies>    
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
	  <dependency>
      <groupId>eval.smx</groupId>
      <artifactId>xml-elab-su</artifactId>
      <version>1.0</version>
    </dependency>
	  <dependency>
    <groupId>eval.smx</groupId>
    <artifactId>ftp-poller-su</artifactId>
    <version>1.0</version>
  </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.servicemix.tooling</groupId>
        <artifactId>jbi-maven-plugin</artifactId>
        <version>${servicemix-version}</version>      
        <extensions>true</extensions>
        <configuration>
          <type>service-assembly</type>         
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

Now, I copied xml-elab-se, xml-elab-su and ftp-poller-su to install
directory under servicemix. I launch servicemix with bin\servicemix and,
from another prompt and under eval-smx-sa directory, I write mvn
jbi:projectDeploy.
Here's what I get:

ERROR - AutoDeploymentService          - Failed to update Service Assembly:
eval
-smx-sa
java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>
<jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message"
version="1.0
">
<jbi-task-result>
<frmwk-task-result>
<frmwk-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
</task-result-details>
</frmwk-task-result-details>
</frmwk-task-result>
<component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>
        <component-name>xml-elab-se</component-name>
        <component-task-result-details>
                <task-result-details>
                        <task-id>deploy</task-id>
                        <task-result>FAILED</task-result>
                        <message-type>ERROR</message-type>
                        <task-status-msg>
<msg-loc-info>
<loc-token/>
<loc-message>No endpoints found</loc-message>
</msg-loc-info>
</task-status-msg>
                </task-result-details>
        </component-task-result-details>
</component-task-result>
<component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>
        <component-name>servicemix-ftp</component-name>
        <component-task-result-details>
                <task-result-details>
                        <task-id>deploy</task-id>
                        <task-result>SUCCESS</task-result>
                </task-result-details>
        </component-task-result-details>
</component-task-result>
</jbi-task-result>
</jbi-task>

        at
org.apache.servicemix.jbi.framework.ManagementSupport.failure(Managem
entSupport.java:121)
        at
org.apache.servicemix.jbi.framework.ManagementSupport.failure(Managem
entSupport.java:107)
        at
org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAs
sembly(DeploymentService.java:563)
        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchi
ve(AutoDeploymentService.java:334)
        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateExter
nalArchive(AutoDeploymentService.java:201)
        at
org.apache.servicemix.jbi.container.JBIContainer.updateExternalArchiv
e(JBIContainer.java:473)
        at
org.apache.servicemix.jbi.container.JBIContainer.updateExternalArchiv
e(JBIContainer.java:483)
        at
org.apache.servicemix.jbi.framework.AdminCommandsService.deployServic
eAssembly(AdminCommandsService.java:229)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.jav
a:216)
        at
org.apache.servicemix.jbi.management.BaseStandardMBean.invoke(BaseSta
ndardMBean.java:318)
        at
com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImp
l.java:213)
        at
com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
        at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM
BeanServerInterceptor.java:815)
        at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784
)
        at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnecti
onImpl.java:1408)
        at
javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectio
nImpl.java:81)
        at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run
(RMIConnectionImpl.java:1245)
        at java.security.AccessController.doPrivileged(Native Method)
        at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(R
MIConnectionImpl.java:1348)
        at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImp
l.java:782)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
        at sun.rmi.transport.Transport$1.run(Transport.java:153)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
        at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
60)
        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:701)
        at java.lang.Thread.run(Thread.java:595)

What happens? Thanks for the patience...

P.S.: Can you also explain me how to use xml namespaces, please?



Gert Vanthienen wrote:
> 
> You have to add an xbean.xml file to your service unit project, to 
> describe the configuration for your service unit.  Add an xbean.xml file 
> to hello-world-su/src/main/resources with this contents and rebuild the 
> project.
>     <beans 
> xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0" 
> xmlns:beppe="http://guiseppe.org">
>        <hello:endpoint service="beppe:service" endpoint="endpoint"/>
>     </beans>
> 
> Now, create a second service unit project, now containing this xbean.xml:
>     <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0" 
> xmlns:beppe="http://guiseppe.org">
>         <ftp:poller service="beppe:ftp" endpoint="poller"
>                 targetService="beppe:service" targetEndpoint="endpoint"
>                 uri="ftp://anonymous:nemonemini@localhost" />
>     </beans>
> 
> 
> beppe82 wrote:
>> Hi all, please help me because it's three days I'm wasting my time into
>> things that I think are not too difficult (but I can't do that!).
>> I have a simple SU, written following the tutorial about hello world SE.
>> My
>> process() method just receive a "in" message, print a phrase (using
>> System.out.println(...)... can I use this method to write on standard
>> output?) and sets exchange status to "done". I'd like to use it together
>> with the ready component ftp-poller... can you write me a step-by-step
>> guide
>> to do that? I'm not able to integrate, build and deploy this very simple
>> application... I'm a bit confused about using maven, or using ant, using
>> servicexml.xml... I don't exactly know what to do! Thank you very much,
>> Giuseppe
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/help-for-a-novice-tf3526390s12049.html#a9854240
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: help for a novice

Posted by beppe82 <g....@jumpy.it>.
Thanks again... and which is the difference? I mean, using SU/SA permit not
to modify default configuration of the container, while creating
servicemix.xml permit not to create SU/SA; but it's just a matter of what a
developer prefer? Can I say "I prefer creating SU/SA, I'm going to use
always that method!"?


Gert Vanthienen wrote:
> 
> Guiseppe,
> 
> For a static configuration, you should create and install the SE as you 
> did before.  Then, instead of creating SA/SU archive, you add the 
> necessary configuration directory to conf/servicemix.xml.  On [1], you 
> can see how to add the ftp element to the <sm:activationSpecs/>.  The 
> syntax for your own SE would be similar, just using another namespace.
> 
> For the goal you're trying to achieve (file from FTP -> handle message 
> in java code), you could also build a servicemix-lwcontainer SU.  The SU 
> is configured using a servicemix.xml file instead of an xbean .xml file 
> (the syntax is shown at [2]. Have a look at [3] for an example on the 
> POJO class.  If you use this approach, you do not need to build a 
> separate SE and install it, only a SA is required (because you only use 
> components that come out-of-the-box, together with ServiceMix).
> 
> Gert
> 
> [1] 
> http://svn.apache.org/repos/asf/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-ftp/src/test/resources/spring.xml 
> 
> [2] http://incubator.apache.org/servicemix/servicemix-lwcontainer.html
> [2] http://incubator.apache.org/servicemix/pojo-support.html
> 
> beppe82 wrote:
>> Which would be the steps of creating, installing and deploying this
>> simple
>> application using servicemix.xml?
>>
>>
>> Gert Vanthienen wrote:
>>   
>>> You're right with regards to the xbean.xml and servicemix.xml file 
>>> usage.  The only exception is a servicemix-lwcontainer SU, which also 
>>> contains a servicemix.xml config file instead of xbean.xml.
>>>
>>>
>>> Gert
>>>
>>> beppe82 wrote:
>>>     
>>>> Thanks. So, using xbean.xml files for configuring SU is similar to
>>>> write
>>>> servicemix.xml files for configuring the container and the components,
>>>> right? In the latter case I could personalize the container.... but
>>>> from
>>>> a
>>>> component perspective it's quite the same, no?
>>>> Just another thing: at the end of your tutorial, I will get two SU, one
>>>> of
>>>> which depends over a SE (so, three folders) and one SA (another
>>>> folder);
>>>> now, what do I copy to install directory and what to deploy? I try to
>>>> answer, correct me if I'm wrong: I will copy ZIP of SUs into install
>>>> (SE's
>>>> ZIP too???) and SA's JAR into deploy. And I would reach the same result
>>>> if I
>>>> would copy the ZIPs into install and then write mvn jbi:projectDeploy
>>>> into
>>>> SA directory, right? 
>>>> Thanks, sorry for my English (I'm Italian) and for the simple
>>>> questions....
>>>>
>>>>
>>>> Gert Vanthienen wrote:
>>>>   
>>>>       
>>>>> Guiseppe,
>>>>>
>>>>> I'll try to give you a brief primer on what you should do to get this 
>>>>> result.  If you just want to write a service to receive a message and
>>>>> do 
>>>>> something with it, you do not have to write your own service engine,
>>>>> you 
>>>>> can use the servicemix-lwcontainer or servicemix-bean component that
>>>>> is 
>>>>> included in the distribution and just build the SU/SA yourself. 
>>>>> Anyway, 
>>>>> to get the SE example working...
>>>>>
>>>>> First of all, the tutorial lets you build two things:
>>>>> - a hello-world-se service engine (component), which is deployed by 
>>>>> copying it to ${servicemix.home}/install
>>>>> - a hello-world-su service unit project
>>>>>
>>>>> You have to add an xbean.xml file to your service unit project, to 
>>>>> describe the configuration for your service unit.  Add an xbean.xml
>>>>> file 
>>>>> to hello-world-su/src/main/resources with this contents and rebuild
>>>>> the 
>>>>> project.
>>>>>     <beans 
>>>>> xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0" 
>>>>> xmlns:beppe="http://guiseppe.org">
>>>>>        <hello:endpoint service="beppe:service" endpoint="endpoint"/>
>>>>>     </beans>
>>>>>
>>>>> Now, create a second service unit project, now containing this
>>>>> xbean.xml:
>>>>>     <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0" 
>>>>> xmlns:beppe="http://guiseppe.org">
>>>>>         <ftp:poller service="beppe:ftp" endpoint="poller"
>>>>>                 targetService="beppe:service"
>>>>> targetEndpoint="endpoint"
>>>>>                 uri="ftp://anonymous:nemonemini@localhost" />
>>>>>     </beans>
>>>>>
>>>>> Afterwards, you should create another ZIP file (the service assembly), 
>>>>> containing both SU zip file and a file named META-INF/jbi.xml.  For an 
>>>>> example of this file, have a look at 
>>>>> http://incubator.apache.org/servicemix/what-is-a-jbi-sa-and-how-do-i-create-one.html 
>>>>> (bottom of the page).  Your file will contain two <service-unit/> 
>>>>> elements, one targeted towards the hello-world-se component, the other 
>>>>> uses servicemix-ftp.
>>>>>
>>>>> Hope this helps,
>>>>>
>>>>> Gert
>>>>>
>>>>>
>>>>> beppe82 wrote:
>>>>>     
>>>>>         
>>>>>> Hi all, please help me because it's three days I'm wasting my time
>>>>>> into
>>>>>> things that I think are not too difficult (but I can't do that!).
>>>>>> I have a simple SU, written following the tutorial about hello world
>>>>>> SE.
>>>>>> My
>>>>>> process() method just receive a "in" message, print a phrase (using
>>>>>> System.out.println(...)... can I use this method to write on standard
>>>>>> output?) and sets exchange status to "done". I'd like to use it
>>>>>> together
>>>>>> with the ready component ftp-poller... can you write me a
>>>>>> step-by-step
>>>>>> guide
>>>>>> to do that? I'm not able to integrate, build and deploy this very
>>>>>> simple
>>>>>> application... I'm a bit confused about using maven, or using ant,
>>>>>> using
>>>>>> servicexml.xml... I don't exactly know what to do! Thank you very
>>>>>> much,
>>>>>> Giuseppe
>>>>>>   
>>>>>>       
>>>>>>           
>>>>>     
>>>>>         
>>>>   
>>>>       
>>>
>>>     
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/help-for-a-novice-tf3526390s12049.html#a9865526
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: help for a novice

Posted by Gert Vanthienen <ge...@skynet.be>.
Guiseppe,

For a static configuration, you should create and install the SE as you 
did before.  Then, instead of creating SA/SU archive, you add the 
necessary configuration directory to conf/servicemix.xml.  On [1], you 
can see how to add the ftp element to the <sm:activationSpecs/>.  The 
syntax for your own SE would be similar, just using another namespace.

For the goal you're trying to achieve (file from FTP -> handle message 
in java code), you could also build a servicemix-lwcontainer SU.  The SU 
is configured using a servicemix.xml file instead of an xbean .xml file 
(the syntax is shown at [2]. Have a look at [3] for an example on the 
POJO class.  If you use this approach, you do not need to build a 
separate SE and install it, only a SA is required (because you only use 
components that come out-of-the-box, together with ServiceMix).

Gert

[1] 
http://svn.apache.org/repos/asf/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-ftp/src/test/resources/spring.xml 

[2] http://incubator.apache.org/servicemix/servicemix-lwcontainer.html
[2] http://incubator.apache.org/servicemix/pojo-support.html

beppe82 wrote:
> Which would be the steps of creating, installing and deploying this simple
> application using servicemix.xml?
>
>
> Gert Vanthienen wrote:
>   
>> You're right with regards to the xbean.xml and servicemix.xml file 
>> usage.  The only exception is a servicemix-lwcontainer SU, which also 
>> contains a servicemix.xml config file instead of xbean.xml.
>>
>>
>> Gert
>>
>> beppe82 wrote:
>>     
>>> Thanks. So, using xbean.xml files for configuring SU is similar to write
>>> servicemix.xml files for configuring the container and the components,
>>> right? In the latter case I could personalize the container.... but from
>>> a
>>> component perspective it's quite the same, no?
>>> Just another thing: at the end of your tutorial, I will get two SU, one
>>> of
>>> which depends over a SE (so, three folders) and one SA (another folder);
>>> now, what do I copy to install directory and what to deploy? I try to
>>> answer, correct me if I'm wrong: I will copy ZIP of SUs into install
>>> (SE's
>>> ZIP too???) and SA's JAR into deploy. And I would reach the same result
>>> if I
>>> would copy the ZIPs into install and then write mvn jbi:projectDeploy
>>> into
>>> SA directory, right? 
>>> Thanks, sorry for my English (I'm Italian) and for the simple
>>> questions....
>>>
>>>
>>> Gert Vanthienen wrote:
>>>   
>>>       
>>>> Guiseppe,
>>>>
>>>> I'll try to give you a brief primer on what you should do to get this 
>>>> result.  If you just want to write a service to receive a message and do 
>>>> something with it, you do not have to write your own service engine, you 
>>>> can use the servicemix-lwcontainer or servicemix-bean component that is 
>>>> included in the distribution and just build the SU/SA yourself.  Anyway, 
>>>> to get the SE example working...
>>>>
>>>> First of all, the tutorial lets you build two things:
>>>> - a hello-world-se service engine (component), which is deployed by 
>>>> copying it to ${servicemix.home}/install
>>>> - a hello-world-su service unit project
>>>>
>>>> You have to add an xbean.xml file to your service unit project, to 
>>>> describe the configuration for your service unit.  Add an xbean.xml file 
>>>> to hello-world-su/src/main/resources with this contents and rebuild the 
>>>> project.
>>>>     <beans 
>>>> xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0" 
>>>> xmlns:beppe="http://guiseppe.org">
>>>>        <hello:endpoint service="beppe:service" endpoint="endpoint"/>
>>>>     </beans>
>>>>
>>>> Now, create a second service unit project, now containing this
>>>> xbean.xml:
>>>>     <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0" 
>>>> xmlns:beppe="http://guiseppe.org">
>>>>         <ftp:poller service="beppe:ftp" endpoint="poller"
>>>>                 targetService="beppe:service" targetEndpoint="endpoint"
>>>>                 uri="ftp://anonymous:nemonemini@localhost" />
>>>>     </beans>
>>>>
>>>> Afterwards, you should create another ZIP file (the service assembly), 
>>>> containing both SU zip file and a file named META-INF/jbi.xml.  For an 
>>>> example of this file, have a look at 
>>>> http://incubator.apache.org/servicemix/what-is-a-jbi-sa-and-how-do-i-create-one.html 
>>>> (bottom of the page).  Your file will contain two <service-unit/> 
>>>> elements, one targeted towards the hello-world-se component, the other 
>>>> uses servicemix-ftp.
>>>>
>>>> Hope this helps,
>>>>
>>>> Gert
>>>>
>>>>
>>>> beppe82 wrote:
>>>>     
>>>>         
>>>>> Hi all, please help me because it's three days I'm wasting my time into
>>>>> things that I think are not too difficult (but I can't do that!).
>>>>> I have a simple SU, written following the tutorial about hello world
>>>>> SE.
>>>>> My
>>>>> process() method just receive a "in" message, print a phrase (using
>>>>> System.out.println(...)... can I use this method to write on standard
>>>>> output?) and sets exchange status to "done". I'd like to use it
>>>>> together
>>>>> with the ready component ftp-poller... can you write me a step-by-step
>>>>> guide
>>>>> to do that? I'm not able to integrate, build and deploy this very
>>>>> simple
>>>>> application... I'm a bit confused about using maven, or using ant,
>>>>> using
>>>>> servicexml.xml... I don't exactly know what to do! Thank you very much,
>>>>> Giuseppe
>>>>>   
>>>>>       
>>>>>           
>>>>     
>>>>         
>>>   
>>>       
>>
>>     
>
>   


Re: help for a novice

Posted by beppe82 <g....@jumpy.it>.
Which would be the steps of creating, installing and deploying this simple
application using servicemix.xml?


Gert Vanthienen wrote:
> 
> 
> You're right with regards to the xbean.xml and servicemix.xml file 
> usage.  The only exception is a servicemix-lwcontainer SU, which also 
> contains a servicemix.xml config file instead of xbean.xml.
> 
> 
> Gert
> 
> beppe82 wrote:
>> Thanks. So, using xbean.xml files for configuring SU is similar to write
>> servicemix.xml files for configuring the container and the components,
>> right? In the latter case I could personalize the container.... but from
>> a
>> component perspective it's quite the same, no?
>> Just another thing: at the end of your tutorial, I will get two SU, one
>> of
>> which depends over a SE (so, three folders) and one SA (another folder);
>> now, what do I copy to install directory and what to deploy? I try to
>> answer, correct me if I'm wrong: I will copy ZIP of SUs into install
>> (SE's
>> ZIP too???) and SA's JAR into deploy. And I would reach the same result
>> if I
>> would copy the ZIPs into install and then write mvn jbi:projectDeploy
>> into
>> SA directory, right? 
>> Thanks, sorry for my English (I'm Italian) and for the simple
>> questions....
>>
>>
>> Gert Vanthienen wrote:
>>   
>>> Guiseppe,
>>>
>>> I'll try to give you a brief primer on what you should do to get this 
>>> result.  If you just want to write a service to receive a message and do 
>>> something with it, you do not have to write your own service engine, you 
>>> can use the servicemix-lwcontainer or servicemix-bean component that is 
>>> included in the distribution and just build the SU/SA yourself.  Anyway, 
>>> to get the SE example working...
>>>
>>> First of all, the tutorial lets you build two things:
>>> - a hello-world-se service engine (component), which is deployed by 
>>> copying it to ${servicemix.home}/install
>>> - a hello-world-su service unit project
>>>
>>> You have to add an xbean.xml file to your service unit project, to 
>>> describe the configuration for your service unit.  Add an xbean.xml file 
>>> to hello-world-su/src/main/resources with this contents and rebuild the 
>>> project.
>>>     <beans 
>>> xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0" 
>>> xmlns:beppe="http://guiseppe.org">
>>>        <hello:endpoint service="beppe:service" endpoint="endpoint"/>
>>>     </beans>
>>>
>>> Now, create a second service unit project, now containing this
>>> xbean.xml:
>>>     <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0" 
>>> xmlns:beppe="http://guiseppe.org">
>>>         <ftp:poller service="beppe:ftp" endpoint="poller"
>>>                 targetService="beppe:service" targetEndpoint="endpoint"
>>>                 uri="ftp://anonymous:nemonemini@localhost" />
>>>     </beans>
>>>
>>> Afterwards, you should create another ZIP file (the service assembly), 
>>> containing both SU zip file and a file named META-INF/jbi.xml.  For an 
>>> example of this file, have a look at 
>>> http://incubator.apache.org/servicemix/what-is-a-jbi-sa-and-how-do-i-create-one.html 
>>> (bottom of the page).  Your file will contain two <service-unit/> 
>>> elements, one targeted towards the hello-world-se component, the other 
>>> uses servicemix-ftp.
>>>
>>> Hope this helps,
>>>
>>> Gert
>>>
>>>
>>> beppe82 wrote:
>>>     
>>>> Hi all, please help me because it's three days I'm wasting my time into
>>>> things that I think are not too difficult (but I can't do that!).
>>>> I have a simple SU, written following the tutorial about hello world
>>>> SE.
>>>> My
>>>> process() method just receive a "in" message, print a phrase (using
>>>> System.out.println(...)... can I use this method to write on standard
>>>> output?) and sets exchange status to "done". I'd like to use it
>>>> together
>>>> with the ready component ftp-poller... can you write me a step-by-step
>>>> guide
>>>> to do that? I'm not able to integrate, build and deploy this very
>>>> simple
>>>> application... I'm a bit confused about using maven, or using ant,
>>>> using
>>>> servicexml.xml... I don't exactly know what to do! Thank you very much,
>>>> Giuseppe
>>>>   
>>>>       
>>>
>>>     
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/help-for-a-novice-tf3526390s12049.html#a9858671
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: help for a novice

Posted by Gert Vanthienen <ge...@skynet.be>.
Guiseppe,


You're right with regards to the xbean.xml and servicemix.xml file 
usage.  The only exception is a servicemix-lwcontainer SU, which also 
contains a servicemix.xml config file instead of xbean.xml.

At the end of the tutorial, you have an SE ZIP file, which should be 
copied into the install directory.  Actually, the SA is also a ZIP file, 
which contains the both SU zip files (and the META-INF/jbi.xml).  You 
have to copy the SA's ZIP file to the deploy directory.  There's no need 
to copy the SUs separately anymore, as they are already packaged inside 
the SA.

Indeed, the same result can be reached using the Maven and/or Ant tasks 
instead of copying the files into the install/deploy directories.


Gert

beppe82 wrote:
> Thanks. So, using xbean.xml files for configuring SU is similar to write
> servicemix.xml files for configuring the container and the components,
> right? In the latter case I could personalize the container.... but from a
> component perspective it's quite the same, no?
> Just another thing: at the end of your tutorial, I will get two SU, one of
> which depends over a SE (so, three folders) and one SA (another folder);
> now, what do I copy to install directory and what to deploy? I try to
> answer, correct me if I'm wrong: I will copy ZIP of SUs into install (SE's
> ZIP too???) and SA's JAR into deploy. And I would reach the same result if I
> would copy the ZIPs into install and then write mvn jbi:projectDeploy into
> SA directory, right? 
> Thanks, sorry for my English (I'm Italian) and for the simple questions....
>
>
> Gert Vanthienen wrote:
>   
>> Guiseppe,
>>
>> I'll try to give you a brief primer on what you should do to get this 
>> result.  If you just want to write a service to receive a message and do 
>> something with it, you do not have to write your own service engine, you 
>> can use the servicemix-lwcontainer or servicemix-bean component that is 
>> included in the distribution and just build the SU/SA yourself.  Anyway, 
>> to get the SE example working...
>>
>> First of all, the tutorial lets you build two things:
>> - a hello-world-se service engine (component), which is deployed by 
>> copying it to ${servicemix.home}/install
>> - a hello-world-su service unit project
>>
>> You have to add an xbean.xml file to your service unit project, to 
>> describe the configuration for your service unit.  Add an xbean.xml file 
>> to hello-world-su/src/main/resources with this contents and rebuild the 
>> project.
>>     <beans 
>> xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0" 
>> xmlns:beppe="http://guiseppe.org">
>>        <hello:endpoint service="beppe:service" endpoint="endpoint"/>
>>     </beans>
>>
>> Now, create a second service unit project, now containing this xbean.xml:
>>     <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0" 
>> xmlns:beppe="http://guiseppe.org">
>>         <ftp:poller service="beppe:ftp" endpoint="poller"
>>                 targetService="beppe:service" targetEndpoint="endpoint"
>>                 uri="ftp://anonymous:nemonemini@localhost" />
>>     </beans>
>>
>> Afterwards, you should create another ZIP file (the service assembly), 
>> containing both SU zip file and a file named META-INF/jbi.xml.  For an 
>> example of this file, have a look at 
>> http://incubator.apache.org/servicemix/what-is-a-jbi-sa-and-how-do-i-create-one.html 
>> (bottom of the page).  Your file will contain two <service-unit/> 
>> elements, one targeted towards the hello-world-se component, the other 
>> uses servicemix-ftp.
>>
>> Hope this helps,
>>
>> Gert
>>
>>
>> beppe82 wrote:
>>     
>>> Hi all, please help me because it's three days I'm wasting my time into
>>> things that I think are not too difficult (but I can't do that!).
>>> I have a simple SU, written following the tutorial about hello world SE.
>>> My
>>> process() method just receive a "in" message, print a phrase (using
>>> System.out.println(...)... can I use this method to write on standard
>>> output?) and sets exchange status to "done". I'd like to use it together
>>> with the ready component ftp-poller... can you write me a step-by-step
>>> guide
>>> to do that? I'm not able to integrate, build and deploy this very simple
>>> application... I'm a bit confused about using maven, or using ant, using
>>> servicexml.xml... I don't exactly know what to do! Thank you very much,
>>> Giuseppe
>>>   
>>>       
>>
>>     
>
>   


Re: help for a novice

Posted by beppe82 <g....@jumpy.it>.
Thanks. So, using xbean.xml files for configuring SU is similar to write
servicemix.xml files for configuring the container and the components,
right? In the latter case I could personalize the container.... but from a
component perspective it's quite the same, no?
Just another thing: at the end of your tutorial, I will get two SU, one of
which depends over a SE (so, three folders) and one SA (another folder);
now, what do I copy to install directory and what to deploy? I try to
answer, correct me if I'm wrong: I will copy ZIP of SUs into install (SE's
ZIP too???) and SA's JAR into deploy. And I would reach the same result if I
would copy the ZIPs into install and then write mvn jbi:projectDeploy into
SA directory, right? 
Thanks, sorry for my English (I'm Italian) and for the simple questions....


Gert Vanthienen wrote:
> 
> Guiseppe,
> 
> I'll try to give you a brief primer on what you should do to get this 
> result.  If you just want to write a service to receive a message and do 
> something with it, you do not have to write your own service engine, you 
> can use the servicemix-lwcontainer or servicemix-bean component that is 
> included in the distribution and just build the SU/SA yourself.  Anyway, 
> to get the SE example working...
> 
> First of all, the tutorial lets you build two things:
> - a hello-world-se service engine (component), which is deployed by 
> copying it to ${servicemix.home}/install
> - a hello-world-su service unit project
> 
> You have to add an xbean.xml file to your service unit project, to 
> describe the configuration for your service unit.  Add an xbean.xml file 
> to hello-world-su/src/main/resources with this contents and rebuild the 
> project.
>     <beans 
> xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0" 
> xmlns:beppe="http://guiseppe.org">
>        <hello:endpoint service="beppe:service" endpoint="endpoint"/>
>     </beans>
> 
> Now, create a second service unit project, now containing this xbean.xml:
>     <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0" 
> xmlns:beppe="http://guiseppe.org">
>         <ftp:poller service="beppe:ftp" endpoint="poller"
>                 targetService="beppe:service" targetEndpoint="endpoint"
>                 uri="ftp://anonymous:nemonemini@localhost" />
>     </beans>
> 
> Afterwards, you should create another ZIP file (the service assembly), 
> containing both SU zip file and a file named META-INF/jbi.xml.  For an 
> example of this file, have a look at 
> http://incubator.apache.org/servicemix/what-is-a-jbi-sa-and-how-do-i-create-one.html 
> (bottom of the page).  Your file will contain two <service-unit/> 
> elements, one targeted towards the hello-world-se component, the other 
> uses servicemix-ftp.
> 
> Hope this helps,
> 
> Gert
> 
> 
> beppe82 wrote:
>> Hi all, please help me because it's three days I'm wasting my time into
>> things that I think are not too difficult (but I can't do that!).
>> I have a simple SU, written following the tutorial about hello world SE.
>> My
>> process() method just receive a "in" message, print a phrase (using
>> System.out.println(...)... can I use this method to write on standard
>> output?) and sets exchange status to "done". I'd like to use it together
>> with the ready component ftp-poller... can you write me a step-by-step
>> guide
>> to do that? I'm not able to integrate, build and deploy this very simple
>> application... I'm a bit confused about using maven, or using ant, using
>> servicexml.xml... I don't exactly know what to do! Thank you very much,
>> Giuseppe
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/help-for-a-novice-tf3526390s12049.html#a9852032
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: help for a novice

Posted by Gert Vanthienen <ge...@skynet.be>.
Guiseppe,

I'll try to give you a brief primer on what you should do to get this 
result.  If you just want to write a service to receive a message and do 
something with it, you do not have to write your own service engine, you 
can use the servicemix-lwcontainer or servicemix-bean component that is 
included in the distribution and just build the SU/SA yourself.  Anyway, 
to get the SE example working...

First of all, the tutorial lets you build two things:
- a hello-world-se service engine (component), which is deployed by 
copying it to ${servicemix.home}/install
- a hello-world-su service unit project

You have to add an xbean.xml file to your service unit project, to 
describe the configuration for your service unit.  Add an xbean.xml file 
to hello-world-su/src/main/resources with this contents and rebuild the 
project.
    <beans 
xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0" 
xmlns:beppe="http://guiseppe.org">
       <hello:endpoint service="beppe:service" endpoint="endpoint"/>
    </beans>

Now, create a second service unit project, now containing this xbean.xml:
    <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0" 
xmlns:beppe="http://guiseppe.org">
        <ftp:poller service="beppe:ftp" endpoint="poller"
                targetService="beppe:service" targetEndpoint="endpoint"
                uri="ftp://anonymous:nemonemini@localhost" />
    </beans>

Afterwards, you should create another ZIP file (the service assembly), 
containing both SU zip file and a file named META-INF/jbi.xml.  For an 
example of this file, have a look at 
http://incubator.apache.org/servicemix/what-is-a-jbi-sa-and-how-do-i-create-one.html 
(bottom of the page).  Your file will contain two <service-unit/> 
elements, one targeted towards the hello-world-se component, the other 
uses servicemix-ftp.

Hope this helps,

Gert


beppe82 wrote:
> Hi all, please help me because it's three days I'm wasting my time into
> things that I think are not too difficult (but I can't do that!).
> I have a simple SU, written following the tutorial about hello world SE. My
> process() method just receive a "in" message, print a phrase (using
> System.out.println(...)... can I use this method to write on standard
> output?) and sets exchange status to "done". I'd like to use it together
> with the ready component ftp-poller... can you write me a step-by-step guide
> to do that? I'm not able to integrate, build and deploy this very simple
> application... I'm a bit confused about using maven, or using ant, using
> servicexml.xml... I don't exactly know what to do! Thank you very much,
> Giuseppe
>