views:

49

answers:

2

I'm working on upgrading an app from MX7 to 9 and testing it on my Mac's Dev server. I have a page with a large cfswitch--20 or so different cases, but none more than about 10-12 lines long. In CF9 only, whenever one of these cases does a cfinclude (which is almost all of them), I get an error along the lines of:

org.apache.bcel.generic.ClassGenException: Invalid branch target position offset for jsr[168](3):-1: -1: astore[58](2) 27 at
cfindex2ecfm581352809._factor4(/Users/dlaughland/Workspace/abcapp/surveymanager /surveys/survey/index.cfm:34) at
cfindex2ecfm581352809._factor28(/Users/dlaughland/Workspace/abcapp/surveymanager/surveys/survey/index.cfm:33) at
cfindex2ecfm581352809.runPage(/Users/dlaughland/Workspace/abcapp/surveymanager/surveys/survey/index.cfm:1) at
cfApplication2ecfc1705547767$funcONREQUEST.runFunction(/Users/dlaughland/Worksp ace/abcapp/Application.cfc:215)

I have googled extensively, and the best explanation I can find is a JDK error that was supposedly fixed in MX7! What is causing this? How do I fix it? This isn't the only page with a large cfswitch so I really don't want to re-write everything into cfif structures.

A: 

You can file a bug, but here are some steps that might help you work around the issue.

  1. Try updating your JRE version, you can get the latest and greatest here. You can then ask CF to use that JRE via your CF Admin > Server Settings > Java and JVM. Further instructions here.
  2. Try using a servlet container, for example use Tomcat instead of the bundled JRun. Here are some instructions.

Can I ask if you are going to use this in production on a Mac? If not, try running your code on a OS that will mirror your live site. The bug (if it is a bug) may not be in that version of CF.

Hope something there helps.

Ciaran Archer
I had considered that it's a Mac platform bug. I'm working on spinning up a virtual server that's a bit closer to our production servers. If that doesn't work, I'll try your Tomcat idea. Thanks for the feedback!P.S. On Mac, Java updates only come from Apple in the normal Software Updates. The latest version is 1.6.0_20b02.
jabberwik
I installed CF9 on our Linux environment and it gave me the same error. So it's not a platform bug. Tomcat is not an option since we don't have an Enterprise license. I do like it for my dev environment though.
jabberwik
A: 

If you upgraded from CF7 to CF9 with the code already on the server, try deleting all of the classes from WEB-INF/cfclasses and restarting CF.

James Holmes
Thanks for the feedback, but it's not an upgrade in this case. I did a clean install of CF9 to test the code out.
jabberwik