jmtulli Posted June 6, 2020 Posted June 6, 2020 Dear admin, could you enable remote access for my MySQL database please? host: tommy.heliohost.orgdatabase: jmtulli_jspuser: jmtulli_jsp_admin I've tried to do that adding the % wildcard in the cPanel: https://imgur.com/iAMw2QaBut it still refused the connection: https://imgur.com/a/1jjLc3d Thank you!
Luigi123 Posted June 6, 2020 Posted June 6, 2020 This support request is being escalated to our root admin.
Krydos Posted June 6, 2020 Posted June 6, 2020 Remote mysql is already set up. The problem is probably on the end of whatever that thing is that is trying to connect to the database. What is the exact error?
jmtulli Posted June 8, 2020 Author Posted June 8, 2020 Remote mysql is already set up. The problem is probably on the end of whatever that thing is that is trying to connect to the database. What is the exact error?Hi. I don't know the exact error. This is what I got: Type Exception Report Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception java.lang.NullPointerException tulli.jm.dao.UserDAO.findByName(UserDAO.java:20) tulli.jm.servlets.LoginServlet.doPost(LoginServlet.java:21) javax.servlet.http.HttpServlet.service(HttpServlet.java:661) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) Note The full stack trace of the root cause is available in the server logs. My question is: how can I see the server logs to track the root cause? Thanks for your help!
jmtulli Posted June 8, 2020 Author Posted June 8, 2020 It's an java app I deployed on Tommy. It's on /home/jmtulli/TesteTulli.war and I'm running from http://jmtulli.heliohost.org/TesteTulli/
Krydos Posted June 9, 2020 Posted June 9, 2020 You don't need remote mysql then, because the app is local not remote. You only need remote mysql if your script is remote. Like if it was running on your home computer or another server. I don't see any errors in the tomcat logs regarding your app. Try outputting the error message to the browser.
jmtulli Posted June 9, 2020 Author Posted June 9, 2020 Great, thanks for the information!Found the problem, now it's working.
Krydos Posted June 9, 2020 Posted June 9, 2020 Awesome! If you have a chance it might be helpful for people in the future who have the same problem if you posted what the problem was and how you fixed it. If not, no big deal. It can just be a mystery and people in the future can figure it out themselves.
jmtulli Posted June 9, 2020 Author Posted June 9, 2020 (edited) Sure I can!The problem was not in the connection itself, but how I was connecting.Before, I was trying to get the connection in the static initialization block, and then trying to perform a query on the DB. But this wasn't working, and when I try the query I got nullpointer exception, bc the connection was null.Now I just created an method to connect, and I call it before perform the query, checking previously that the connection is not null. Actually I don't really know why this happened, bc using the former way in my localhost (but connecting to remote DB) it worked... Edited June 9, 2020 by jmtulli
Krydos Posted June 9, 2020 Posted June 9, 2020 I wonder if it's a different version of Tomcat? We're running 8.5.24 currently.
Recommended Posts