ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbi joe <...@daggerpoint.net>
Subject Re: about custom mappers
Date Sat, 01 Sep 2007 09:11:27 GMT

Mine is a hack job to make the Servicemix mapper understand a
SoapMessage that has a Body consisting of an ever changing
XML Document.  I am unsure if my change is going
to be an acceptable alteration, although it is working thus
far.  I am still experiencing problems when I try to alter the
contents of the Document in the Body via a XSL transformation.
I get so much exception dump I dunno if its the processing of
my document or my code changes to the mapper...  :)
Im truely hackin it as I go.   Its my opinion that what IM doing
is NOT the correct solution.   However, my trials and tribulations
may be of use to an authoritive ODE developer.   I have some
BPEL that attems to do a "doXSLtransfrom on the SOAPMEssage
and its not working yet....  However, I am past the point where
the ODE engine dies because it cant find a MAPPER.   Any help
is greatly appreciated.   I have also noted that the "getUserData" gets
stomped on somewhere in the mapper process, but I have not
found where.  SO I have chosen to avoid using that XML feature.
TIA


Alex Boisvert wrote:
> 
> I'm all for extending the usefulness of the mappers... if you want to
> share your extensions/customizations we can bring them back into Ode
> (assuming they can apply to others).
> 
> Simply open a jira issue with your code (even if experimental) and a
> description of what it does and what you're trying to achieve.
> 
> alex
> 
> On 8/31/07, jbi joe <joe@daggerpoint.net> wrote:
>>
>> I have done the same thing.
>> WHy isnt there more flexibility with mappers?
>> I need a mapper to be able to process soapmessages
>> that contain Documents with attachments and user data.
>>
>>
>> eburgos wrote:
>> >
>> > Tried in several ways and I got the same error, I ended up temporarily
>> > modifying ServiceMixMapper class cause I'm in a hurry :(
>> >
>> >
>> >
>> > On 8/28/07, Alex Boisvert <boisvert@intalio.com> wrote:
>> >>
>> >> Then you most likely have a classloading problem: different versions
>> of
>> >> the
>> >> Mapper interface in different classloaders.  The easiest solution is
>> to
>> >> place your Mapper class in the ode-jbi.jar.
>> >>
>> >> alex
>> >>
>> >>
>> >> On 8/28/07, Eduardo Burgos <eburgos@gmail.com> wrote:
>> >> >
>> >> > I see this in OdeLifeCycle.java line 148
>> >> >
>> >> > try {
>> >> >             _ode.registerMapper((Mapper) mapperClass.newInstance());
>> >> >         } catch (Throwable t) {
>> >> >             String errmsg =
>> >> >
>> >> >
>> >>
>> __msgs.msgOdeInitMapperInstantiationFailed(_ode._config.getMessageMapper());
>> >> >             __log.error(errmsg);
>> >> >             throw new JBIException(errmsg, t);
>> >> >         }
>> >> >
>> >> > it catches an exception there, in the debugger I saw that Throwable
>> t
>> >> was
>> >> > actually a ClassCastException. I tried the class with a public no
>> >> argument
>> >> > constructor, the errors differ a little but it ends up being a
>> >> > ClassCastException at the same point too. I know for sure that my
>> class
>> >> is
>> >> > a
>> >> > Mapper because it inherits the ServiceMixMapper.
>> >> >
>> >> >
>> >> >
>> >> > On 8/28/07, Alex Boisvert <boisvert@intalio.com> wrote:
>> >> > >
>> >> > > Does your class have a public no-argument constructor?   Ode uses
>> >> > > Class.newInstance() to create instances of Mapper classes.   Also,
>> >> check
>> >> > > your log file again, I think there must be a more specific error
>> >> message
>> >> > > just above/below the error statement you sent.
>> >> > >
>> >> > > alex
>> >> > >
>> >> > >
>> >> > > On 8/28/07, Eduardo Burgos <eburgos@gmail.com> wrote:
>> >> > > >
>> >> > > > Is there a way to change the default ServicemixMapper to
another
>> >> class
>> >> > > of
>> >> > > > your own? It seems that editing ode-jbi.properties wont do
>> >> much.Iedited
>> >> > > > with my own class name and I got this at startup:
>> >> > > >
>> >> > > > ERROR - ComponentMBeanImpl             - Could not start
>> component
>> >> > > > javax.jbi.JBIException: Message mapper class "
>> >> > > > org.test.ode.CustomOdeServicemixMapper" could not be
>> instantiated!
>> >> > > >         at org.apache.ode.jbi.OdeLifeCycle.initMappers(
>> >> > OdeLifeCycle.java
>> >> > > > :153)
>> >> > > >         at
>> org.apache.ode.jbi.OdeLifeCycle.init(OdeLifeCycle.java
>> >> :104)
>> >> > > >         at
>> >> org.apache.servicemix.jbi.framework.ComponentMBeanImpl.init
>> >> > (
>> >> > > > ComponentMBeanImpl.java:200)
>> >> > > >         at
>> >> > > org.apache.servicemix.jbi.framework.ComponentMBeanImpl.doStart(
>> >> > > > ComponentMBeanImpl.java:286)
>> >> > > >         at
>> >> > org.apache.servicemix.jbi.framework.ComponentMBeanImpl.start(
>> >> > > > ComponentMBeanImpl.java:215)
>> >> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> >> Method)
>> >> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke(
>> >> > > > NativeMethodAccessorImpl.java:39)
>> >> > > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>> >> > > > DelegatingMethodAccessorImpl.java:25)
>> >> > > >         at java.lang.reflect.Method.invoke(Method.java:585)
>> >> > > >         at
>> org.apache.commons.beanutils.MethodUtils.invokeMethod(
>> >> > > > MethodUtils.java:216)
>> >> > > >
>> >> > > >
>> >> > > > My class goes as follows:
>> >> > > >
>> >> > > > public class CustomOdeServicemixMapper extends ServiceMixMapper
>> {
>> >> > > >
>> >> > > >
>> >> > > >     @Override
>> >> > > >     public void toNMS(NormalizedMessage nms, Message odeMsg,
>> >> > > > javax.wsdl.Message msgdef, QName fault) throws
>> MessagingException,
>> >> > > > MessageTranslationException {
>> >> > > >
>> >> > > >         //Some code here
>> >> > > >
>> >> > > >         super.toNMS(nms, odeMsg, msgdef, fault);
>> >> > > >     }
>> >> > > > }
>> >> > > >
>> >> > > >
>> >> > > >
>> >> > > >
>> >> > > > Any ideas?
>> >> > > >
>> >> > > > Thanks in advance,
>> >> > > >
>> >> > >
>> >> >
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/about-custom-mappers-tf4342420.html#a12431015
>> Sent from the Apache Ode User mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/about-custom-mappers-tf4342420.html#a12438619
Sent from the Apache Ode User mailing list archive at Nabble.com.


Mime
View raw message