camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Castyn <eric.ben...@gmail.com>
Subject Upgraded to 4.4.1 from 4.4.0 now getting type conversion issue
Date Wed, 14 Dec 2011 15:33:53 GMT
I installed 4.4.1 and tried to run the bundle which was working previous to
the upgrade.  It appears camel does not like the conversion of the input
stream to the Document type any longer when getting a response from a cxf
endpoint.

org.apache.camel.InvalidPayloadException: No body available of type:
org.w3c.dom.Document but has value:
sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@4c4571c5 of 
type: sun.net.www.protocol.http.HttpURLConnection.HttpInputStream on:
Message: [Body is instance of java.io.InputStream]. Caused by: No type
converter available to convert from type: 
sun.net.www.protocol.http.HttpURLConnection.HttpInputStream to the required
type: org.w3c.dom.Document with value 
sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@4c4571c5.
Exchange[Message: [Body is instance of java.io.InputStream]]. Caused by: 
[org.apache.camel.NoTypeConversionAvailableException - No type converter
available to convert from type:
sun.net.www.protocol.http.HttpURLConnection.HttpInputStream to the required 
type: org.w3c.dom.Document with value
sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@4c4571c5]
	at
org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:102)

I did change my pom.xml to reflect the new versions of the software, but
other than that, nothing changed at all.

The part of the camel route it is failing on is as follows.  If I remove the
document conversion line it will throw the same error except instead of
document it will say could not convert to Node

   		<route id="SalesforceAuthentication">
	   		<from uri="timer://sforce?fixedRate=true&amp;period=60m"/>			
			<setHeader headerName="lastRunDate">									
	   			 <method ref="lastRun" method="getLastRunDate"/>
			</setHeader>
	   		<to uri="velocity://velocity/sforceLogin.vm" />						
			<setHeader headerName="SOAPAction">								
				<constant>login</constant>
			</setHeader>
	    	<to uri="cxf:bean:salesforceLogin"/> 								
	    	<to uri="file:data/sforce?fileName=sforceLoginResponse.xml"/>				
 	    	<convertBodyTo type="org.w3c.dom.Document" />						
			<setProperty propertyName="sforceSessionId">							
				<xpath resultType="java.lang.String">//s:sessionId</xpath>
			</setProperty>
			<setProperty propertyName="sforceURL">
				<xpath resultType="java.lang.String">//s:serverUrl</xpath>
			</setProperty>
   			<to uri="direct:changeRequest"/>								
	    </route>    

I included the POM just in case as that is the only thing in the project
that was updated.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">

    

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.ihg.sfdc</groupId>
    <artifactId>hotelRoute</artifactId>
    <packaging>bundle</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>Apache ServiceMix :: Camel OSGi Bundle :: Hotel Data Route</name>
    
    <properties>
       <camel.version>2.8.0</camel.version>
     </properties>

    <dependencies>
		<dependency>
		  <groupId>org.apache.camel</groupId>
		  <artifactId>camel-jms</artifactId>
		  <version>2.8.0-fuse-01-13</version>
		</dependency>
		<dependency>
		  <groupId>org.apache.activemq</groupId>
		  <artifactId>activemq-camel</artifactId>
		  <version>5.5.1-fuse-01-13</version>
		</dependency>
		<dependency>
		   <groupId>org.apache.activemq</groupId>
		   <artifactId>activemq-pool</artifactId>
		   <version>5.3.2</version>
		</dependency>
        <dependency>
            <groupId>org.apache.servicemix</groupId>
            <artifactId>servicemix-cxf-bc</artifactId>
            <version>2011.02.0-fuse-00-43</version>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-cxf</artifactId>
            <version>2.8.0-fuse-01-13</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-jetty</artifactId>
            <version>2.4.3-fuse-00-13</version>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>
            <version>${camel.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-jetty</artifactId>
            <version>${camel.version}</version>
        </dependency>
		<dependency>
		    <groupId>org.apache.camel</groupId>
		    <artifactId>camel-velocity</artifactId>
		    <version>${camel.version}</version>
		</dependency>
		<dependency>
		    <groupId>org.apache.camel</groupId>
		    <artifactId>camel-quartz</artifactId>
		    <version>${camel.version}</version>
		</dependency>    
	</dependencies>

    <build>
        <defaultGoal>install</defaultGoal>
        <plugins>
			<plugin>
				<groupId>org.apache.cxf</groupId>
				<artifactId>cxf-codegen-plugin</artifactId>
				<version>2.4.1</version>
				<executions>
					<execution>
						<id>generate-sources-sf</id>
						<phase>generate-sources</phase>
						<configuration>
							<sourceRoot>${basedir}/target/generated-sources/jaxws</sourceRoot>
							<wsdlOptions>
								<wsdlOption>
									<wsdl>${basedir}/src/main/resources/wsdl/sfdc.wsdl</wsdl>
                                    <extraargs>
                                    
<extraarg>-autoNameResolution</extraarg>
                                    </extraargs>
								</wsdlOption>
							</wsdlOptions>
						</configuration>
						<goals>
							<goal>wsdl2java</goal>
						</goals>
					</execution>
					<execution>
						<id>generate-sources</id>
						<phase>generate-sources</phase>
						<configuration>
							<sourceRoot>${basedir}/target/generated-sources/jaxws</sourceRoot>
							<wsdlOptions>
								<wsdlOption>
									<wsdl>${basedir}/src/main/resources/wsdl/hotelUpdate.wsdl</wsdl>
 								</wsdlOption>
							</wsdlOptions>
						</configuration>
						<goals>
							<goal>wsdl2java</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.4.3</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.2.0</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                       
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
			            <Import-Package>javax.jws,javax.wsdl,
			            				META-INF.cxf,
			            				META-INF.cxf.osgi,
										org.apache.cxf.bus,
										org.apache.cxf.bus.spring,
										org.apache.servicemix.cxfbc, 
										org.apache.cxf.transport, 
										org.apache.cxf.binding.soap.spring, 
										org.apache.cxf.transport.http,
										org.apache.cxf.configuration.spring, 
										org.apache.cxf.resource, 
										org.springframework.beans.factory.config,
										org.apache.camel.component.velocity,
										org.springframework.util,
										org.apache.cxf.transport.jms,*
						</Import-Package>
                        <Private-Package>com.ihg.sfdc,com.ihg.util
                        </Private-Package>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <modules>
    </modules>

</project>


--
View this message in context: http://camel.465427.n5.nabble.com/Upgraded-to-4-4-1-from-4-4-0-now-getting-type-conversion-issue-tp5074802p5074802.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message