You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Felipe Gaucho <fg...@gmail.com> on 2007/03/08 10:08:53 UTC

modifying fileBC example - how to deploy

ok,

I have the servicemix-file example compiling and being edited through
Eclipse... all maven steps were sucessfully done, and the "maven install"
command creates the ZIP and JAR files into target folder.

now, I changed this line code into the FileSenderEndpoint:

FROM:


>             out = new BufferedOutputStream(new FileOutputStream(newFile));
>             marshaler.writeMessage(exchange, in, out, name);
TO:


>             out = new BufferedOutputStream(new FileOutputStream(newFile));
>             out.write("test".getBytes());
>             //marshaler.writeMessage(exchange, in, out, name);

and now ? how to deploy ??

I tried: 

1- maven install
(..\src\deployables\bindingcomponents\servicemix-file>ncamaven
eclipse:eclipse)
2 - copy ZIP file to deploy folder...
3 - tested

result: nothing happens :) The test-file is being consumed and the output is
being created.. empty :(

-- 
View this message in context: http://www.nabble.com/modifying-fileBC-example---how-to-deploy-tf3368022s12049.html#a9370963
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: modifying fileBC example - how to deploy

Posted by Guillaume Nodet <gn...@gmail.com>.
On 3/8/07, Felipe Gaucho <fg...@gmail.com> wrote:
>
>
> ok, thanks Guillaume.. now everything is clear for me.. sorry my rush
> stress..
>
> ok, then I want to modify the "fileSender".. what I must do ?
>
> 1 - modify the "src\deployables\bindingcomponents\servicemix-file" code
> 2 - maven install
> 3 - copy the zip file to deploy
> 4 - modify the descriptor (or copy and modify as new one) in the
> \examples\file-binding
>
> questions:
>
> 1- is it correct sequence of steps for now ?
> 2- how to modify the descriptor ?


Well, not exactly.

The problem is that ServiceMix supports two deployment models.
You can either use the standard JBI packaging, which means you have
to create a SU + SA and deploy it.  In such a case, copying the component
zip will work, as it will be automatically installed.

The second deployment model is the one used by the example you are working
on: a single servicemix.xml configuration file without any JBI packaging.
In such a case, you need to modify the servicemix.xml to reference
servicemix-file
instead of the lightweight component, but you also need to copy the jar from
serviemix-file
to the lib/optional folder (the jar and not the zip).   This is related to
the way classloader work ...

gnodet wrote:
> >
> > On 3/8/07, Felipe Gaucho <fg...@gmail.com> wrote:
> >>
> >>
> >> where is this readme.txt ? which folder ?
> >>
> >> I am following this:
> >>
> >> servicemix-bin-install-dir\examples\file-binding\README.txt
> >
> >
> >
> > In this file,  line 24, you need to execute "ant setup"
> > to download the needed dependencies.
> >
> > and trying to modify this:
> >>
> >>
> >>
> servicemix-src-install-dir\\src\deployables\bindingcomponents\servicemix-file
> >
> >
> > WHich is unrelated to this example unfortunately.
> > This example uses:
> >
> >
> $SERVICEMIX_SRC/common/servicemix-common/src/main/java/org/apache/servicemix/components/file
> >
> > If you want to use the servicemix-file BC, you need to change this
> example
> > following the
> > syntax described at
> >    http://incubator.apache.org/servicemix/servicemix-file.html
> >
> > --
> >> View this message in context:
> >>
> http://www.nabble.com/modifying-fileBC-example---how-to-deploy-tf3368022s12049.html#a9371483
> >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> > ------------------------
> > Architect, LogicBlaze (http://www.logicblaze.com/)
> > Blog: http://gnodet.blogspot.com/
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/modifying-fileBC-example---how-to-deploy-tf3368022s12049.html#a9371971
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/

Re: modifying fileBC example - how to deploy

Posted by Felipe Gaucho <fg...@gmail.com>.
ok, thanks Guillaume.. now everything is clear for me.. sorry my rush
stress..

ok, then I want to modify the "fileSender".. what I must do ?

1 - modify the "src\deployables\bindingcomponents\servicemix-file" code
2 - maven install
3 - copy the zip file to deploy 
4 - modify the descriptor (or copy and modify as new one) in the
\examples\file-binding

questions:

1- is it correct sequence of steps for now ?
2- how to modify the descriptor ?






gnodet wrote:
> 
> On 3/8/07, Felipe Gaucho <fg...@gmail.com> wrote:
>>
>>
>> where is this readme.txt ? which folder ?
>>
>> I am following this:
>>
>> servicemix-bin-install-dir\examples\file-binding\README.txt
> 
> 
> 
> In this file,  line 24, you need to execute "ant setup"
> to download the needed dependencies.
> 
> and trying to modify this:
>>
>>
>> servicemix-src-install-dir\\src\deployables\bindingcomponents\servicemix-file
> 
> 
> WHich is unrelated to this example unfortunately.
> This example uses:
> 
> $SERVICEMIX_SRC/common/servicemix-common/src/main/java/org/apache/servicemix/components/file
> 
> If you want to use the servicemix-file BC, you need to change this example
> following the
> syntax described at
>    http://incubator.apache.org/servicemix/servicemix-file.html
> 
> --
>> View this message in context:
>> http://www.nabble.com/modifying-fileBC-example---how-to-deploy-tf3368022s12049.html#a9371483
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Architect, LogicBlaze (http://www.logicblaze.com/)
> Blog: http://gnodet.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/modifying-fileBC-example---how-to-deploy-tf3368022s12049.html#a9371971
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: modifying fileBC example - how to deploy

Posted by Guillaume Nodet <gn...@gmail.com>.
On 3/8/07, Felipe Gaucho <fg...@gmail.com> wrote:
>
>
> where is this readme.txt ? which folder ?
>
> I am following this:
>
> servicemix-bin-install-dir\examples\file-binding\README.txt



In this file,  line 24, you need to execute "ant setup"
to download the needed dependencies.

and trying to modify this:
>
>
> servicemix-src-install-dir\\src\deployables\bindingcomponents\servicemix-file


WHich is unrelated to this example unfortunately.
This example uses:

$SERVICEMIX_SRC/common/servicemix-common/src/main/java/org/apache/servicemix/components/file

If you want to use the servicemix-file BC, you need to change this example
following the
syntax described at
   http://incubator.apache.org/servicemix/servicemix-file.html

--
> View this message in context:
> http://www.nabble.com/modifying-fileBC-example---how-to-deploy-tf3368022s12049.html#a9371483
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/

Re: modifying fileBC example - how to deploy

Posted by Felipe Gaucho <fg...@gmail.com>.
where is this readme.txt ? which folder ?

I am following this:

servicemix-bin-install-dir\examples\file-binding\README.txt

and trying to modify this:

servicemix-src-install-dir\\src\deployables\bindingcomponents\servicemix-file

-- 
View this message in context: http://www.nabble.com/modifying-fileBC-example---how-to-deploy-tf3368022s12049.html#a9371483
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: modifying fileBC example - how to deploy

Posted by Guillaume Nodet <gn...@gmail.com>.
This example works, but is using a lightweight component and not
the servicemix-file component.  To make this sample work,
you need to follow the README.txt which contains a command to launch
(ant setup, iirc) before running the example.

On 3/8/07, Felipe Gaucho <fg...@gmail.com> wrote:
>
>
> humm, just noticed now: the file-binding example is not working anymore..
>
> I downloaded and installed and src and the bin zip files from the service
> mix download page, and just executed the
>
> Line command:
>
>
> > ../../bin/servicemix servicemix.xml
> >
> Result:
>
>
> > Loading Apache ServiceMix from file: servicemix.xml
> > Caught:
> > org.springframework.beans.factory.parsing.BeanDefinitionParsingException
> :
> > Configuration problem: Bean class
> > [org.apache.servicemix.components.file.FileWriter] not found
> > Offending resource: file
> > [C:\local\apache-
> servicemix-3.2-incubating-SNAPSHOT\examples\file-binding\servicemix.xml]
> > Bean ''; nested exception is java.lang.ClassNotFoundException:
> > org.apache.servicemix.components.file.FileWriter
> >
>
> any tip about a version that still works ? 3.1 ? 3.2 ?
> --
> View this message in context:
> http://www.nabble.com/modifying-fileBC-example---how-to-deploy-tf3368022s12049.html#a9371090
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/

Re: modifying fileBC example - how to deploy

Posted by Felipe Gaucho <fg...@gmail.com>.
humm, just noticed now: the file-binding example is not working anymore.. 

I downloaded and installed and src and the bin zip files from the service
mix download page, and just executed the 

Line command:


> ../../bin/servicemix servicemix.xml
> 
Result:


> Loading Apache ServiceMix from file: servicemix.xml
> Caught:
> org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
> Configuration problem: Bean class
> [org.apache.servicemix.components.file.FileWriter] not found
> Offending resource: file
> [C:\local\apache-servicemix-3.2-incubating-SNAPSHOT\examples\file-binding\servicemix.xml]
> Bean ''; nested exception is java.lang.ClassNotFoundException:
> org.apache.servicemix.components.file.FileWriter
> 

any tip about a version that still works ? 3.1 ? 3.2 ?
-- 
View this message in context: http://www.nabble.com/modifying-fileBC-example---how-to-deploy-tf3368022s12049.html#a9371090
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: modifying fileBC example - how to deploy

Posted by Felipe Gaucho <fg...@gmail.com>.
just a corection in the first step:

1- maven install (..\src\deployables\bindingcomponents\servicemix-file>mvn
install)

-- 
View this message in context: http://www.nabble.com/modifying-fileBC-example---how-to-deploy-tf3368022s12049.html#a9370977
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: modifying fileBC example - how to deploy

Posted by Felipe Gaucho <fg...@gmail.com>.
The servicemix.xml:


> <?xml version="1.0" encoding="UTF-8"?>
> <!--
> 
>     Licensed to the Apache Software Foundation (ASF) under one or more
>     contributor license agreements.  See the NOTICE file distributed with
>     this work for additional information regarding copyright ownership.
>     The ASF licenses this file to You under the Apache License, Version
> 2.0
>     (the "License"); you may not use this file except in compliance with
>     the License.  You may obtain a copy of the License at
> 
>        http://www.apache.org/licenses/LICENSE-2.0
> 
>     Unless required by applicable law or agreed to in writing, software
>     distributed under the License is distributed on an "AS IS" BASIS,
>     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
>     See the License for the specific language governing permissions and
>     limitations under the License.
> 
> -->
> <beans xmlns:sm="http://servicemix.apache.org/config/1.0"
> 	     xmlns:foo="http://servicemix.org/demo/">
> 
>   <bean id="jndi"
> class="org.apache.xbean.spring.jndi.SpringInitialContextFactory" 
>         factory-method="makeInitialContext" singleton="true" />
> 
> 	<!-- the JBI container -->
> 	<sm:container id="jbi" useMBeanServer="true" createMBeanServer="true">
> 
> 		<sm:activationSpecs>
> 
> 			<!-- Write files to the outbox directory -->
> 			<sm:activationSpec componentName="fileSender"
> 				service="foo:fileSender">
> 				<sm:component>
> 					<bean class="org.apache.servicemix.components.file.FileWriter">
> 						<property name="directory" value="outbox" />
> 						<property name="marshaler">
> 							<bean
> 							
> class="org.apache.servicemix.components.util.DefaultFileMarshaler">
> 								<property name="fileName">
> 									<bean
> 									
> class="org.apache.servicemix.expression.JaxenStringXPathExpression">
> 										<constructor-arg
> 											value="concat('sample_', /sample/@id, '.xml')" />
> 									</bean>
> 								</property>
> 							</bean>
> 						</property>
> 					</bean>
> 				</sm:component>
> 			</sm:activationSpec>
> 
> 			<!-- Look for files in the inbox directory -->
> 			<sm:activationSpec componentName="filePoller"
> 				destinationService="foo:fileSender" service="foo:filePoller">
> 				<sm:component>
> 					<bean class="org.apache.servicemix.components.file.FilePoller">
> 						<property name="file" value="inbox" />
> 						<property name="period" value="1000" />
> 					</bean>
> 				</sm:component>
> 			</sm:activationSpec>
> 		</sm:activationSpecs>
> 	</sm:container>
> 
> </beans>
> 
> 

-- 
View this message in context: http://www.nabble.com/modifying-fileBC-example---how-to-deploy-tf3368022s12049.html#a9371329
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: modifying fileBC example - how to deploy

Posted by Felipe Gaucho <fg...@gmail.com>.
sure I can.. but the funny part is: I didn't modified anything else.. I just
include 1 line of code and use "mvn install".. so I supose everything is
like it was downloaded....

using 3.1 last week it worked.. but then I replaced the 3.1 by the 3.2 .. :)

I am downloading the 3.1 again.. 


gnodet wrote:
> 
> Could you paste your configuration for the file component ?
> Do you use a JBI packaging (SU / SA ?) ?
> 
> On 3/8/07, Felipe Gaucho <fg...@gmail.com> wrote:
>>
>>
>> ok,
>>
>> I have the servicemix-file example compiling and being edited through
>> Eclipse... all maven steps were sucessfully done, and the "maven install"
>> command creates the ZIP and JAR files into target folder.
>>
>> now, I changed this line code into the FileSenderEndpoint:
>>
>> FROM:
>>
>>
>> >             out = new BufferedOutputStream(new
>> FileOutputStream(newFile));
>> >             marshaler.writeMessage(exchange, in, out, name);
>> TO:
>>
>>
>> >             out = new BufferedOutputStream(new
>> FileOutputStream(newFile));
>> >             out.write("test".getBytes());
>> >             //marshaler.writeMessage(exchange, in, out, name);
>>
>> and now ? how to deploy ??
>>
>> I tried:
>>
>> 1- maven install
>> (..\src\deployables\bindingcomponents\servicemix-file>ncamaven
>> eclipse:eclipse)
>> 2 - copy ZIP file to deploy folder...
>> 3 - tested
>>
>> result: nothing happens :) The test-file is being consumed and the output
>> is
>> being created.. empty :(
>>
>> --
>> View this message in context:
>> http://www.nabble.com/modifying-fileBC-example---how-to-deploy-tf3368022s12049.html#a9370963
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Architect, LogicBlaze (http://www.logicblaze.com/)
> Blog: http://gnodet.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/modifying-fileBC-example---how-to-deploy-tf3368022s12049.html#a9371289
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: modifying fileBC example - how to deploy

Posted by Guillaume Nodet <gn...@gmail.com>.
Could you paste your configuration for the file component ?
Do you use a JBI packaging (SU / SA ?) ?

On 3/8/07, Felipe Gaucho <fg...@gmail.com> wrote:
>
>
> ok,
>
> I have the servicemix-file example compiling and being edited through
> Eclipse... all maven steps were sucessfully done, and the "maven install"
> command creates the ZIP and JAR files into target folder.
>
> now, I changed this line code into the FileSenderEndpoint:
>
> FROM:
>
>
> >             out = new BufferedOutputStream(new
> FileOutputStream(newFile));
> >             marshaler.writeMessage(exchange, in, out, name);
> TO:
>
>
> >             out = new BufferedOutputStream(new
> FileOutputStream(newFile));
> >             out.write("test".getBytes());
> >             //marshaler.writeMessage(exchange, in, out, name);
>
> and now ? how to deploy ??
>
> I tried:
>
> 1- maven install
> (..\src\deployables\bindingcomponents\servicemix-file>ncamaven
> eclipse:eclipse)
> 2 - copy ZIP file to deploy folder...
> 3 - tested
>
> result: nothing happens :) The test-file is being consumed and the output
> is
> being created.. empty :(
>
> --
> View this message in context:
> http://www.nabble.com/modifying-fileBC-example---how-to-deploy-tf3368022s12049.html#a9370963
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/