0

Premiss: I'm a java newbie and this is my first question on stack, I looked over the internet but I can't find any answer.

I started working on a dynamic web project on a windows pc, on eclipse, connected to a mysql database and it was working just fine.

I came home and I wanted to work on it on a mac but I have this problem with the server I guess..

Description: "The server encountered an unexpected condition that prevented it from fulfilling the request."

Exception: java.lang.NullPointerException

I already changed the jdbc and everything but I'm having the same error. Do you have any idea or suggestion to help me solve this problem?

Thank you

Edit 1

Full Stack

mar 30, 2018 2:09:45 AM org.apache.catalina.core.StandardWrapperValve invoke GRAVE: Servlet.service() for servlet [webUI.PersonaServlet] in context with path [/WebSalari] threw exception java.lang.NullPointerException at database.DbAccessore.eseguiSelect(DbAccessore.java:73) at database.FilmDbAccess.caricaTutteLePersone(FilmDbAccess.java:14) at contenitori.ContenitoreFilm.caricaDati(ContenitoreFilm.java:24) at webUI.PersonaServlet.processRequest(PersonaServlet.java:83) at webUI.PersonaServlet.doPost(PersonaServlet.java:49) at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)

I'm also getting this ClassNotFoundException when trying to connect to the database

Edit 2

Here's my DBAccessore.eseguiSelect method

Connection conn;

    public ResultSet eseguiSelect(String p_sql) {
        ResultSet rs = null;

        try {
            Statement comando = conn.createStatement(); // Line 73
            rs = comando.executeQuery(p_sql);
        } catch (SQLException sqle) {
            LogManager.scriviLog("Errore nella esecuzione della 
            query! Dettagli:");
        LogManager.scriviLog(sqle.getMessage());
        }

        return rs;
    } // end method
  • You posted a NullPointerException at line 73 of DbAccessore.java, which means that in that very line you tried to dereference the null pointer. In other words: There is some expression `reference.member` in which the reference part is null. To give you a complete diagnosis, you must post the method DbAccessore.eseguiSelect (hoping it is not too long). – Little Santi Mar 31 '18 at 18:32

0 Answers0