Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default ClassCastException

    My company develops websites, most of them running on ColdFusion 6.1. Now we
    are trying to migrate from ColdFusion 6.1 to ColdFusion 7.0 (for some
    websites).

    I was able to find and resolve most incompatibilities, save this next one: I'm
    getting this Java stack trace from a ClassCastException which I cannot
    interpret. I'm using my own Java classes in the background, but the stack trace
    does not indicate an error in one of my classes. Furthermore, I cannot
    determine a line in my .cfm files.

    Can you give me a hint where to search for the error?


    --------------- ColdFusion Error Message and Java Stack Trace ---------------
    Error casting an object of type 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.

    Please try the following:

    * Check the ColdFusion documentation to verify that you are using the
    correct syntax.
    * Search the Knowledge Base to find a solution to your problem.

    Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8)
    Gecko/20050511 Firefox/1.0.4
    Remote Address 192.168.100.111
    Referrer [url]http://terra.sirius.intern/page.cfm?vpath=index&nosearch[/url]
    Date/Time 17-Jun-05 04:05 PM
    Stack Trace

    java.lang.ClassCastException
    at coldfusion.compiler.ExprVisitor.insertCast(ExprVis itor.java:160)
    at coldfusion.compiler.ExprVisitor.transform(ExprVisi tor.java:60)
    at coldfusion.compiler.Treewalker.postorder(Treewalke r.java:84)
    at coldfusion.compiler.Treewalker.postorder(Treewalke r.java:25)
    at coldfusion.compiler.Treewalker.postorder(Treewalke r.java:25)
    at coldfusion.compiler.Treewalker.postorder(Treewalke r.java:25)
    at coldfusion.compiler.Treewalker.postorder(Treewalke r.java:25)
    at coldfusion.compiler.Treewalker.postorder(Treewalke r.java:25)
    at coldfusion.compiler.Treewalker.postorder(Treewalke r.java:25)
    at coldfusion.compiler.Treewalker.postorder(Treewalke r.java:25)
    at coldfusion.compiler.Treewalker.postorder(Treewalke r.java:25)
    at coldfusion.compiler.NeoTranslator.translateJava(Ne oTranslator.java:302)
    at coldfusion.compiler.NeoTranslator.translateJava(Ne oTranslator.java:106)
    at
    coldfusion.runtime.TemplateClassLoader$1.fetch(Tem plateClassLoader.java:282)
    at coldfusion.util.LruCache.get(LruCache.java:188)
    at
    coldfusion.runtime.TemplateClassLoader$TemplateCac he.fetchSerial(TemplateClassLo
    ader.java:223)
    at coldfusion.util.AbstractCache.fetch(AbstractCache. java:58)
    at coldfusion.util.SoftCache.get(SoftCache.java:81)
    at
    coldfusion.runtime.TemplateClassLoader.findClass(T emplateClassLoader.java:422)
    at coldfusion.filter.PathFilter.invoke(PathFilter.jav a:79)
    at coldfusion.filter.LicenseFilter.invoke(LicenseFilt er.java:27)
    at coldfusion.filter.ExceptionFilter.invoke(Exception Filter.java:50)
    at coldfusion.filter.BrowserDebugFilter.invoke(Browse rDebugFilter.java:52)
    at
    coldfusion.filter.ClientScopePersistenceFilter.inv oke(ClientScopePersistenceFilt
    er.java:28)
    at coldfusion.filter.BrowserFilter.invoke(BrowserFilt er.java:38)
    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilt er.java:38)
    at coldfusion.filter.DatasourceFilter.invoke(Datasour ceFilter.java:22)
    at coldfusion.CfmServlet.service(CfmServlet.java:105)
    at coldfusion.bootstrap.BootstrapServlet.service(Boot strapServlet.java:78)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker. java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvok erChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequ estDispatcher.java:257)
    at jrun.servlet.ServletEngineService.dispatch(Servlet EngineService.java:527)
    at
    jrun.servlet.jrpp.JRunProxyService.invokeRunnable( JRunProxyService.java:204)
    at
    jrunx.scheduler.ThreadPool$DownstreamMetrics.invok eRunnable(ThreadPool.java:349)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRu nnable(ThreadPool.java:457)
    at
    jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeR unnable(ThreadPool.java:295)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java :66)

    vernade Guest

  2. Similar Questions and Discussions

    1. ClassCastException relating to cfloop and Structs?
      I am upgrading a piece of code from CF5 to CF7, and it keeps getting ClassCastExceptions. This is the only real problem I've encountered in the...
  3. #2

    Default Re: ClassCastException

    So, I was able to isolate a portion of the code which leads to the problem
    above... obviously a complation error, although, I wonder why ColdFusion prints
    the stack trace instead of a standard error message.


    <cfif (hasPermission("editor,ptranslator", 0, getCurrentLocale()) and
    jnodetype.getConfig().useHistory() and not
    jnodetype.getConfig().isAutoPublish())
    or (hasPermission("admin") and jnodetype.getConfig().useLocale() and
    getLocales().RecordCount gt 1)>
    <cfset showpublishtranslatebox = "yes">
    </cfif>

    vernade Guest

  4. #3

    Default Re: ClassCastException

    Also, this code produces the error message above:
    <cfoutput><input type="hidden" name="instance" value="#instance#"></cfoutput>

    It seems to me, that this is a ColdFusion Bug.

    Has anyone other than me encountered this problem?

    vernade Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139