• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Simple question from Beginner on Using NetBeans

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I'm trying to enter the fun world of JSP's and so I bought murach's Servelets and JSP 2nd edition, installed NetBeans and Tomcat, configured them, and was trying to run a simple application named TestApp. I created the project in NetBeans, and ran it, and it runs great it says "Hello World" and everything. The next step was to add a new JSP, and here's where I am having a problem. When I add a new JSP called "test.jsp" in the WEB-INF folder, and use the Run File command, I get an error at the first line of code
Exception in thread "main" java.lang.NoSuchMethodError: javax.servlet.ServletContext.getJspConfigDescriptor()Ljavax/servlet/descriptor/JspConfigDescriptor;
at org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:104)
at org.apache.jasper.compiler.JspConfig.init(JspConfig.java:194)
at org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:257)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:162)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:447)
at org.apache.jasper.JspC.processFile(JspC.java:1153)
at org.apache.jasper.JspC.execute(JspC.java:1322)
at org.netbeans.modules.web.project.ant.JspC.main(JspC.java:101)
at org.netbeans.modules.web.project.ant.JspCSingle.main(JspCSingle.java:119)
I have triple and quadruple checked and I am absolutely sure I am doing everything the book said to do to the letter. The same error seems to happen if I click on or change anything. It creates the project fine, and if I don't do anything whatsoever to it it will run. But if I do anything like change the html in the index.jsp or add a jsp I get this error. Of course I am a complete beginner so I have no idea what is going on, but can anybody help? It is exercise 3.1 in the book and it seems like it should be super simple.
 
Benjamin Thvedt
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!
 
Ranch Hand
Posts: 129
Netbeans IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't try to put your JSP within WEB-INF, because no direct no request can be made to anything inside WEB-INF. Instead move your JSP directly into the Web Pages folder as shown in the Projects Window in Netbeans.
 
Benjamin Thvedt
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I have them in the web pages folder, but everytime I try to do something, it doesn't run. For example: I can create a new project, and everytime I create a new project there is a page called index.jsp that basically outputs "Hello World!" to the browser. If I don't do anything to it, it runs fine. But if I do anything whatsoever, even if I change the exclamation mark to a question mark so it says "Hello World?" for example, it won't build or run. Even if I change it back to an exclimation mark, so it's exactly the way it was before, it won't run. The file is exactly the same. What can possibly be going on here?
 
Benjamin Thvedt
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah found the problem. The book I had recomended that I add some jar files to the java/lib/ext directory, but it turns out these files were breaking everything somehow. Well the book is like 3 years old or so, so I guess the software has changed since then.
reply
    Bookmark Topic Watch Topic
  • New Topic