Hi Bruce,

I tried implementing the DefaultFileMarshaller. The file compiles well. 
When I try to integrate that to servicemix.xml using the following 
configration. It throws an error.

<!--Flat File converter components-->

<sm:activationSpec componentName="flatfileConverter" 
service="foo:flatFile">

   <sm:component>
              <bean class="FFConverter">
                <property name="schema_file" value="rbc.rfl" />
                <property name="flat_file" value="rbc_push_small" />
                <property name="xml_file" value="output.xml" />
              </bean>
    </sm:component>
 
</sm:activationSpec>

<!--Flat File converter Component --> 


Error

orkManager]; root of BeanFactory hierarchy}
Caught: org.springframework.beans.factory.BeanCreationException: Error 
creating
bean with name 'jbi' defined in file 
[C:\servicemix-2.0.2\examples\file-binding\
servicemix.xml]: Initialization of bean failed; nested exception is 
java.lang.Il
legalArgumentException: Component name: flatfileConverter is bound to an 
object
which is not a JBI component, it is of type: FFConverter
org.springframework.beans.factory.BeanCreationException: Error creating 
bean wit
h name 'jbi' defined in file 
[C:\servicemix-2.0.2\examples\file-binding\servicem
ix.xml]: Initialization of bean failed; nested exception is 
java.lang.IllegalArg
umentException: Component name: flatfileConverter is bound to an object 
which is
 not a JBI component, it is of type: FFConverter
java.lang.IllegalArgumentException: Component name: flatfileConverter is 
bound t
o an object which is not a JBI component, it is of type: FFConverter
        at 
org.servicemix.jbi.container.JBIContainer.activateComponent(JBIContai
ner.java:786)
        at 
org.servicemix.jbi.container.SpringJBIContainer.afterPropertiesSet(Sp
ringJBIContainer.java:52)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1058)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:363)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:226)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:147)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:275)
        at 
org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:318)
        at 
org.xbean.spring.context.FileSystemXmlApplicationContext.<init>(FileS
ystemXmlApplicationContext.java:149)
        at 
org.xbean.spring.context.FileSystemXmlApplicationContext.<init>(FileS
ystemXmlApplicationContext.java:48)
        at org.servicemix.Main.main(Main.java:76)


Appreciate any info on this.

Thanks 
Mat





"Bruce Snyder" <[EMAIL PROTECTED]> 
04/21/2006 05:05 PM
Please respond to
[email protected]


To
[email protected]
cc

Subject
Re: Help in reading text files using the file-Binding example






On 4/21/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> A simple clarification, xml content is the one closest to  Normalized
> messages hence servicemix classes widely support that, but is there any
> classes which helps reading and writing text files with some default xml
> conversion before transfering it through NMR??

The DefaultMarshaler and the DefaultFileMarshaler both handle messages
that are already XML. Depending on what you need exactly, I'd
recommend extending one of the existing classes to build your own
marshaler.

The DefaultMarshaller extends PojoMarshaler which is for marshalling
java.lang.Objects which doesn't sound like what you want. On the other
hand, the DefaultFileMarshaler extends MarshalerSupport and implements
FileMarshaler. MarshalerSupport is for building a basic marshaler but
FileMarshaler is for converting a file to a normalized message.

It sounds to me like you should consider extending the
DefaultFileMarshaler to create your own FileMarshaler implementation
for transforming your text files. Your implementations of the
readMessage() and writeMessage() methods will transform the text file
content into a normalized message.

Bruce
--
perl -e 'print 
unpack("u30","D0G)[EMAIL PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://incubator.apache.org/activemq/
Apache ServiceMix - http://incubator.apache.org/servicemix/
Castor - http://castor.org/

Reply via email to