Hi,
When I use the DefaultMarshaler the following errors throws up. Basically
Iam trying to convert to property type Marshaler.
org.springframework.beans.factory.BeanCreationException: Error creating
bean wit
h name 'org.servicemix.components.file.FileWriter#10849bc' defined in file
[C:\s
ervicemix-2.0.2\examples\file-binding\servicemix.xml]: Error setting
property va
lues; nested exception is
org.springframework.beans.PropertyAccessExceptionsExce
ption: PropertyAccessExceptionsException (1 errors); nested
propertyAccessExcept
ions are: [org.springframework.beans.TypeMismatchException: Failed to
convert pr
operty value of type [org.servicemix.jbi.messaging.DefaultMarshaler] to
required
type [org.servicemix.components.util.FileMarshaler] for property
'marshaler']
PropertyAccessExceptionsException (1 errors)
org.springframework.beans.TypeMismatchException: Failed to convert
property valu
e of type [org.servicemix.jbi.messaging.DefaultMarshaler] to required type
[org.
servicemix.components.util.FileMarshaler] for property 'marshaler'
Now if te DefaultMarshaler cannot convert to marshaler, what other
property can I use to allow the content to be written to the outbox
directory. Is there any api I can look to see the use of these classes?
The servicemix.xml file Iam using is shown below.
<sm:container id="jbi" useMBeanServer="true"
createMBeanServer="true" dumpStats="true"
statsInterval="10">
<sm:activationSpecs>
<!-- Write files to the outbox directory -->
<sm:activationSpec componentName="fileSender"
service="foo:fileSender">
<sm:component>
<bean
xmlns="http://xbean.org/schemas/spring/1.0"
class="org.servicemix.components.file.FileWriter">
<property name="directory"
value="outbox" />
<property
name="marshaler">
<bean
xmlns="http://xbean.org/schemas/spring/1.0"
class="org.servicemix.jbi.messaging.DefaultMarshaler">
</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
xmlns="http://xbean.org/schemas/spring/1.0"
class="org.servicemix.components.file.FilePoller">
<property
name="workManager" ref="workManager" />
<property name="file"
value="inbox" />
<property name="period"
value="1000" />
</bean>
</sm:component>
</sm:activationSpec>
</sm:activationSpecs>
</sm:container>
Thanks again.
Mat
"Guillaume Nodet" <[EMAIL PROTECTED]>
04/19/2006 05:08 PM
Please respond to
[email protected]
To
[email protected]
cc
Subject
Re: Help in reading text files using the file-Binding example
I think you are looking for the
org.servicemix.components.util.DefaultFileMarshaler which is a
FileMarshaler and has a fileName property.
Guillaume
On 4/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I in fact removed the fileName property, but there is another error
saying
> the DefaultMarshaler cannot be converted to FileWriter , with covertion
> error on property marshaler.
>
> I tried to track the org.servicemix.components.file.FileWriter class but
> couldn't find it.
>
> This is the link used to track the classes, hope Iam looking at the
> correct API.
>
> http://servicemix.org/maven/apidocs/allclasses-noframe.html
>
> ** Where can I see the api for
> org.servicemix.jbi.messaging.DefaultMarshaler class.
>
> I appreciate your quick response and good support.
>
> Thanks again.
>
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean wit
> h name 'org.servicemix.components.file.FileWriter#10849bc' defined in
file
> [C:\s
> ervicemix-2.0.2\examples\file-binding\servicemix.xml]: Error setting
> property va
> lues; nested exception is
> org.springframework.beans.PropertyAccessExceptionsExce
> ption: PropertyAccessExceptionsException (1 errors); nested
> propertyAccessExcept
> ions are: [org.springframework.beans.TypeMismatchException: Failed to
> convert pr
> operty value of type [org.servicemix.jbi.messaging.DefaultMarshaler] to
> required
> type [org.servicemix.components.util.FileMarshaler] for property
> 'marshaler']
> PropertyAccessExceptionsException (1 errors)
> org.springframework.beans.TypeMismatchException: Failed to convert
> property valu
> e of type [org.servicemix.jbi.messaging.DefaultMarshaler] to required
type
> [org.
> servicemix.components.util.FileMarshaler] for property 'marshaler'
> at
> org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary
> (BeanWrapperImpl.java:1103)
> at
> org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrappe
> rImpl.java:848)
> at
> org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrappe
> rImpl.java:733)
> at
> org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrappe
> rImpl.java:890)
> at
> org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapp
> erImpl.java:917)
> at
> org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapp
> erImpl.java:906)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBean
>
>
>
>
>
>
> "Guillaume Nodet" <[EMAIL PROTECTED]>
> 04/19/2006 04:41 PM
> Please respond to
> [email protected]
>
>
> To
> [email protected]
> cc
>
> Subject
> Re: Help in reading text files using the file-Binding example
>
>
>
>
>
>
> This error happens because there is no fileName property in the
> DefaultMarshaler class.
> In facts, the DefaultMarshaler does not have any properties you can
> configure.
>
> Cheers,
> Guillaume Nodet
>
> On 4/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > There was some space in front of the package. Once that was corrected,
> the
> > following error poped up.
> >
> > The Servicemix.xml file
> >
> > <sm:activationSpecs>
> >
> > <!-- Write files to the outbox directory -->
> > <sm:activationSpec componentName="fileSender"
> > service="foo:fileSender">
> > <sm:component>
> > <bean
> > xmlns="http://xbean.org/schemas/spring/1.0"
> > class="org.servicemix.components.file.FileWriter">
> > <property
> name="directory"
> > value="outbox" />
> > <property
> > name="marshaler">
> > <bean
> > class="
> > org.servicemix.jbi.messaging.DefaultMarshaler">
> > <property
> > name="fileName">
> > <bean
> > class="org.servicemix.expression.JaxenStringXPathExpression">
> > <constructor-arg
> > value="concat('sample_', /sample/@id, '.xml')" />
> > </bean>
> > </property>
> > </bean>
> > </property>
> > </bean>
> > </sm:component>
> > </sm:activationSpec>
> > Error :
> > [INFO] DefaultListableBeanFactory - Destroying singletons in factory
> > {org.spring
> > framework.beans.factory.support.DefaultListableBeanFactory defining
> beans
> > [jbi,w
> > orkManager]; root of BeanFactory hierarchy}
> > framework.beans.factory.support.DefaultListableBeanFactory defining
> beans
> > [jbi,w
> > orkManager]; root of BeanFactory hierarchy}
> > Caught: org.springframework.beans.factory.BeanCreationException: Error
> > creating
> > bean with name 'org.servicemix.jbi.messaging.DefaultMarshaler#dc57db'
> > defined in
> > file [C:\servicemix-2.0.2\examples\file-binding\servicemix.xml]:
Error
> > setting
> > property values; nested exception is
> > org.springframework.beans.NotWritableProper
> > tyException: Invalid property 'fileName' of bean class
> > [org.servicemix.jbi.messa
> > ging.DefaultMarshaler]: Bean property 'fileName' is not writable or
has
> an
> > inval
> > id setter method: Does the parameter type of the setter match the
return
> > type of
> > the getter?
> > org.springframework.beans.factory.BeanCreationException: Error
creating
> > bean wit
> > h name 'org.servicemix.jbi.messaging.DefaultMarshaler#dc57db' defined
in
> > file [C
> > :\servicemix-2.0.2\examples\file-binding\servicemix.xml]: Error
setting
> > property
> > values; nested exception is
> > org.springframework.beans.NotWritablePropertyExcept
> > ion: Invalid property 'fileName' of bean class
> > [org.servicemix.jbi.messaging.Def
> > aultMarshaler]: Bean property 'fileName' is not writable or has an
> invalid
> > sette
> > r method: Does the parameter type of the setter match the return type
of
> > the get
> > ter?
> > org.springframework.beans.NotWritablePropertyException: Invalid
property
> > 'fileNa
> > me' of bean class [org.servicemix.jbi.messaging.DefaultMarshaler]:
Bean
> > property
> > 'fileName' is not writable or has an invalid setter method: Does the
> > parameter
> > type of the setter match the return type of the getter?
> >
> > Thanks
> >
> >
> >
> >
> >
> > "Guillaume Nodet" <[EMAIL PROTECTED]>
> > 04/19/2006 02:14 PM
> > Please respond to
> > [email protected]
> >
> >
> > To
> > [email protected]
> > cc
> >
> > Subject
> > Re: Help in reading text files using the file-Binding example
> >
> >
> >
> >
> >
> >
> > Sorry, i mean
> > org.servicemix.jbi.messaging.DefaultMarshaler
> >
> > -- Guillaume
> >
> > On 4/19/06, Guillaume Nodet <[EMAIL PROTECTED]> wrote:
> > > Have you tried org.servicemix.jbi.message.DefaultMarshaler instead ?
> > >
> > > Cheers,
> > > Guillaume Nodet
> > >
> > > On 4/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > > Hi,
> > > > I need to read a text file with large content and move it to an
> > different
> > > > directory, Iam new to servicemix and need some tips / help as to
> which
> > > > class to use. The current example uses an xml file.
> > > >
> > > > When I tried using the DefaultMarshaler class with text content
> file,
> > It
> > > > throws java.lang.ClassNotFoundException:
> > > > org.servicemix.client.DefaultMarshaler error.
> > > >
> > > >
> > > > Thanks
> > > > Mat
> > > > <sm:activationSpec componentName="fileSender"
> > > > service="foo:fileSender">
> > > > <sm:component>
> > > > <bean
> > > > xmlns="http://xbean.org/schemas/spring/1.0"
> > > > class="org.servicemix.components.file.FileWriter">
> > > > <property
> > name="directory"
> > > > value="outbox" />
> > > > <property
> > > > name="marshaler">
> > > > <bean
> > > > class="
> > > > org.servicemix.client.DefaultMarshaler">
> > > > <property
> > > > name="fileName">
> > > > <bean
> > > > class="org.servicemix.expression.JaxenStringXPathExpression">
> > > > <constructor-arg
> > > > value="concat('sample_', /sample/@id, '.xml')" />
> > > > </bean>
> > > > </property>
> > > > </bean>
> > > > </property>
> > > > </bean>
> > > > </sm:component>
> > > > </sm:activationSpec>
> > > >
> > >
> >
> >
> >
>
>
>