Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ClassNotFoundException in AJAX example (Wikiversity)

 
Alex Olazabal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm new to this fine board, so I hope my question is pertinent :-D

I'm trying to learn about servlets and how to call them fom an HTML page via JavaScript (like the famous Google suggest functionality).

I saw this interesting example: http://en.wikiversity.org/wiki/Web_Science/Part1:_Foundations_of_the_web/Web_Architecture/Dynamic_Web_Conten...

I copied the code to Eclipse and, when I run it on Tomcat 6, I get the error (sorry, it's in Spanish but I guess it's still understandable):

jul 09, 2014 9:34:21 AM org.apache.catalina.core.ApplicationContext log
Información: Marcando el servlet Register como no disponible
jul 09, 2014 9:34:21 AM org.apache.catalina.core.StandardWrapperValve invoke
Grave: Excepción de reserva de espacio para servlet Register
java.lang.ClassNotFoundException: org.eclipse.jetty.server.Handler

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1149) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.bonitasoft.console.security.SessionFixationValve.invoke(SessionFixationValve.java:77) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source)


It seems like the Register servlet is not found, right? Could it be a problem with the Web.xml file?

THANKS A LOT!!!,

Alex Olazabal
Madrid, Spain

 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remove the main method (and the eclipse.jetty imports) and recompile. That code specifically starts up a Jetty servlet container - if you run it inside Tomcat, those classes are not present.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.
In case you did not realize, Jetty is a web server like Tomcat
http://www.eclipse.org/jetty/
 
Alex Olazabal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot, that tells you how much of a newbie I am :-D

I got rid of jetty and the main method; it worked beautifully, THANKS

Alex
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should look at JQuery and JQuery UI. The latter has an autocomplete widget that gives you that Google-like Ajax functionality that you are talking about.
 
Alex Olazabal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I'll look into it. But beware, that will only lead to more questions :-D
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alex Olazabal wrote:Thanks, I'll look into it. But beware, that will only lead to more questions :-D

That's what we're here for.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!