title: CFPDF merge error: Error casting an object of type com.adobe.internal.pdftoolkit.core.types.ASString cannot be cast to [B to an incompatible type
body: <p>I am trying to merge a series of pdf files I have created with cfthread. I am using the following code:</p>
  
  <pre><code>&lt;cfquery name="data"&gt;
  select * from mytable
  &lt;/cfquery&gt;
  &lt;cfset threadList = ""&gt;
  &lt;cfloop index="x" from="1" to="#data.recordcount#"&gt; 
      &lt;cfset name = "threadnumber#x#"&gt; 
      &lt;cfset threadList = listAppend(threadList,name)&gt;
      &lt;cfthread name="#name#"&gt;
          &lt;cfloop query="data"&gt;
              &lt;cfpdf action="read" name="myPDF#randrange(1,1000)#" source="#Expandpath('/_pdf/#data.cusip#.pdf')#" /&gt;
          &lt;/cfloop&gt;
      &lt;/cfthread&gt; 
  &lt;/cfloop&gt;
  &lt;cfthread action="join" name="#threadlist#" /&gt;  
  
  &lt;cfpdf action="merge" name="final"&gt;
      &lt;cfloop list="#threadlist#" index="i"&gt;
          &lt;cfloop query="data"&gt; 
              &lt;cfpdfparam source="#Expandpath('/_pdf/#data.cusip#.pdf')#"&gt;
          &lt;/cfloop&gt;
      &lt;/cfloop&gt; 
  &lt;/cfpdf&gt;
  </code></pre>
  
  <p>However, I am getting errors like this: </p>
  
  <pre><code>Error casting an object of type com.adobe.internal.pdftoolkit.core.types.ASString cannot be cast to [B to an incompatible type. This usually indicates a programming error in Java, although it could also mean you have tried to use a foreign object in a different way than it was designed.
  com.adobe.internal.pdftoolkit.core.types.ASString cannot be cast to [B
  
  
  The error occurred in D:/inetpub/wwwroot/project1/schedulefocuslist.cfm: line 77
  75 :    &lt;cfloop list="#threadlist#" index="i"&gt;
  76 :        &lt;cfloop query="data"&gt; 
  77 :            &lt;cfpdfparam source="#Expandpath('/_pdf/#data.cusip#.pdf')#"&gt;
  78 :        &lt;/cfloop&gt;
  79 :    &lt;/cfloop&gt; 
  </code></pre>