tracker issue : CF-3778014

select a category, or use search below
(searches all categories and all time range)
Title:

getMetaData() causes internal NullPointerException

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce

Reporter/Name(from Bugbase): Alexander Kwaschny / Alexander Kwaschny (Alexander Kwaschny)

Created: 06/18/2014

Components: Language, CF Component

Versions: 10.0

Failure Type: Unspecified

Found In Build/Fixed In Build: Final /

Priority/Frequency: Trivial / Very few users will encounter

Locale/System: English / Win 2008 Server R2 64 bit

Vote Count: 2

Problem Description:

Calling getMetaData() on a cfcomponent may cause an internal exception that gets logged in exception.log but does not throw an error, i.e. is not catch'able at all.

Here's the stracktrace right after calling getMetaData():

java.lang.NullPointerException
    at coldfusion.util.Utils.getServletPath(Utils.java:100)
    at coldfusion.util.Utils.getServletPath(Utils.java:90)
    at coldfusion.util.Utils.getBaseTemplatePath(Utils.java:419)
    at coldfusion.runtime.TemplateProxyFactory.getTemplateFileHelper(TemplateProxyFactory.java:1567)
    at coldfusion.runtime.MetadataUtils.getComponentMetadata(MetadataUtils.java:112)
    at coldfusion.runtime.CfJspPage.GetComponentMetadata(CfJspPage.java:2744)
    at coldfusion.runtime.TemplateProxy.getRuntimeComponentMetadata(TemplateProxy.java:1940)
    at coldfusion.runtime.TemplateProxy.getRuntimeMetadata(TemplateProxy.java:1801)
    at coldfusion.runtime.MetadataUtils.getMetaData(MetadataUtils.java:54)
    at coldfusion.runtime.CfJspPage.GetMetadata(CfJspPage.java:2717)


The actual problem is the frequence of exception log entries as every hit (basically every visitor/new session on our website) causes at least one of these internal exceptions. The log file gets bloated and we may run short in disc space.

Steps to Reproduce:

The issue does not seem to be reproducible that easily. It may depend on Trusted Cache/Request Template Cache as it only occurs on our live servers (who utilize the Request Template Cache). Also, it seems to be connected to the first call of getMetaData() on a cfcomponent that is stored in the session scope.


Actual Result:

The internal exception does not affect ColdFusion's request processing. getMetaData() always returns the expected data.


Expected Result:

See Actual Result.


Any Workarounds:

Not using Trusted Cache/Request Template Cache seems to solve the problem. That's obviously a bad workaround for a live server though. So is disabling the exception.log altogether.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3778014

External Customer Info:
External Company:  
External Customer Name: AquaStatic
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

I tried the following steps: Called getMetaData() on a cfcomponent, but did not get the exception (java.lang.NullPointerException) in exception.log file. The following are my componenet file (test.cfc) and the test.cfm. test.cfc -------- component { function inComponent(){ } } test.cfm -------- <!--- Calling getMetaData() on an instance of the Component Explorer utilities CFC. ---> <cfscript> componentutils = createObject("component", "test"); utilmetadata = getMetaData(componentutils); </cfscript> <h4>Metadata for the CFC component </h4> <cfdump var="#utilmetadata#"> Execute test.cfm does not give any exception and none is logged in exception.log file. Please provide the exact repro case. (Comment added from ex-user id:amkum)
Comment by Adobe D.
11853 | August 31, 2014 01:28:16 AM GMT
(subscribe) //////////////////////////////
Vote by External U.
11856 | September 01, 2014 03:16:54 AM GMT
Since we have not heard back anything on this issue. We are closing this bug . If you are still facing this issue, let us know so that we can reopen this. (Comment added from ex-user id:amkum)
Comment by Adobe D.
11854 | December 03, 2014 03:50:40 AM GMT
This occured with me ONLY with a cfc that was nested in another cfc that was in the session scope + When a new session was created + cfc path caching was on. It doesnt matter if its directly in the session scope or nested into something, or if its also in the application scope. So another workaround might be: Create the instance of an object and run getMetadata on it BEFORE its being put in the session scope in any way. In coldspring i used lazy-init = false to immediately create it before i use it anywhere, which fixed it. I cant confirm this, but it could be that it happens only with CFC's that are not directly put in a session but as part of a struct or a cfc that is in the session.
Comment by External U.
11855 | December 03, 2014 11:11:17 AM GMT