Hi guys,
I stumbled upon another puzzling problem and could use some help:
The culprit is a CF template called by Mach-II and a lot of other templates are
involved, but the error occurs always in the same spot: I get a
NullPointerException from Java on a line where <cfquery> executes a SELECT
statement on a query object that was built on the lines before. The code looks
like this:
<cfset ReturnQuery = QueryNew( someDatabaseSelectQuery.columnList ) />
<cfloop query="langQuery">
<cfset QueryAddRow( ReturnQuery ) />
<cfloop list="#langQuery.columnList#" index="column">
<!--- TODO: Replace evaluate() with [] notation
--->
<cfset tmpCol = "langQuery." & column &
"[langQuery.currentRow][1]">
<cfset querySetCell(ReturnQuery, column, evaluate(tmpCol))>
</cfloop>
</cfloop>
<cfquery name="ReturnQuery" dbtype="query">
SELECT * FROM ReturnQuery ORDER BY PROD_ID
</cfquery>
Please don't judge me by that code...it didn't write it...I merely have to make
it work again. The error occurs on this line:
<cfquery name="ReturnQuery" dbtype="query">
The funny thing is that the same request works with other parameters and not
for a special combination of values. Explaining all the stuff that happens
based on those parameters would take way too much time. My real question is:
How is it possible that a NullPointerException occurs within a CF template?
This seems rather odd to me.
It appears to be server-specific as well. On some servers the error occurs, on
some it doesn't. I can't get my head around how this is even possible. I would
appreciate any ideas that might help me get to the bottom of this problem.
--
Best wishes,
Till Helge
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350450
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm