This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Simple question from Beginner on Using NetBeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Simple question from Beginner on Using NetBeans" Watch "Simple question from Beginner on Using NetBeans" New topic
Author

Simple question from Beginner on Using NetBeans

Benjamin Thvedt
Ranch Hand

Joined: Jul 29, 2011
Posts: 31
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

Joined: Jul 29, 2011
Posts: 31
Thanks!
Nitin Surana
Ranch Hand

Joined: Jan 21, 2011
Posts: 129

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

Joined: Jul 29, 2011
Posts: 31
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

Joined: Jul 29, 2011
Posts: 31
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple question from Beginner on Using NetBeans
 
Similar Threads
Can't render JSP
Default netbeans servlet with JSP file
org.apache.jasper.JasperException: Advice/Help needed
why i m getting this exception java.lang.NoSuchMethodError ?
Where is the web.xml file?