Results 1 to 8 of 8
  1. #1
    SREEMANTH is offline Member
    Join Date
    Jan 2015
    Posts
    5
    Rep Power
    0

    Default Simple web application not working

    I am trying to develop a new web application which takes in data from a form and stores data in a database.I have included all the three files join.jsp(the form which takes in data),reg.java(servlet) and JavaConncetDb(method which connects db and servlet).Please do look through and let me know my mistake. I get a 404 error when i try load the web application.Please help me as i beginner in java and trying to learn new things, i am stuck here since a long time



    My file structure in eclipse

    Simple web application not working-untitled.jpg


    The error I am getting

    Simple web application not working-error.jpg




    join.jsp

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body bgcolor="red">
    <form name="register" action="register" method=post>
    <p>FIRSTNAME <input type="text" name="firstname"><br>
    <p>LASTNAME <input type="text" name="lastname">
    <p>EMAILID <input type="text" name="emailid">
    <p>USERNAME<input type="text" name="username">
    <p>PASSWORD<input type="password" name="password"><br>
    <input type="submit" value="submit">

    </form>

    </body>
    </html>



    reg.java(servlet)

    package logintesting;

    import java.io.IOException;
    import java.io.PrintWriter;
    import java.sql.Connection;
    import java.sql.SQLException;

    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 oracle.jdbc.OraclePreparedStatement;

    /**
    * Servlet implementation class reg
    */
    @WebServlet("/reg")
    public class reg extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**
    * @see HttpServlet#HttpServlet()
    */
    public reg() {
    super();
    // TODO Auto-generated constructor stub
    }

    /**
    * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
    */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
    }

    /**
    * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
    */
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub

    PrintWriter out=response.getWriter();
    response.setContentType("text/html");
    String firstname,lastname,email,username,password;
    firstname=request.getParameter("firstname").toStri ng();
    lastname=request.getParameter("lastname").toString ();
    email=request.getParameter("emailid").toString();
    username=request.getParameter("username").toString ();
    password=request.getParameter("password").toString ();
    Connection con=JavaConnectDb.connectDb();
    try{
    String sql="insert into reg values('"+firstname+"','"+lastname+"','"+email+"', '"+username+"','"+password+"')";
    OraclePreparedStatement pst= (OraclePreparedStatement) con.prepareStatement(sql);
    pst.execute();
    out.println("register successfully");
    }
    catch(Exception e)
    {
    out.println(e);
    }

    finally{

    try {
    con.close();
    } catch (SQLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    }

    }
    }


    javaconnect.java(method used in servlet to conncet to database)
    package logintesting;

    import java.sql.Connection;
    import java.sql.DriverManager;

    public class JavaConnectDb {

    public static Connection connectDb()
    {
    Connection conn=null;



    try{
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn=DriverManager.getConnection("jdbc:oracle:thin :@localhost:1521:orcl","SYSTEM","oracle");
    }
    catch(Exception e)
    {
    System.err.println(e);
    }
    return conn;
    }
    }

    Last edited by SREEMANTH; 01-01-2015 at 06:59 PM.

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,995
    Rep Power
    10

    Default Re: Simple web application not working

    The error page says it: there is no resource named /loginexample. There is a servlet at /reg, there is a page at /join.jsp, but where do you define /loginexample?

    Other than that, you are on the right track using prepared statements, but you're doing it wrong. First of all, you are supposed to use a PreparedStatement, not the OraclePreparedStatement. Second, a PreparedStatement sets values at certain spots, marked with a question mark. So your code is supposed to do this:
    Java Code:
    String firstname=request.getParameter("firstname").toStri ng();
    String lastname=request.getParameter("lastname").toString ();
    
    Connection con=JavaConnectDb.connectDb();
    try{
       String sql="insert into reg values(?,?)";
       PreparedStatement pst= con.prepareStatement(sql);
       pst.setString(1, firstname);
       pst.setString(2, lastname);
       pst.execute();
    I left a lot of code out, but you get the idea.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  3. #3
    SREEMANTH is offline Member
    Join Date
    Jan 2015
    Posts
    5
    Rep Power
    0

    Default Re: Simple web application not working

    hi surfman. Thanks for replying back.I think loginexample doesn't have any defination. Loginexample is a web application which contains all the three files(jsp, servlet and method).So i am trying to run the loginexample. Am i right?
    Last edited by SREEMANTH; 01-02-2015 at 07:08 AM.

  4. #4
    SREEMANTH is offline Member
    Join Date
    Jan 2015
    Posts
    5
    Rep Power
    0

    Default Re: Simple web application not working

    Surfman, can u tell me what changes i am supposed to do regarding the loginexample not being available. Loginexample is a project which contains all the files.so i am not getting what i should configure

  5. #5
    SREEMANTH is offline Member
    Join Date
    Jan 2015
    Posts
    5
    Rep Power
    0

    Default Re: Simple web application not working

    Quote Originally Posted by SurfMan View Post
    The error page says it: there is no resource named /loginexample. There is a servlet at /reg, there is a page at /join.jsp, but where do you define /loginexample?

    Other than that, you are on the right track using prepared statements, but you're doing it wrong. First of all, you are supposed to use a PreparedStatement, not the OraclePreparedStatement. Second, a PreparedStatement sets values at certain spots, marked with a question mark. So your code is supposed to do this:
    Java Code:
    String firstname=request.getParameter("firstname").toStri ng();
    String lastname=request.getParameter("lastname").toString ();
    
    Connection con=JavaConnectDb.connectDb();
    try{
       String sql="insert into reg values(?,?)";
       PreparedStatement pst= con.prepareStatement(sql);
       pst.setString(1, firstname);
       pst.setString(2, lastname);
       pst.execute();
    I left a lot of code out, but you get the idea.
    i made a few changes and 404 error stopped.But i have a new problem.Can u tell me what this is about??

    Jan 02, 2015 10:05:55 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:loginexample' did not find a matching property.
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Server version: Apache Tomcat/8.0.15
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Server built: Nov 2 2014 19:25:20 UTC
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Server number: 8.0.15.0
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: OS Name: Windows 8.1
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: OS Version: 6.3
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Architecture: amd64
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: JAVA_HOME: C:\Program Files\Java\jre1.8.0_20
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: JVM Version: 1.8.0_20-b26
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: JVM Vendor: Oracle Corporation
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: CATALINA_BASE: C:\Users\Sravanth\workspace\.metadata\.plugins\org .eclipse.wst.server.core\tmp2
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: CATALINA_HOME: C:\Users\tomcat8
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dcatalina.base=C:\Users\Sravanth\workspace\.metada ta\.plugins\org.eclipse.wst.server.core\tmp2
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dcatalina.home=C:\Users\tomcat8
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dwtp.deploy=C:\Users\Sravanth\workspace\.metadata\ .plugins\org.eclipse.wst.server.core\tmp2\wtpwebap ps
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Djava.endorsed.dirs=C:\Users\tomcat8\endorsed
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dfile.encoding=Cp1252
    Jan 02, 2015 10:05:55 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_20\bin;C:\windows\Sun\Java\bin ;C:\windows\system32;C:\windows;C:/Program Files/Java/jre1.8.0_20/bin/server;C:/Program Files/Java/jre1.8.0_20/bin;C:/Program Files/Java/jre1.8.0_20/lib/amd64;C:\oraclexe\app\oracle\product\11.2.0\server \bin;;C:\ProgramData\Oracle\Java\javapath;C:\Progr am Files (x86)\Lenovo\FusionEngine;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\ System32\Wbem;C:\windows\System32\WindowsPowerShel l\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Common Files\lenovo\easyplussdk\bin;C:\Users\Sravanth\Des ktop\sreemanth\eclipse;;.
    Jan 02, 2015 10:05:55 AM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-nio-8092"]
    Jan 02, 2015 10:05:55 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
    INFO: Using a shared selector for servlet write/read
    Jan 02, 2015 10:05:55 AM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["ajp-nio-8093"]
    Jan 02, 2015 10:05:55 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
    INFO: Using a shared selector for servlet write/read
    Jan 02, 2015 10:05:55 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 1644 ms
    Jan 02, 2015 10:05:55 AM org.apache.catalina.core.StandardService startInternal
    INFO: Starting service Catalina
    Jan 02, 2015 10:05:55 AM org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: Apache Tomcat/8.0.15
    Jan 02, 2015 10:05:56 AM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["http-nio-8092"]
    Jan 02, 2015 10:05:56 AM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["ajp-nio-8093"]
    Jan 02, 2015 10:05:56 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 665 ms
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    Jan 02, 2015 1:29:54 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet [logintesting.reg] in context with path [/loginexample] threw exception
    java.lang.NullPointerException
    at logintesting.reg.doPost(reg.java:67)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:644)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:725)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:291)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.tomcat.websocket.server.WsFilter.doFilt er(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:219)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:501)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:142)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve. invoke(AbstractAccessLogValve.java:610)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:537)
    at org.apache.coyote.http11.AbstractHttp11Processor.p rocess(AbstractHttp11Processor.java:1085)
    at org.apache.coyote.AbstractProtocol$AbstractConnect ionHandler.process(AbstractProtocol.java:658)
    at org.apache.coyote.http11.Http11NioProtocol$Http11C onnectionHandler.process(Http11NioProtocol.java:22 2)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProce ssor.doRun(NioEndpoint.java:1556)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProce ssor.run(NioEndpoint.java:1513)
    at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$Wrapping Runnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)

    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    Jan 02, 2015 1:31:22 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet [logintesting.reg] in context with path [/loginexample] threw exception
    java.lang.NullPointerException
    at logintesting.reg.doPost(reg.java:67)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:644)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:725)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:291)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.tomcat.websocket.server.WsFilter.doFilt er(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:219)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:501)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:142)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve. invoke(AbstractAccessLogValve.java:610)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:537)
    at org.apache.coyote.http11.AbstractHttp11Processor.p rocess(AbstractHttp11Processor.java:1085)
    at org.apache.coyote.AbstractProtocol$AbstractConnect ionHandler.process(AbstractProtocol.java:658)
    at org.apache.coyote.http11.Http11NioProtocol$Http11C onnectionHandler.process(Http11NioProtocol.java:22 2)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProce ssor.doRun(NioEndpoint.java:1556)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProce ssor.run(NioEndpoint.java:1513)
    at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$Wrapping Runnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)

  6. #6
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,995
    Rep Power
    10

    Default Re: Simple web application not working

    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver is Java telling you: "Your application does not have access to the Oracle driver.". Download the driver from Oracle, package it in your app under /WEB-INF/lib and you're good to go.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  7. #7
    SREEMANTH is offline Member
    Join Date
    Jan 2015
    Posts
    5
    Rep Power
    0

    Default Re: Simple web application not working

    Quote Originally Posted by SurfMan View Post
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver is Java telling you: "Your application does not have access to the Oracle driver.". Download the driver from Oracle, package it in your app under /WEB-INF/lib and you're good to go.
    Simple web application not working-finastr.jpg
    I have added the driver and i still get an error

    Jan 02, 2015 8:34:40 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:loginexample' did not find a matching property.
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Server version: Apache Tomcat/8.0.15
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Server built: Nov 2 2014 19:25:20 UTC
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Server number: 8.0.15.0
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: OS Name: Windows 8.1
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: OS Version: 6.3
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Architecture: amd64
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: JAVA_HOME: C:\Program Files\Java\jre1.8.0_20
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: JVM Version: 1.8.0_20-b26
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: JVM Vendor: Oracle Corporation
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: CATALINA_BASE: C:\Users\Sravanth\workspace\.metadata\.plugins\org .eclipse.wst.server.core\tmp2
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: CATALINA_HOME: C:\Users\tomcat8
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dcatalina.base=C:\Users\Sravanth\workspace\.metada ta\.plugins\org.eclipse.wst.server.core\tmp2
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dcatalina.home=C:\Users\tomcat8
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dwtp.deploy=C:\Users\Sravanth\workspace\.metadata\ .plugins\org.eclipse.wst.server.core\tmp2\wtpwebap ps
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Djava.endorsed.dirs=C:\Users\tomcat8\endorsed
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dfile.encoding=Cp1252
    Jan 02, 2015 8:34:40 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_20\bin;C:\windows\Sun\Java\bin ;C:\windows\system32;C:\windows;C:/Program Files/Java/jre1.8.0_20/bin/server;C:/Program Files/Java/jre1.8.0_20/bin;C:/Program Files/Java/jre1.8.0_20/lib/amd64;C:\oraclexe\app\oracle\product\11.2.0\server \bin;;C:\ProgramData\Oracle\Java\javapath;C:\Progr am Files (x86)\Lenovo\FusionEngine;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\ System32\Wbem;C:\windows\System32\WindowsPowerShel l\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Common Files\lenovo\easyplussdk\bin;C:\Users\Sravanth\Des ktop\sreemanth\eclipse;;.
    Jan 02, 2015 8:34:40 PM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-nio-8082"]
    Jan 02, 2015 8:34:40 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
    INFO: Using a shared selector for servlet write/read
    Jan 02, 2015 8:34:40 PM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["ajp-nio-8083"]
    Jan 02, 2015 8:34:40 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
    INFO: Using a shared selector for servlet write/read
    Jan 02, 2015 8:34:40 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 916 ms
    Jan 02, 2015 8:34:40 PM org.apache.catalina.core.StandardService startInternal
    INFO: Starting service Catalina
    Jan 02, 2015 8:34:40 PM org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: Apache Tomcat/8.0.15
    Jan 02, 2015 8:34:41 PM org.apache.jasper.servlet.TldScanner scanJars
    INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
    Jan 02, 2015 8:34:41 PM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["http-nio-8082"]
    Jan 02, 2015 8:34:41 PM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["ajp-nio-8083"]
    Jan 02, 2015 8:34:41 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 1006 ms
    java.sql.SQLException: Invalid Oracle URL specified
    Jan 02, 2015 8:34:52 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet [com.tut.serve.reg] in context with path [/loginexample] threw exception
    java.lang.NullPointerException
    at com.tut.serve.reg.doPost(reg.java:73)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:644)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:725)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:291)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.tomcat.websocket.server.WsFilter.doFilt er(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:219)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:501)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:142)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve. invoke(AbstractAccessLogValve.java:610)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:537)
    at org.apache.coyote.http11.AbstractHttp11Processor.p rocess(AbstractHttp11Processor.java:1085)
    at org.apache.coyote.AbstractProtocol$AbstractConnect ionHandler.process(AbstractProtocol.java:658)
    at org.apache.coyote.http11.Http11NioProtocol$Http11C onnectionHandler.process(Http11NioProtocol.java:22 2)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProce ssor.doRun(NioEndpoint.java:1556)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProce ssor.run(NioEndpoint.java:1513)
    at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$Wrapping Runnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,007
    Rep Power
    34

    Default Re: Simple web application not working

    java.lang.NullPointerException
    at com.tut.serve.reg.doPost(reg.java:73)
    What is null on line 73?
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. simple inheritance not working!
    By digitaldrowning in forum New To Java
    Replies: 8
    Last Post: 04-07-2012, 10:09 PM
  2. Simple code not working
    By davetheant in forum New To Java
    Replies: 7
    Last Post: 02-04-2011, 01:51 AM
  3. Simple TCP chat application not working for me
    By sundarrajan in forum New To Java
    Replies: 0
    Last Post: 08-13-2009, 09:31 AM
  4. New simple application using a simple database
    By webbusiness23 in forum New To Java
    Replies: 9
    Last Post: 08-03-2009, 03:55 AM
  5. simple validations not working
    By rahaman.athiq in forum Web Frameworks
    Replies: 0
    Last Post: 11-06-2008, 07:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •