Hi Cameron,

Thank you for your reply.

I will keep your suggestions in mind. Unfortunately I can't debug it this way 
right now as it only happens on the productive servers and I'm not allowed to 
do debugging there. Maybe I will be able to implement logfiles in the next 
version and dump the queries to a file. Hopefully this will give me some clue 
as to what is the matter there.

I wasn't aware that ColdFusion can cause exceptions in the underlying Java 
application. This still confuses me. Is there some general explanation for why 
this might occur?

Best wishes,
Till Helge

________________________________________
Von: Cameron Childress [[email protected]]
Gesendet: Freitag, 16. März 2012 14:30
An: cf-talk
Betreff: Re: NullPointerException in CF Template

You're using lots of dynamic stuff in a Query of Query.  I'll bet a value
is sometimes not what you think it is.  CFDUMP out
#someDatabaseSelectQuery.columnList#, #ReturnQuery#, and #langQuery# just
before the CFQUERY tag and make sure that they contain what you think they
do.

Also, I see that your QoQ table name is being reused as the table name for
the result set (both ReturnQuery).  you say this works sometimes, so that
may not be the problem, but it's easy enough to change the name
to name="ReturnQueryFoo" and see if it makes the error stop.

-Cameron

On Fri, Mar 16, 2012 at 5:30 AM, Helwig, Till Helge
<[email protected]>wrote:

>
> 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:350473
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to