Debugging Web apps with Tomcat 5.0.18 in IntelliJ 4.0
Hi,
I have a very simple Struts application (in fact its the bank demo app from Programming Jakarta Struts) which works fine with Tomcat 5.0.18 but when I try to run it through the debugger in Intellij 4.0 I get the following exception when I try to open the app:
org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.bean.CookieTei
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:404)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:319)
org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:454)
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:291)
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:205)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:458)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:523)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
org.apache.jasper.compiler.Parser.parse(Parser.java:171)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:253)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:137)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:552)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
root cause
java.lang.ClassNotFoundException: org.apache.struts.taglib.bean.CookieTei
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1383)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:451)
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:291)
org.apache.jasper.compiler.TagLibraryInfoImpl.]]>(TagLibraryInfoImpl.java:205)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:458)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:523)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
org.apache.jasper.compiler.Parser.parse(Parser.java:171)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:253)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:137)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:552)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
so presumably IntelliJ is not seeing the Struts jar file for this class, I have specified it in the project classpath but I suppose Tomcat picks it up from somewhere else, I've enclosed some screenshots of my project paths, where am I going wrong?
kind regards
James
Attachment(s):
Screenshots.doc
Please sign in to leave a comment.
James, it looks like you don't have the libraries assigned and deployed
in your webapp. It's not enough to add the libraries to the project to
compile the srcs and make sure the jsps validate, you need to go to the
web resources tab of the module settings and make sure the library is
checked off and deployed to /WEB-INF/lib, and that your tlds are also
copied to the proper location inside WEB-INF.
R
Thanks Robert,
the new project settings are a bit harder to get your head round compared to 3.05, the app is debugging fine now, many thanks for the swiftness of your reply,
James
James Treacy wrote:
you're welcome. yeah the J2EE stuff is much more complex, but with
complexity comes flexibility, so you have to decide how to properly use
it. Once you figure it out, it's a wonderful thing.
R
Very true Robert, speaking of which is it possible to use an Ant script to build the module rather than IntelliJ's own make operation? At the moment I notice that I have to make the web module with IntelliJ in order for the debugger to pick up the app, or am I missing something else?
James
James Treacy wrote:
You've hit the biggest thorn in my side about I4. We tried to kick and
scream about it during EAP, but no solution was provided. The closes to
speeding that process up, and it does get real painful when editing
JSPs, is to map ctrlshiftm to make module. However it seems that
unless you're in the J2EE pane itself, this shortcut won't do much.
Thankfully it seems this issue has been marked to be fixed in I4.1.
R
Hmmm, pity, still software development is always a painfully slow process of negotiating priorities. On the bright side the new features in IntelliJ are a godsend, epsecially Hotswap and code completion in the expression evaluation tool, beats the pants off anything else I've worked with, keep up the good work :>
If you are successfully running Tomcat 5 from within IDEA, perhaps you could put together a quick white paper for the rest of us on setting it up.
Ross Greinke wrote:
http://www.intellij.org/twiki/bin/view/Main/WebModules
Sounds like an RFP for some consultancy, what are you offering? :)
James Treacy wrote:
haha... it does? That link it a JetBrains explanation of how to use
webapps, and set them up like in 3.0.5.
R
Yeah I just thought I'd pull Ross' leg a bit
James Treacy wrote:
oh well... ok :)