2 Replies Latest reply on Jul 22, 2011 5:40 AM by Julian Cable

    Specifying beans

    Julian Cable Newbie



        I have a POJO which is a custom xml de-marshaller. The de-marshall method signature is:



      mypackage.EPG transform(org.w3c.dom.Document body)


         mypackage.EPG epg = new mypackage.EPG();


         return epg



      It works in this context:




      And they all say they either can't find a matching method or they can't find the transform method.


      How would I get rid of the @Handler annotation ?



        • 1. Re: Specifying beans
          Claus Ibsen Master

          What kind of exceptions / errors do you see?


          And make sure your method is public.

          Does your bean extend some other classes?


          And what version of Camel are you using?

          • 2. XML parsing - was Re: Specifying beans
            Julian Cable Newbie

            Hi Claus,


              not getting the error now. Weird. I haven't tried all combinations, but it is working without the @Handler.


            I get a different problem now.


            My xml file has an embedded:


            <!DOCTYPE dataimport PUBLIC "-//Broadcasting Datasystems//Import Format v1.0//EN"



            If I'm offline, or firewalled, I get a


            java.net.UnknownHostException: www.broadcastingdata.com


            Which comes from

                 at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)

                 at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)

                 at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)

                 at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)

                 at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)

                 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

                 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

                 at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)

                 at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

                 at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)

                 at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)

                 at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208)

                 at bbc.wsinteg.BDSTest.testParse_epg_file(BDSTest.java:209)


            These files are generated outside my control. I'd hate to have to pass them through a non-camel XML transform just to comment out the DOCTYPE so camel could read them.


            I can't find a way of catching this exception, and still having the document parsed.


            Any ideas?