Jump to content

Search the Community

Showing results for tags 'Servlet'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. I'm trying to make a XMLHttpRequest from a JavaScript page to a Java Servlet.I found out lots of problem because it's first time that I do this. The main problem it's that the servlet doesn't work!It give me this error: HTTP Status 500 - Servlet execution threw an exception type: Exception report message: Servlet execution threw an exception description: The server encountered an internal error that prevented it from fulfilling this request. exception: javax.servlet.ServletException: Servlet execution threw an exceptionroot cause java.lang.NoClassDefFoundError: com/google/appengine/api/channel/ChannelServiceFactoryProvaServer.Server.doPost(Server.java:30)javax.servlet.http.HttpServlet.service(HttpServlet.java:647)javax.servlet.http.HttpServlet.service(HttpServlet.java:728)root cause java.lang.ClassNotFoundException: com.google.appengine.api.channel.ChannelServiceFactoryorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)ProvaServer.Server.doPost(Server.java:30)javax.servlet.http.HttpServlet.service(HttpServlet.java:647)javax.servlet.http.HttpServlet.service(HttpServlet.java:728) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.33 logs. This is the Java Servlet code: package ProvaServer; import java.lang.Object;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import com.google.appengine.api.channel.*;import com.google.appengine.api.channel.ChannelServiceFactory; @WebServlet(description = "prova", urlPatterns = { "/provaFinale" })public class Server extends HttpServlet { private static final long serialVersionUID = 1L; public Server() { super(); // TODO Auto-generated constructor stub } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String userId = request.getParameter("idUser"); ChannelService channelService = ChannelServiceFactory.getChannelService(); //the problem is here! String token = channelService.createChannel(userId); System.out.println("IdUser:" + userId); System.out.println("Token:" + token); String url="mona.html?user="+userId+"&token="+token; response.sendRedirect(url); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {}} and this is the web.xml servlet mapping file: <?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>Server</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> <servlet> <servlet-name>ServerServlet</servlet-name> <servlet-class>ProvaServer.Server</servlet-class> </servlet> <servlet-mapping> <servlet-name>ServerServlet</servlet-name> <url-pattern>/provaFinale</url-pattern> </servlet-mapping></web-app> The problem come out when servlet try to run this code: ChannelService channelService = ChannelServiceFactory.getChannelService() but i can't understand what is the error.Could someone help me to understand? Thanks for the attention!
×
×
  • Create New...