Announcement Announcement Module
Collapse
No announcement yet.
Converter problem with 1.1.1 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Converter problem with 1.1.1

    I have updated my Roo to 1.1.1 and then followed the instructions here:

    http://www.springsource.org/roo/guide?w=upgrade

    regarding converters.

    My drop downs are correctly dealing with Organisation using my new ApplicationConversionServiceFactoryBean, however, when I visit a Roo "Show" page I get this new exception:

    DEBUG BasicTilesContainer - Render request recieved for definition 'uncaughtException'
    ay_9(org.apache.jsp.WEB_002dINF.views.users.show_j spx:276)
    at org.apache.jsp.WEB_002dINF.views.users.show_jspx.a ccess$9(org.apache.jsp.WEB_002dINF.views.users.sho w_jspx:261)
    at org.apache.jsp.WEB_002dINF.views.users.show_jspx$s how_jspxHelper.invoke0(org.apache.jsp.WEB_002dINF. views.users.show_jspx:409)
    at org.apache.jsp.WEB_002dINF.views.users.show_jspx$s how_jspxHelper.invoke(org.apache.jsp.WEB_002dINF.v iews.users.show_jspx:435)
    at org.apache.jsp.tag.web.form.show_tagx._jspx_meth_c _when_1(org.apache.jsp.tag.web.form.show_tagx:730)
    at org.apache.jsp.tag.web.form.show_tagx._jspx_meth_c _choose_1(org.apache.jsp.tag.web.form.show_tagx:69 9)
    at org.apache.jsp.tag.web.form.show_tagx._jspx_meth_c _if_0(org.apache.jsp.tag.web.form.show_tagx:282)
    at org.apache.jsp.tag.web.form.show_tagx.doTag(org.ap ache.jsp.tag.web.form.show_tagx:240)
    at org.apache.jsp.WEB_002dINF.views.users.show_jspx._ jspx_meth_page_show_0(org.apache.jsp.WEB_002dINF.v iews.users.show_jspx:83)
    at org.apache.jsp.WEB_002dINF.views.users.show_jspx._ jspService(org.apache.jsp.WEB_002dINF.views.users. show_jspx:53)
    at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:93)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:820)
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:373)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:470)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:364)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:820)
    at org.mortbay.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler.handle(Se rvletHandler.java:362)
    at org.mortbay.jetty.security.SecurityHandler.handle( SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(Se ssionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(Co ntextHandler.java:722)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebA ppContext.java:404)
    at org.mortbay.jetty.servlet.Dispatcher.include(Dispa tcher.java:192)
    at org.apache.jasper.runtime.JspRuntimeLibrary.includ e(JspRuntimeLibrary.java:997)
    at org.apache.jasper.runtime.PageContextImpl.include( PageContextImpl.java:682)
    at org.apache.tiles.jsp.context.JspTilesRequestContex t.include(JspTilesRequestContext.java:103)
    ... 95 more
    Caused by: org.springframework.expression.spel.SpelEvaluation Exception: EL1001Epos 0): Type conversion problem, cannot convert from [TypeDescriptor @javax.persistence.ManyToOne @javax.persistence.JoinColumn com.linguisys.pb.domain.users.Organisation] to [TypeDescriptor java.lang.String]
    at org.springframework.expression.spel.support.Standa rdTypeConverter.convertValue(StandardTypeConverter .java:73)
    at org.springframework.expression.common.ExpressionUt ils.convertTypedValue(ExpressionUtils.java:67)
    at org.springframework.expression.spel.standard.SpelE xpression.getValue(SpelExpression.java:98)
    at org.springframework.web.servlet.tags.EvalTag.doEnd Tag(EvalTag.java:113)
    at org.apache.jsp.tag.web.form.fields.display_tagx._j spx_meth_spring_eval_0(org.apache.jsp.tag.web.form .fields.display_tagx:653)
    at org.apache.jsp.tag.web.form.fields.display_tagx._j spx_meth_c_otherwise_0(org.apache.jsp.tag.web.form .fields.display_tagx:627)
    at org.apache.jsp.tag.web.form.fields.display_tagx._j spx_meth_c_choose_0(org.apache.jsp.tag.web.form.fi elds.display_tagx:429)
    at org.apache.jsp.tag.web.form.fields.display_tagx._j spx_meth_c_if_0(org.apache.jsp.tag.web.form.fields .display_tagx:248)
    at org.apache.jsp.tag.web.form.fields.display_tagx.do Tag(org.apache.jsp.tag.web.form.fields.display_tag x:202)
    ... 121 more
    Caused by: org.springframework.core.convert.ConverterNotFound Exception: No converter found capable of converting from 'com.linguisys.pb.domain.users.Organisation' to 'java.lang.String'
    at org.springframework.core.convert.support.GenericCo nversionService.convert(GenericConversionService.j ava:180)
    at org.springframework.expression.spel.support.Standa rdTypeConverter.convertValue(StandardTypeConverter .java:70)
    ... 129 more

    It seems as though the GenericConversionService used by the EL evaluator might not be picking up my custom converters.

    Any ideas? Is this a bug or am I doing something wrong?

  • #2
    Spring-JMS

    Hi,
    i am getting the same error even though my xml is not containing any weired characters. below is my xml

    <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:str="http://sungard.com/streamservice/">
    <soapenv:Header/>
    <soapenv:Body>
    <str:AccountMessage>
    <str:Operation>InsertAccount</str:Operation>
    <str:Key>
    <str:sourceSystem>MFG</str:sourceSystem>
    <str:entity>MANINT</str:entity>
    <str:accountAlias>EFP8205</str:accountAlias>
    <str:accountAliasType>Account Number</str:accountAliasType>
    <str:instance>MANINT</str:instance>
    </str:Key>
    <str:Message>
    <str:Account>
    <str:AccountDetail>
    <str:registration>*</str:registration>
    <str:name>Symadis Capital Managementt</str:name>
    <str:shortName>SYMADIS CAP</str:shortName>
    <str:accountClass>CLIENT</str:accountClass>
    <str:generation>2010-08-04</str:generation>
    <str:office>EFP01</str:office>
    <str:dateOpened>2010-08-04</str:dateOpened>
    <str:identificationTypeId>1</str:identificationTypeId>
    <str:reportingCurrency>USD</str:reportingCurrency>
    </str:AccountDetail>
    <str:AccountAddress>
    <str:address>
    <str:address>SYMADIS Capital Management SA,Attn: Alessandra Busnardo,Via Cattedrale 9,6900 Lugano,Switzerland</str:address>
    <str:isoCountry>CH</str:isoCountry>
    </str:address>
    <str:addressType>Billing</str:addressType>
    <str:addressOrder>1</str:addressOrder>
    </str:AccountAddress>
    <str:AccountRegisteredRep>
    <str:office>EFP01</str:office>
    <str:registeredRep>MAQU</str:registeredRep>
    <strrimaryRepInd>Y</strrimaryRepInd>
    </str:AccountRegisteredRep>
    <str:AccountGroup>
    <str:groupDescription>SYMADIS CAP</str:groupDescription>
    <str:groupNumberType>Combined</str:groupNumberType>
    </str:AccountGroup>
    </str:Account>
    </str:Message>
    </str:AccountMessage>
    </soapenv:Body>
    </soapenv:Envelope>


    and error stock is


    org.springframework.jms.support.converter.MessageC onversionException: Could not unmarshal message [BytesMessage[ID:<458751.1297761484537.0>]]; nested exception is org.springframework.oxm.jaxb.JaxbUnmarshallingFail ureException: JAXB unmarshalling exception: null; nested exception is javax.xml.bind.Un
    marshalException
    - with linked exception:
    [org.xml.sax.SAXParseException: Content is not allowed in prolog.]
    at org.springframework.oxm.support.MarshallingMessage Converter.fromMessage(MarshallingMessageConverter. java:186)
    at org.springframework.jms.listener.adapter.MessageLi stenerAdapter.extractMessage(MessageListenerAdapte r.java:410)
    at org.springframework.jms.listener.adapter.MessageLi stenerAdapter.onMessage(MessageListenerAdapter.jav a:349)
    at org.springframework.jms.listener.AbstractMessageLi stenerContainer.doInvokeListener(AbstractMessageLi stenerContainer.java:518)
    at org.springframework.jms.listener.AbstractMessageLi stenerContainer.invokeListener(AbstractMessageList enerContainer.java:479)
    at org.springframework.jms.listener.AbstractMessageLi stenerContainer.doExecuteListener(AbstractMessageL istenerContainer.java:451)
    at org.springframework.jms.listener.AbstractPollingMe ssageListenerContainer.doReceiveAndExecute(Abstrac tPollingMessageListenerContainer.java:323)
    at org.springframework.jms.listener.AbstractPollingMe ssageListenerContainer.receiveAndExecute(AbstractP ollingMessageListenerContainer.java:261)
    at org.springframework.jms.listener.DefaultMessageLis tenerContainer$AsyncMessageListenerInvoker.invokeL istener(DefaultMessageListenerContainer.java:982)
    at org.springframework.jms.listener.DefaultMessageLis tenerContainer$AsyncMessageListenerInvoker.execute OngoingLoop(DefaultMessageListenerContainer.java:9 74)
    at org.springframework.jms.listener.DefaultMessageLis tenerContainer$AsyncMessageListenerInvoker.run(Def aultMessageListenerContainer.java:876)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.springframework.oxm.jaxb.JaxbUnmarshallingFail ureException: JAXB unmarshalling exception: null; nested exception is javax.xml.bind.UnmarshalException
    - with linked exception:
    [org.xml.sax.SAXParseException: Content is not allowed in prolog.]
    at org.springframework.oxm.jaxb.JaxbUtils.convertJaxb Exception(JaxbUtils.java:75)
    at org.springframework.oxm.jaxb.AbstractJaxbMarshalle r.convertJaxbException(AbstractJaxbMarshaller.java :143)
    at org.springframework.oxm.jaxb.Jaxb2Marshaller.unmar shal(Jaxb2Marshaller.java:399)
    at org.springframework.oxm.jaxb.Jaxb2Marshaller.unmar shal(Jaxb2Marshaller.java:383)
    at org.springframework.oxm.support.MarshallingMessage Converter.unmarshalFromBytesMessage(MarshallingMes sageConverter.java:285)
    at org.springframework.oxm.support.MarshallingMessage Converter.fromMessage(MarshallingMessageConverter. java:179)
    ... 11 more
    Caused by: javax.xml.bind.UnmarshalException
    - with linked exception:
    [org.xml.sax.SAXParseException: Content is not allowed in prolog.]
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.cr eateUnmarshalException(AbstractUnmarshallerImpl.ja va:315)
    at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.createUnmarshalException(UnmarshallerImpl. java:506)
    at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.unmarshal0(UnmarshallerImpl.java:215)
    at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.unmarshal(UnmarshallerImpl.java:184)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.un marshal(AbstractUnmarshallerImpl.java:137)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.un marshal(AbstractUnmarshallerImpl.java:105)
    at org.springframework.oxm.jaxb.Jaxb2Marshaller.unmar shal(Jaxb2Marshaller.java:395)
    ... 14 more
    Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.createSAXParseException(ErrorHandlerWrap per.java:236)
    at com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.fatalError(ErrorHandlerWrapper.java:215)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorRe porter.reportError(XMLErrorReporter.java:386)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorRe porter.reportError(XMLErrorReporter.java:316)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner .reportFatalError(XMLScanner.java:1438)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumen tScannerImpl$PrologDispatcher.dispatch(XMLDocument ScannerImpl.java:899)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl.scanDocument(XMLDocumentFragm entScannerImpl.java:368)
    at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:834)
    at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:764)
    at com.sun.org.apache.xerces.internal.parsers.XMLPars er.parse(XMLParser.java:148)
    at com.sun.org.apache.xerces.internal.parsers.Abstrac tSAXParser.parse(AbstractSAXParser.java:1242)
    at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogic XMLReader.java:133)
    at weblogic.xml.jaxp.RegistryXMLReader.parse(Registry XMLReader.java:153)
    at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.unmarshal0(UnmarshallerImpl.java:211)
    ... 18 more


    I am stuggling with this problem from last 15 days, plz help..

    Thanks in advance.

    Regards,
    Gangadhar

    Comment


    • #3
      Erm... Gangadhar... That's not the same problem!

      Comment


      • #4
        Adam, can you post the content of your webmvc-config.xml, ApplicationConversionServiceFactoryBean.java, and ApplicationConversionServiceFactoryBean_Roo_Conver sionService.aj surrounded with [CODE] tags?

        Comment


        • #5
          The resources you asked for...

          I update the Jira issue with the resources you asked for... thanks.

          Comment

          Working...
          X