Hi,
my 2 cents......but just for task 2 i m afraid
if u want to send 'any' kind of file, write your file service unit as
htis
<file:poller service="tut:file"
endpoint="poller"
file="file:///c:/servicemix-projects/in/"
targetService="tut:wiretap">
<property name="marshaler">
<bean
class="org.apache.servicemix.components.util.BinaryFileMarshaler" />
</property>
</file:poller>
hth
marco
Internet
[EMAIL PROTECTED]
05/02/2008 09:15
Please respond to
[email protected]
To
users
cc
Subject
Re: Problem facing in creating servicemix application
Hi Chris,
Thanks a lot for your reply. The inputs are really usefull to me
The exception at the startup is removed now.
I am facing difficulty to perform following tasks:
Task 1:
====
I need to read the content of the file send in the bean component.
When I print the exchange object, the content of my file is displayed on
the
console along with other data stored in the Exchange. It prints the
content
of the file if front of "in" key, where the normalize message object is
kept.
How can I retrieve the content of the file in String format in
servicemix-bean compnent.
Task2:
====
This component is polling only xml file.
How can i read a text file using the same compnent.
Task3:
====
When I shut down servicemix, exception is thrown. Details of Exception is
given below:
INFO - JBIContainer - Shutting down ServiceMix JBI
Container (ServiceMix) stopped
INFO - JBIContainer - Deactivating component
#SubscriptionManager#
INFO - QuartzScheduler - Scheduler
DefaultQuartzScheduler_$_NON_CLUSTERED paused.
INFO - QuartzScheduler - Scheduler
DefaultQuartzScheduler_$_NON_CLUSTERED shutting down.
INFO - QuartzScheduler - Scheduler
DefaultQuartzScheduler_$_NON_CLUSTERED paused.
INFO - QuartzScheduler - Scheduler
DefaultQuartzScheduler_$_NON_CLUSTERED shutdown complete.
INFO - ServiceAssemblyLifeCycle - Stopping service assembly:
tutorial-sa
INFO - ServiceUnitLifeCycle - Stopping service unit:
perftester-file-su
INFO - ServiceUnitLifeCycle - Stopping service unit:
perftester-http-handler-su
INFO - ServiceAssemblyLifeCycle - Shutting down service assembly:
tutorial-sa
INFO - ServiceUnitLifeCycle - Shutting down service unit:
perftester-file-su
INFO - ServiceUnitLifeCycle - Shutting down service unit:
perftester-http-handler-su
ERROR - FileComponent - Failed to process file:
D:\poller\build.xml. Reason: javax.jbi.messaging.MessagingException:
java.lang.InterruptedException
javax.jbi.messaging.MessagingException: java.lang.InterruptedException
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:498)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:442)
at
org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:95)
at
org.apache.servicemix.common.endpoints.SimpleEndpoint.sendSync(SimpleEndpoint.java:71)
at
org.apache.servicemix.file.FilePollerEndpoint.processFile(FilePollerEndpoint.java:282)
at
org.apache.servicemix.file.FilePollerEndpoint.processFileAndDelete(FilePollerEndpoint.java:253)
at
org.apache.servicemix.file.FilePollerEndpoint$1.run(FilePollerEndpoint.java:231)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.waitForExchange(DeliveryChannelImpl.java:699)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:472)
... 9 more
INFO - JBIContainer - ServiceMix JBI Container
(ServiceMix) stopped
Terminate batch job (Y/N)? Y
Thanks for your reply.
Puneet
Chris Custine (Apache) wrote:
>
> I think these errors are because the file poller starts before the
target
> endpoint is finished starting. I recommend trying the delay parameter
to
> the file:poller endpoint. For example, setting delay="5000" will tell
the
> poller to wait 5 seconds before processing files on startup.
>
> Good luck,
> Chris
>
>
> On Feb 4, 2008 1:25 PM, puneetjain <[EMAIL PROTECTED]> wrote:
>
>>
>> Hi,
>>
>> I am new to servicemix. I am trying to write an application which read
a
>> text file and from the file system and send to a service engine.
Service
>> Engine process the file data and send the write the process data on
>> console
>> or send to a jms.
>>
>> Environment:
>>
>> Servicemix version : 3.2.1
>> Operation System: Windows XP
>> Java: jdk1.5
>>
>> Step Performed:
>>
>> 1. Created a project using maven.
>> 2. Created a servicemix-file component. Xbean file configuration
is
>> as
>> follow:
>>
>> <beans xmlns:file="http://servicemix.apache.org/file/1.0"
>> xmlns:tut="urn:servicemix:tutorial"
>> xmlns:ex="http://www.servicemix.org/example">
>> <file:poller service="tut:file"
>> endpoint="poller"
>> file="file:///D:/poller"
>> targetService="ex:httphandler"
>> targetEndpoint="handlerEndpoint">
>> </file:poller>
>> </beans>
>>
>> 3. Created a servicemix-bean. xbean.xml is given below
>>
>> <beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
>> xmlns:ex="http://www.servicemix.org/example">
>> <bean:endpoint service="ex:httphandler" endpoint="handlerEndpoint"
>> bean="#reverserBean"/>
>> <bean id="reverserBean"
>> class="com.wipro.oki.servicemix.sample.StringReverserBean" />
>> </beans>
>>
>> 4. When I deployed the application on servicemix, following
>> exception
>> raised:
>>
>> Exception Raised:
>> http://www.nabble.com/file/p15276742/servicemix.log servicemix.log
>> --
>> View this message in context:
>>
http://www.nabble.com/Problem-facing-in-creating-servicemix-application-tp15276742s12049p15276742.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Problem-facing-in-creating-servicemix-application-tp15276742s12049p15286174.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
This communication is confidential, may be privileged and is meant only for the
intended recipient. If you are
not the intended recipient, please notify the sender by reply and delete this
message from your system. Any
unauthorised dissemination, distribution or copying hereof is prohibited.
BNP Paribas Fund Services UK Limited, BNP Paribas Trust Corporation UK Limited,
BNP Paribas UK Limited,
BNP Paribas Commodity Futures Ltd and Investment Fund Services Limited are
authorised and regulated by
the Financial Services Authority.
BNP Paribas, BNP Paribas Securities Services and BNP Paribas Private Bank are
authorised by the CECEI
and AMF. BNP Paribas London Branch, BNP Paribas Securities Services London
Branch and BNP Paribas
Private Bank London Branch are regulated by the Financial Services Authority
for the conduct of their UK
business. BNP Paribas Securities Services London Branch is also a member of
the London Stock Exchange.