Announcement Announcement Module
Collapse
No announcement yet.
Problem with DOMResult - Content is not allowed in prolog Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with DOMResult - Content is not allowed in prolog

    Hello Guys

    I have the follow code (match the colors yourself for a better understanding)

    Code:
    @Component
    public class Cliente  {	
    	
    	private static final long serialVersionUID = 1L;
    	
    	private String nombres;
    	private String apellidos;
    	private Integer edad;
    	private Double peso;
    	private BigDecimal credito;
    	private Date fechaNacimiento;
    	
    	public Cliente(){
    		
    	}
            ... setters/getters and toString()
    }
    
    @Bean
    public CastorMarshaller castorMarshaller(){
    	return new CastorMarshaller();
    }
    
    <int-xml:marshalling-transformer 
                marshaller="castorMarshaller"
    	    result-type="StringResult"
    	    input-channel="input"
    	    output-channel="xml"									 								 	
    	/>
    	
    <int-xml:unmarshalling-transformer 
                unmarshaller="castorMarshaller"
    	    input-channel="xml-string"
    	    output-channel="output"
    	/>
    	
    <int:object-to-string-transformer 
          input-channel="xml"
          output-channel="xml-string" />
    
    ...
    
    <int:channel id="xml">
    	<int:interceptors>
    		<int:wire-tap channel="logger01"/>
    	</int:interceptors>
    </int:channel>
    The code work , in my Main class I have

    Code:
    MessageChannel input = context.getBean("input", MessageChannel.class );
    PollableChannel output = context.getBean("output", PollableChannel.class );
    	
    Cliente cliente = new Cliente();		
    cliente.setNombres("Manuel");
    cliente.setApellidos("Jordan");		
    cliente.setEdad(30);		
    cliente.setPeso(70.01);
    cliente.setCredito(new BigDecimal("150.85"));
    cliente.setFechaNacimiento( new Date());
    
    Message<?> messageAltern01 = MessageBuilder.withPayload(cliente).build();
    input.send(messageAltern01);
    		
    Message<?> replyAltern01 = output.receive();		
    logger.info("Mensaje Recibido replyAltern01.toString(){}", replyAltern01.toString());
    I can confirm through the logging-channel-adapter and wire-tap the follow ( I am changing the presentation to let show the output friendly)

    Code:
    2011-07-11 12:19:30,329 INFO [org.springframework.integration.handler.LoggingHandler] - 
    <[Payload=<?xml version="1.0" encoding="UTF-8"?>
    <cliente>
    <apellidos>Jordan</apellidos>
    <fecha-nacimiento>2011-07-11T12:19:29.923-05:00</fecha-nacimiento><nombres>Manuel</nombres>
    <peso>70.01</peso>
    <edad>30</edad>
    <credito>150.85</credito>
    </cliente>]
    [Headers={timestamp=1310404770329, 
    id=4c20555b-0e1b-4292-bdd9-4baa3d99e449}]>
    Therefore the transformation is well done

    The problem is if I change only one line

    Code:
    <int-xml:marshalling-transformer 
                marshaller="castorMarshaller"
    	    result-type="DOMResult"
    	    input-channel="input"
    	    output-channel="xml"								 	
    	/>
    DOMResult is the default used by Spring Integration

    I get this output error ( I am changing the presentation to let show the output friendly)

    Code:
    ...
    2011-07-11 12:28:34,563 INFO [org.springframework.integration.handler.LoggingHandler] - 
    <[Payload=javax.xml.transform.dom.DOMResult@179953c]
    [Headers={timestamp=1310405314563, id=87444587-14d3-41a8-b15b-439d6e44f1c8}]>
    
    2011-07-11 12:28:34,563 INFO [org.springframework.integration.handler.LoggingHandler] - 
    <[Payload=javax.xml.transform.dom.DOMResult@179953c]
    [Headers={timestamp=1310405314563, id=d5fae7c1-42a8-4022-8d59-c658e8f87cf3}]>
    
    Exception in thread "main" org.springframework.integration.transformer.MessageTransformationException: 
    failed to transform message
    	at org.springframework.integration.transformer.AbstractTransformer.transform(AbstractTransformer.java:44)
    ...
    
    Caused by: org.springframework.oxm.UnmarshallingFailureException: 
    Castor unmarshalling exception; nested exception is 
    org.exolab.castor.xml.MarshalException: 
    Content is not allowed in prolog.{File: [not available]; line: 1; column: 1}
    	at org.springframework.oxm.castor.CastorMarshaller.convertCastorException(CastorMarshaller.java:487)
    ...
    
    Caused by: org.exolab.castor.xml.MarshalException: 
    Content is not allowed in prolog.{File: [not available]; line: 1; column: 1}
    	at org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarshaller.java:761)
    ...
    
    Caused by: org.xml.sax.SAXParseException: 
    Content is not allowed in prolog.
    	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    What is wrong or missing on my Configuration?, it could be this be a bug?

    Bear in mind I just changed StringResult to DOMResult

    Thanks in advanced

  • #2
    it seems like Castor has problem with your XML

    org.exolab.castor.xml.MarshalException:
    Content is not allowed in prolog.{File: [not available]; line: 1; column: 1}

    Could you try to create DOMResult and send it to Castor outside of SI, just to verify?

    Comment


    • #3
      Hello Oleg

      Thanks again for the reply


      it seems like Castor has problem with your XML
      Seems yes or perhaps is org.springframework.oxm.castor.CastorMarshaller

      I am working with

      Code:
      <!-- Castor -->
      <dependency>
      	<groupId>org.codehaus.castor</groupId>
       	<artifactId>castor</artifactId>
          	<version>1.2</version>
      </dependency>
      <!-- Castor - Xerces -->		
      <dependency>
          	<groupId>xerces</groupId>
          	<artifactId>xercesImpl</artifactId>
          	<version>2.9.1</version>
      </dependency>
      The last availables for each one

      Could you try to create DOMResult and send it to Castor outside of SI, just to verify?
      Something similar to this?

      Code:
      public class EchoTransformer {
      
      	public Node asDOMNode(DOMResult o) {
      		Node node = o.getNode();
      		System.out.println("** Log: Inside Transformer");
      		System.out.println(node);
      		System.out.println("**");
      		return node;
      	}
      	public String asString(Object o) {
      		String str = o.toString();
      		System.out.println("** Log: Inside Transformer");
      		System.out.println(str);
      		System.out.println("**");
      		return str;
      	}
      }
      I am taking referencing from this thread, If I am wrong pls let me know
      Thread: marshalling-transformer returns null for DOMResult and xml for StringResult

      Thank you

      Comment


      • #4
        Well, i still think its your XML as it all comes down to this:

        Caused by: org.xml.sax.SAXParseException:
        Content is not allowed in prolog.
        at org.apache.xerces.util.ErrorHandlerWrapper.createS AXParseException(Unknown Source)

        Why do you need to specify xerses dependency in the first place? Its part of JDK since 1.5 right?

        Comment


        • #5
          Hello Oleg

          Well, i still think its your XML as it all comes down to this:
          Agree

          Why do you need to specify xerses dependency in the first place? Its part of JDK since 1.5 right?
          I am working with STS 2.6.1 and using jdk1.6.0_21

          I though like you about only adding the Castor dependency but I receive this exception when I try to run my application

          Code:
          Caused by: java.lang.RuntimeException: 
          Could not instantiate serializer org.apache.xml.serialize.XMLSerializer: 
          java.lang.ClassNotFoundException: org.apache.xml.serialize.XMLSerializer
            at org.exolab.castor.xml.XercesSerializer.<init>(XercesSerializer.java:50)

          Comment


          • #6
            Can you try to upgrade to castor 1.3.2 ?

            Comment


            • #7
              Hello Oleg

              Can you try to upgrade to castor 1.3.2 ?
              I tried but we have a problem, STS use MvnRepository

              And from there doing a simple search with org.codehaus.castor pattern
              and selecting from the result list

              Castor
              org.codehaus.castor castor
              I go to

              home org.codehaus.castor castor

              Where is shown

              Code:
              Available versions
              
              Version      Type               Download
              1.3.2        release 	        Binary (0 bytes)
              1.3.1        release 	        Binary (0 bytes)
              1.3.0.1      release 	        Binary (0 bytes)
              1.3          release 	        Binary (0 bytes)
              1.3rc1       release candidate 	Binary (0 bytes)
              1.2          release 	        Binary (845 KB) 
              Therefore if I select 1.3.2 my STS output console show

              Code:
              11/07/11 01:16:32 PM COT: Missing artifact org.codehaus.castor:castor:jar:1.3.2:compile
              11/07/11 11:28:53 AM COT: Downloaded http://repository.codehaus.org/com/springsource/bundlor/com.springsource.bundlor.maven/1.0.0.RELEASE/com.springsource.bundlor.maven-1.0.0.RELEASE.pom
              11/07/11 11:28:53 AM COT: [WARN] The POM for com.springsource.bundlor:com.springsource.bundlor.maven:jar:1.0.0.RELEASE is missing, no dependency information available
              11/07/11 12:19:28 PM COT: [WARN] The POM for com.springsource.bundlor:com.springsource.bundlor.maven:jar:1.0.0.RELEASE is missing, no dependency information available
              11/07/11 12:28:32 PM COT: [WARN] The POM for com.springsource.bundlor:com.springsource.bundlor.maven:jar:1.0.0.RELEASE is missing, no dependency information available
              11/07/11 12:32:20 PM COT: [WARN] The POM for com.springsource.bundlor:com.springsource.bundlor.maven:jar:1.0.0.RELEASE is missing, no dependency information available
              11/07/11 12:33:02 PM COT: [WARN] The POM for com.springsource.bundlor:com.springsource.bundlor.maven:jar:1.0.0.RELEASE is missing, no dependency information available
              11/07/11 01:16:30 PM COT: Refreshing [/integrationtransformationsenrichment/pom.xml]
              11/07/11 01:16:32 PM COT: Downloaded http://repo1.maven.org/maven2/org/codehaus/castor/castor/1.3.2/castor-1.3.2.jar
              Thats why I use 1.2

              How I should handle this?

              Comment


              • #8
                Strange, i got the same error
                Could you place a question on Castor mailing list http://www.castor.org/news.html and see what they say?

                Comment


                • #9
                  Strange, i got the same error
                  Could you place a question on Castor mailing list http://www.castor.org/news.html and see what they say?
                  OK, it will be done, I will share the reply here

                  Best Regards

                  Comment


                  • #10
                    Problems

                    I have problems

                    I already did my subscription to http://xircles.codehaus.org/ which is required to send emails to
                    • [email protected] - User mailing list
                    • [email protected] - Development mailing list

                    But I always got


                    Hi. This is the qmail-send program at mail.codehaus.org.
                    I'm afraid I wasn't able to deliver your message to the following addresses.
                    This is a permanent error; I've given up. Sorry it didn't work out.

                    <[email protected]>:
                    Sorry, only subscribers may post. If you are a subscriber, please forward this message to [email protected] to get your new address included. (#5.7.2)
                    and

                    Hi. This is the qmail-send program at mail.codehaus.org.
                    I'm afraid I wasn't able to deliver your message to the following addresses.
                    This is a permanent error; I've given up. Sorry it didn't work out.

                    <[email protected]>:
                    Sorry, only subscribers may post. If you are a subscriber, please forward this message to [email protected] to get your new address included. (#5.7.2)
                    I already sent to the two emails suggested but none reply yet

                    Even I sent an email to two committers and nothing

                    This is out of my hands

                    Comment


                    • #11
                      JIRA Castor Created

                      After to send some emails to the Castor committers

                      A friendly person just created a Castor Jira account for me

                      A JIRA account has been created for you at:

                      https://jira.codehaus.org

                      This is either because an administrator has created an account for you,
                      or because you have been assigned to an issue.
                      The JIRA created about Castor (done by myself) is
                      https://jira.codehaus.org/browse/CASTOR-3145

                      I hope this be reason of my situation about DOMResult, this was a weird day

                      Best Regards Oleg

                      Comment


                      • #12
                        Updated but no work DOMResult yet

                        Hello Oleg

                        A day of surprises. Really was not a bug. In JIRA Castor 1.3.1 is not available on MvnRepository
                        Said

                        Basically, the 'castor' artefact turns out to be the root POM of the complete project. If you are interested in e.g. XML data binding, please have a look at the castor-xml artefact, where you'll find all past releases.
                        Wondered why a simple message was not included somewhere, anyway

                        In Castor's mailing list I have the follow
                        Castor 1.3.1 is not available on MvnRepository
                        (seems Castor has a bug or its new 1.3.2 API has a new behaviour against 1.2, why?, see below my results)

                        Therefore I changed from

                        Code:
                        <!-- Castor -->
                        <dependency>
                            <groupId>org.codehaus.castor</groupId>
                            <artifactId>castor</artifactId>
                            <version>1.2</version>
                        </dependency>
                        <!-- Castor - Xerces -->
                        <dependency>
                            <groupId>xerces</groupId>
                            <artifactId>xercesImpl</artifactId>
                            <version>2.9.1</version>
                        </dependency>
                        To only to

                        Code:
                        <dependency>
                            <groupId>org.codehaus.castor</groupId>
                            <artifactId>castor-xml</artifactId>
                            <version>1.3.2</version>
                        </dependency>
                        I got the same exception working with castor-xml and DOMResult!

                        Code:
                        2011-07-12 12:41:40,296 INFO [org.springframework.integration.handler.LoggingHandler] - 
                        <[Payload=javax.xml.transform.dom.DOMResult@14a7a12]
                        [Headers={timestamp=1310492500296, id=fa7359ae-6384-4413-bc4b-1489603560be}]>
                        
                        2011-07-12 12:41:40,296 INFO [org.springframework.integration.handler.LoggingHandler] - 
                        <[Payload=javax.xml.transform.dom.DOMResult@14a7a12]
                        [Headers={timestamp=1310492500296, id=76f33ec9-05a3-4e9e-bbcf-66c000b4c2c8}]>
                        
                        Exception in thread "main" 
                        org.springframework.integration.transformer.MessageTransformationException: 
                        failed to transform message
                        	at org.springframework.integration.transformer.AbstractTransformer.transform(AbstractTransformer.java:44)
                        ....
                        
                        Caused by: org.springframework.oxm.UnmarshallingFailureException: 
                        Castor unmarshalling exception; 
                        nested exception is org.exolab.castor.xml.MarshalException: 
                        Content is not allowed in prolog.{File: [not available]; line: 1; column: 1}
                        	at org.springframework.oxm.castor.CastorMarshaller.convertCastorException(CastorMarshaller.java:487)
                        ....
                        
                        Caused by: org.exolab.castor.xml.MarshalException: 
                        Content is not allowed in prolog.{File: [not available]; line: 1; column: 1}
                        	at org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarshaller.java:866)
                        
                        Caused by: org.xml.sax.SAXParseException: 
                        Content is not allowed in prolog.
                        	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
                        Now if I use this *Echo*

                        Code:
                        @Component
                        public class EchoTransformer {
                        
                        	private static final Logger logger = LoggerFactory.getLogger(EchoTransformer.class);
                        	
                        	public Node showAsDOMNode(DOMResult domResult) {
                        		Node node = domResult.getNode();
                        		logger.info("*** asDOMNode");
                        		System.out.println(node);
                        		logger.info(node.toString());
                        		logger.info("***");
                        		return node;
                        	}
                        	public String showAsString(Object object) {
                        		String string = object.toString();
                        		System.out.println("** Log: Inside Transformer");
                        		System.out.println(string);
                        		logger.info("***");
                        		return string;
                        	}
                        	
                        }
                        Therefore I must work now in this way (I just created an altern file to add these changes about the new Transformer and re order the input/ouput channels for each transformer)

                        Code:
                        <int-xml:marshalling-transformer 
                                    marshaller="castorMarshaller"
                        	    result-type="DOMResult"
                        	    input-channel="input"
                        	    output-channel="xml"								 	
                        	/>
                        	 
                        <int:transformer input-channel="xml"
                        		       output-channel="dom"
                        		       ref="echoTransformer"
                        		       method="showAsDOMNode"
                        	/>
                        	 
                        <int-xml:unmarshalling-transformer 
                                    unmarshaller="castorMarshaller"
                        	    input-channel="xml-string"
                        	    output-channel="output"
                        />
                        	
                        <int:object-to-string-transformer 
                                        input-channel="dom"
                        		output-channel="xml-string" />
                        I have the same exception shown above but showing now

                        Code:
                        2011-07-12 12:58:58,484 INFO [org.springframework.integration.handler.LoggingHandler] - 
                        <[Payload=javax.xml.transform.dom.DOMResult@118fa47]
                        [Headers={timestamp=1310493538484, id=8d81c1a1-65dc-424c-b49f-1fcf37fb6cf7}]>
                        
                        2011-07-12 12:58:58,500 INFO [com.manuel.jordan.main.transformers.echo.EchoTransformer] - 
                        <*** asDOMNode>
                        [#document: null]
                        2011-07-12 12:58:58,500 INFO [com.manuel.jordan.main.transformers.echo.EchoTransformer] - 
                        <[#document: null]>
                        2011-07-12 12:58:58,500 INFO [com.manuel.jordan.main.transformers.echo.EchoTransformer] - 
                        <***>
                        2011-07-12 12:58:58,500 INFO 
                        
                        [org.springframework.integration.handler.LoggingHandler] - 
                        <[Payload=[#document: null]]
                        [Headers={timestamp=1310493538500, id=8c224986-af14-4a00-98dd-4360254cd34d}]>
                        ... Rest of the same exception shown above in red
                        Compare the second blue part shown above, with the second blue part shown below
                        I mean

                        Code:
                        2011-07-12 12:41:40,296 INFO [org.springframework.integration.handler.LoggingHandler] - 
                        <[Payload=javax.xml.transform.dom.DOMResult@14a7a12]
                        [Headers={timestamp=1310492500296, id=76f33ec9-05a3-4e9e-bbcf-66c000b4c2c8}]>
                        vs

                        Code:
                        [org.springframework.integration.handler.LoggingHandler] - 
                        <[Payload=[#document: null]]
                        [Headers={timestamp=1310493538500, id=8c224986-af14-4a00-98dd-4360254cd34d}]>
                        Is null the DOMResult, why?

                        Now with this update about the new dependency, StringResult no work anymore, please read the next post
                        Last edited by dr_pompeii; Jul 12th, 2011, 07:46 PM.

                        Comment


                        • #13
                          No work anymore StringResult

                          In the Beginning of this Thread

                          I shared

                          Code:
                          <int-xml:marshalling-transformer 
                                      marshaller="castorMarshaller"
                          	    result-type="StringResult"
                          	    input-channel="input"
                          	    output-channel="xml"									 								 	
                          	/>
                          ...
                          <int:channel id="xml">
                          	<int:interceptors>
                          		<int:wire-tap channel="logger01"/>
                          	</int:interceptors>
                          </int:channel>
                          ...
                          
                          MessageChannel input = context.getBean("input", MessageChannel.class );
                          PollableChannel output = context.getBean("output", PollableChannel.class );
                          	
                          Cliente cliente = new Cliente();		
                          cliente.setNombres("Manuel");
                          cliente.setApellidos("Jordan");		
                          cliente.setEdad(30);		
                          cliente.setPeso(70.01);
                          cliente.setCredito(new BigDecimal("150.85"));
                          cliente.setFechaNacimiento( new Date());
                          
                          Message<?> messageAltern01 = MessageBuilder.withPayload(cliente).build();
                          input.send(messageAltern01);
                          		
                          Message<?> replyAltern01 = output.receive();		
                          logger.info("Mensaje Recibido replyAltern01.toString(){}", replyAltern01.toString());
                          I got ( I am changing the presentation to let show the output friendly)

                          Code:
                          2011-07-11 12:19:30,329 INFO [org.springframework.integration.handler.LoggingHandler] - 
                          <[Payload=<?xml version="1.0" encoding="UTF-8"?>
                          <cliente>
                          <apellidos>Jordan</apellidos>
                          <fecha-nacimiento>2011-07-11T12:19:29.923-05:00</fecha-nacimiento><nombres>Manuel</nombres>
                          <peso>70.01</peso>
                          <edad>30</edad>
                          <credito>150.85</credito>
                          </cliente>]
                          [Headers={timestamp=1310404770329, 
                          id=4c20555b-0e1b-4292-bdd9-4baa3d99e449}]>
                          ....
                          Therefore, working really well with

                          Code:
                          <dependency>
                            	<groupId>org.codehaus.castor</groupId>
                              	<artifactId>castor</artifactId>
                              	<version>1.2</version>
                          </dependency>				
                          <dependency>
                              	<groupId>xerces</groupId>
                              	<artifactId>xercesImpl</artifactId>
                              	<version>2.9.1</version>
                          </dependency>

                          But now the same code shown above, but now only changing the maven dependency to work with the last version available (the shown below, replace both shown above)

                          Code:
                          <dependency>
                             	<groupId>org.codehaus.castor</groupId>
                              	<artifactId>castor-xml</artifactId>
                              	<version>1.3.2</version>
                          </dependency>
                          I got now ( I am changing the presentation to let show the output friendly)
                          (Recall I am working with StringResult)

                          Code:
                          2011-07-12 13:39:21,437 INFO [org.springframework.integration.handler.LoggingHandler] - 
                          <[Payload=<?xml version="1.0" encoding="UTF-8"?>
                          <cliente>
                          <apellidos>Jordan</apellidos>
                          <fecha-nacimiento>2011-07-12T13:39:21.265-05:00</fecha-nacimiento><nombres>Manuel</nombres>
                          <peso>70.01</peso>
                          <edad>30</edad>
                          <credito>150.85</credito>
                          </cliente>]
                          [Headers={timestamp=1310495961437, id=73efd912-3db3-4018-b628-b515908d7778}]>
                          Exception in thread "main" org.springframework.integration.transformer.MessageTransformationException: 
                          failed to transform message
                          	at org.springframework.integration.transformer.AbstractTransformer.transform(AbstractTransformer.java:44)
                          ...
                          Caused by: org.springframework.oxm.UnmarshallingFailureException: 
                          Castor unmarshalling exception; nested exception is
                          org.exolab.castor.xml.MarshalException: 
                          The class for the root element 'cliente' could not be found.{File: [not available]; line: 2; column: 10}
                          at org.springframework.oxm.castor.CastorMarshaller.convertCastorException(CastorMarshaller.java:487)
                          ....
                          Caused by: org.exolab.castor.xml.MarshalException: 
                          The class for the root element 'cliente' could not be found.{File: [not available]; line: 2; column: 10}
                          	at org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarshaller.java:866)
                          ...
                          Caused by: org.xml.sax.SAXException: 
                          The class for the root element 'cliente' could not be found.
                          	at org.exolab.castor.xml.UnmarshalHandler.processFirstElement(UnmarshalHandler.java:890)
                          I assume, is it a bug, right? or some extra configuration now is madatory here

                          Code:
                          @Bean
                          public CastorMarshaller castorMarshaller(){
                          	return new CastorMarshaller();
                          }
                          I am out of ideas

                          Thanks in advanced for your support
                          Last edited by dr_pompeii; Jul 12th, 2011, 07:44 PM.

                          Comment


                          • #14
                            Spring 3.0.5 is not intended to work with Castor 1.3.2. If you look in the POM, you will see version 1.2: http://repo1.maven.org/maven2/org/sp....5.RELEASE.pom

                            If you want to use Castor 1.3.2, you will need to use Spring 3.1 (currently at Milestone 2). Spring Integration will not *officially* support Spring 3.1 until Spring Integration's own 2.1 version. We will have an initial milestone of 2.1 very soon (likely in August).

                            -Mark

                            Comment


                            • #15
                              DOMResult is not working for both versions

                              Hello Mark

                              Thank you for your concrete and valuable information, really I appreciate

                              Spring 3.0.5 is not intended to work with Castor 1.3.2. If you look in the POM, you will see version 1.2: http://repo1.maven.org/maven2/org/sp....5.RELEASE.pom
                              Interesting, I arrived here through the Maven Central searching with the term spring-oxm. More detailed information and other style presentation is used

                              Furthermore spring-oxm is a transitive dependency from spring-core. I did realize it belong before to Spring Web Services 1.5.x API

                              If you want to use Castor 1.3.2, you will need to use Spring 3.1 (currently at Milestone 2). Spring Integration will not *officially* support Spring 3.1 until Spring Integration's own 2.1 version. We will have an initial milestone of 2.1 very soon (likely in August).
                              Mmm, I see, I must wait

                              OK, then I must use again

                              Code:
                              <dependency>
                                  	<groupId>org.codehaus.castor</groupId>
                                  	<artifactId>castor</artifactId>
                                  	<version>1.2</version>
                              </dependency>				
                              <dependency>
                               	<groupId>xerces</groupId>
                                  	<artifactId>xercesImpl</artifactId>
                                  	<version>2.9.1</version>
                              </dependency>
                              Therefore working with StringResult my code work again, but with DOMResult I have the problem yet

                              Code:
                              2011-07-12 12:58:58,484 INFO [org.springframework.integration.handler.LoggingHandler] - 
                              <[Payload=javax.xml.transform.dom.DOMResult@118fa47]
                              [Headers={timestamp=1310493538484, id=8d81c1a1-65dc-424c-b49f-1fcf37fb6cf7}]>
                              
                              2011-07-12 12:58:58,500 INFO [com.manuel.jordan.main.transformers.echo.EchoTransformer] - 
                              <*** asDOMNode>
                              [#document: null]
                              2011-07-12 12:58:58,500 INFO [com.manuel.jordan.main.transformers.echo.EchoTransformer] - 
                              <[#document: null]>
                              2011-07-12 12:58:58,500 INFO [com.manuel.jordan.main.transformers.echo.EchoTransformer] - 
                              <***>
                              2011-07-12 12:58:58,500 INFO 
                              
                              [org.springframework.integration.handler.LoggingHandler] - 
                              <[Payload=[#document: null]]
                              [Headers={timestamp=1310493538500, id=8c224986-af14-4a00-98dd-4360254cd34d}]>
                              Exception in thread "main" org.springframework.integration.transformer.MessageTransformationException: 
                              failed to transform message
                              	at org.springframework.integration.transformer.AbstractTransformer.transform(AbstractTransformer.java:44)
                              ...
                              
                              Caused by: org.springframework.oxm.UnmarshallingFailureException: 
                              Castor unmarshalling exception; nested exception is 
                              org.exolab.castor.xml.MarshalException: 
                              Content is not allowed in prolog.{File: [not available]; line: 1; column: 1}
                              	at org.springframework.oxm.castor.CastorMarshaller.convertCastorException(CastorMarshaller.java:487)
                              ...
                              
                              Caused by: org.exolab.castor.xml.MarshalException: 
                              Content is not allowed in prolog.{File: [not available]; line: 1; column: 1}
                              	at org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarshaller.java:761)
                              ...
                              
                              Caused by: org.xml.sax.SAXParseException: 
                              Content is not allowed in prolog.
                              	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
                              What would I do?

                              Thank you

                              Comment

                              Working...
                              X