views:

196

answers:

2

Hi, when I run my scala application under tomcat, I am unable to do basic string concatenation, and I get an error stating that no class definition was found for StringBuilder. I'm running under windows 7 (development) and ubuntu (production), and I don't believe that java 1.4.x JDK or JRE has ever been insalled on either system.

Any idea why

val html = "<p>" + request.getParameter("myParam") + "</p>"

isn't working?

This is rather frustrating.

+1  A: 

Is the missing class scala.StringBuilder or the StringBuilder in java.lang? If the former, it sounds a lot like you are running the app without the scala-library.jar scala library, which should be added to the runtime classpath.

oxbow_lakes
I couldn't get any scala application to run until I included the scala-library jar in the tomcat libs directory. Are you saying that there's more to library setup than that? What am I missing?
Stefan Kendall
It wasn't clear from your question whether you are trying to run this under JDK1.4 or 1.5. Which one are you trying to use?
oxbow_lakes
A: 

Have you tried compiling with -target:jvm-1.4?

Daniel
Excuse my ignorance, but why should I need to do this? I've had regular java apps running on 1.5 under tomcat.
Stefan Kendall
If tomcat is running jvm 1.4, as suggested by others, this should help.
Daniel
Why would tomcat be running jvm 1.4? I don't want it to be running jvm 1.4!
Stefan Kendall
I don't know. *Have* you tried doing what I suggested?
Daniel
Yes. It didn't work.
Stefan Kendall