Troubleshooting "Unknown constant tag 32 in class file "

Hi there,

my helper app reads a sheetdata.json file, deserializes it, creates a query
record set and then displays the information.

When I tried to use it today, I ran into the error message:

Message: Unknown constant tag 32 in class file nptechedu/sheetdata_json$cf
Cause: java.lang.ClassFormatError
Stacktrace: The Error Occurred in
/usr/local/apache-tomcat-8.0.24/webapps/nptechprojects/nptechedu/rawhtmlevents.cfm:
line 24

See below the details Javastacktrace.

My question today is how can I start troubleshooting it?
Just making sure it’s not a malformed json file, I already checked it for
funny characters and make sure all special characters are escaped. It
validates fine via http://jsonlint.com/

So now I am at the end of my wits…

Any ideas would be highly appreciated.

Birgit

With the stacktrace:
Unknown constant tag 32 in class file nptechedu/sheetdata_json$cf
at java.lang.ClassLoader.defineClass1(Native Method):-2
at java.lang.ClassLoader.defineClass(ClassLoader.java:760):760
at java.lang.ClassLoader.defineClass(ClassLoader.java:642):642
at lucee.commons.lang.PCLBlock.loadClass(PCLBlock.java:193):193
at lucee.commons.lang.PCLCollection.loadClass(PCLCollection.java:127):127
at lucee.runtime.PageSourceImpl._compile(PageSourceImpl.java:336):336
at lucee.runtime.PageSourceImpl.compile(PageSourceImpl.java:309):309
at lucee.runtime.PageSourceImpl.loadPhysical(PageSourceImpl.java:278):278
at lucee.runtime.PageSourceImpl.loadPage(PageSourceImpl.java:192):192
at lucee.runtime.PageSourceImpl.loadPage(PageSourceImpl.java:912):912
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:946):946
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:854):854
at
nptechedu.rawhtmlevents_cfm$cf.call(/usr/local/apache-tomcat-8.0.24/webapps/nptechprojects/nptechedu/rawhtmlevents.cfm:24):24
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:950):950
at
lucee.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:56):56
at
lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:36):36
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2257):2257
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2224):2224
at
lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:456):456
at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:47):47
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729):729
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291):291
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52):52
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239):239
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219):219
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106):106
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502):502
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142):142
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79):79
at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617):617
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88):88
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518):518
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091):1091
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668):668
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527):1527
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484):1484
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142):1142
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617):617
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61):61
at java.lang.Thread.run(Thread.java:745):745

Hi Jeroen,

Appreciate your response!
In the meantime, it’s solved now.

The code around line 24 was:



I replaced with this one liner suggested by Jesse Schaffer (waving at
Jesse) on Slack

<cfset arrEvents = deserializeJson(fileRead(“sheetdata.json”))>

Now it works again…
The mystery, why it would stop working in the first place, remains, but I
leave it for another day.

All the best
BirgitOn Wednesday, January 6, 2016 at 7:18:05 AM UTC-5, Jeroen Knoef wrote:

Hi Birgit,
Can you post that json file?
And if possible rawhtmlevents.cfm as well, at least line 24 and
surrounding code?
Regards,
Jeroen

Hi Birgit,
Can you post that json file?
And if possible rawhtmlevents.cfm as well, at least line 24 and surrounding
code?
Regards,
Jeroen

Birgit,

Was this working on Lucee or ACF before? Using cfinclude on any file extension will cause the engine to try interpreting that file as CFML. There is something in that JSON file that Lucee tried interpreting as valid CFML that was valid syntax, but caused a runtime exception for whatever reason.

Since all you want to do is read and deserialize JSON, it’s much faster to use fileRead instead.