camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramon Buckland (JIRA)" <>
Subject [jira] Created: (CAMEL-1152) Disallow setting a header with a null name
Date Sat, 06 Dec 2008 13:43:05 GMT
Disallow setting a header with a null name

                 Key: CAMEL-1152
             Project: Apache Camel
          Issue Type: Improvement
          Components: camel-core
         Environment: Any
            Reporter: Ramon Buckland
            Priority: Minor

I have found that it is possible to set the header "name" to null of a message.

You can set a null header name as follows.. 

 <setHeader name="someName"><constant>SUCCESS</constant></setHeader>

This task succeeds, (ie no error occurs) but not as you would expect, because this is what
it is meant to be (@headerName)

<setHeader headerName="someName"><constant>SUCCESS</constant></setHeader>

eg: log dumping the header shows   -  Headers:{null=SUCCESS}

A side effect of this happening is that if you then use the xslt: component after setting
a null header with a value, the xslt (saxon) component  freaks out with a NPE because it is
attempting to set parameters for each header it finds, but the header is there and has a null

A Snippet of the Stack Trace - 

	at net.sf.saxon.Controller.setParameter(
	at org.apache.camel.builder.xml.XsltBuilder.addParameters(
	at org.apache.camel.builder.xml.XsltBuilder.configureTransformer(
	at org.apache.camel.builder.xml.XsltBuilder.process(
	at org.apache.camel.impl.ProcessorEndpoint.onExchange(
	at org.apache.camel.impl.ProcessorEndpoint$1.process(

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message