PDA

View Full Version : Help with struts app


sentry
8th August 2006, 08:20 PM
Okay, so I've got tomcat5 and struts installed and I'm trying something very simple...

Basically I am copying the struts-blank directory to a new directory location for my first struts web app. I use cp -Rp struts-blank new-project and everything looks like it copies over cleanly links and all.

When I try to access this new site I get this error:
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: XML parsing error on file /WEB-INF/struts-logic.tld
org.apache.jasper.servlet.JspServletWrapper.handle JspException(jasper5-compiler-5.5.15.jar.so)
org.apache.jasper.servlet.JspServletWrapper.servic e(jasper5-compiler-5.5.15.jar.so)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(jasper5-compiler-5.5.15.jar.so)
org.apache.jasper.servlet.JspServlet.service(jaspe r5-compiler-5.5.15.jar.so)
javax.servlet.http.HttpServlet.service(tomcat5-servlet-2.4-api-5.5.15.jar.so)

root cause

org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: XML parsing error on file /WEB-INF/struts-logic.tld
org.apache.jasper.compiler.TldLocationsCache.init( jasper5-compiler-5.5.15.jar.so)
org.apache.jasper.compiler.TldLocationsCache.getLo cation(jasper5-compiler-5.5.15.jar.so)
org.apache.jasper.JspCompilationContext.getTldLoca tion(jasper5-compiler-5.5.15.jar.so)
org.apache.jasper.compiler.Parser.parseTaglibDirec tive(jasper5-compiler-5.5.15.jar.so)
org.apache.jasper.compiler.Parser.parseDirective(j asper5-compiler-5.5.15.jar.so)
org.apache.jasper.compiler.Parser.parseElements(ja sper5-compiler-5.5.15.jar.so)
org.apache.jasper.compiler.Parser.parse(jasper5-compiler-5.5.15.jar.so)
org.apache.jasper.compiler.ParserController.doPars e(jasper5-compiler-5.5.15.jar.so)
org.apache.jasper.compiler.ParserController.parse( jasper5-compiler-5.5.15.jar.so)
org.apache.jasper.compiler.Compiler.generateJava(j asper5-compiler-5.5.15.jar.so)
org.apache.jasper.compiler.Compiler.compile(jasper 5-compiler-5.5.15.jar.so)
org.apache.jasper.compiler.Compiler.compile(jasper 5-compiler-5.5.15.jar.so)
org.apache.jasper.compiler.Compiler.compile(jasper 5-compiler-5.5.15.jar.so)
org.apache.jasper.JspCompilationContext.compile(ja sper5-compiler-5.5.15.jar.so)
org.apache.jasper.servlet.JspServletWrapper.servic e(jasper5-compiler-5.5.15.jar.so)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(jasper5-compiler-5.5.15.jar.so)
org.apache.jasper.servlet.JspServlet.service(jaspe r5-compiler-5.5.15.jar.so)
javax.servlet.http.HttpServlet.service(tomcat5-servlet-2.4-api-5.5.15.jar.so)
I'm new to struts but not a new developer and this is confusing to me. It looks like it should work indeed some of the documentation I have seen recomends that you copy struts-blank to a new location to use as a skeleton for your app. So what am I doing wrong?

I just hope that this is not an omen for what's to come :)

sentry
9th August 2006, 07:57 PM
Anyone have any idea?

sentry
10th August 2006, 06:01 PM

Answered my own question.

I had installed a JRE from SUN onto my machine as per Stanton Finley's tutorial http://stanton-finley.net/fedora_core_5_installation_notes.html#Java.

I installed the official java from SUN using jpackage and undid the changes I did to get my old JRE up and voila, it works.

I'm not certain if gcj is the culprit or the fact that I didn't have a proper SDK for Java on my machine. I'm still refreshing my Java skills/learning. But I am so happy right now :)

So if anyone else has a problem with struts apps similar to mine, try installing the latest Java with jpackage.