Closed RyanDellana closed 11 years ago
Also, should I be selecting Standard (TCP/IP) as my Connection Method?
The values that you have in there- 127.0.0.1, 3306, and root should be correct. That will try and connect you to the mysql database you have running on your machine... which means that before you do this, you have to make sure that your mysql database you installed is running. Check to see if you have a "MySQL Notifier" in your Start Menu, under "Mysql"- if so, start it up, and it will let you start your mysql.
This is what kind of error I am having and I see that the processes list the database notified that you asked me about but... not sure why it is not connecting.
Do I need to add anything to this Advanced tab?
That error means either your mysql isn't running or the password to it isn't root. At a guess I'd say mysql isn't running. MysqlNotifier is, which should have put an icon in the application tray at the bottom right of your windows screen (beside the clock). If you right click the mysqlnotifier icon, it'll give you the opportunity to start the mysql DBMS. You don't need to do anything in the advanced tab.
Remember, after you get mysql running you'll need to run those sql commands on it to create the database and table. They are found: https://github.com/rbpierce/SENG_6230_Spring_2013_Team_A/blob/master/Feasability/Feasability.sql.txt
You'll be able to go to your mysql workbench, go to the localhost instance udner the "SQL Development" column, and paste in the sql. You can also tsart and stop mysql from the workbench by opening the instance under the "Server Administration" column and choosing to start it from the left navigation which will then show up.
I don't see an option to start it??
I would guess it's under "Manage Services", but that's a different version than I have. You can also open MySQL Workbench and click the mysql instance in the right most column (the one I circled). The bottom image will pop up, and you can click on the highlighted "Startup / Shutdown" and then click Start. If all else fails, I'm sure there is some documentation on how to start it in the directory your mysql downloaded to :)
Ok, I got MySQL to run. With the Apache... is there not an easier way to run the startup thing? In order to have apache running, do I always have to right click on the startup.bat file and open?
I'm getting aggravated.... lol
Feb 16, 2013 6:45:20 PM org.apache.catalina.core.AprLifecycleListener init
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\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;.
Feb 16, 2013 6:45:20 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SENG6230_TeamA_MediQuik' did not find a matching property.
Feb 16, 2013 6:45:20 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Feb 16, 2013 6:45:20 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Feb 16, 2013 6:45:20 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 690 ms
Feb 16, 2013 6:45:20 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Feb 16, 2013 6:45:20 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Feb 16, 2013 6:45:21 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Feb 16, 2013 6:45:21 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Feb 16, 2013 6:45:21 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 403 ms
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2367)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2288)
at com.mysql.jdbc.ConnectionImpl.
Ok, I got rid of the database issue. Now I am getting just this:
Feb 16, 2013 6:48:43 PM org.apache.catalina.core.AprLifecycleListener init 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\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;. Feb 16, 2013 6:48:43 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SENG6230_TeamA_MediQuik' did not find a matching property. Feb 16, 2013 6:48:44 PM org.apache.coyote.AbstractProtocolHandler init INFO: Initializing ProtocolHandler ["http-bio-8080"] Feb 16, 2013 6:48:44 PM org.apache.coyote.AbstractProtocolHandler init INFO: Initializing ProtocolHandler ["ajp-bio-8009"] Feb 16, 2013 6:48:44 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 669 ms Feb 16, 2013 6:48:44 PM org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina Feb 16, 2013 6:48:44 PM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.12 Feb 16, 2013 6:48:44 PM org.apache.coyote.AbstractProtocolHandler start INFO: Starting ProtocolHandler ["http-bio-8080"] Feb 16, 2013 6:48:44 PM org.apache.coyote.AbstractProtocolHandler start INFO: Starting ProtocolHandler ["ajp-bio-8009"] Feb 16, 2013 6:48:44 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 477 ms
I need to have the MySQL Notifier Started, I need to have MySQL Workbench up, and I need to have Eclipse on? What do I do with those issues that are up there? For some reason the program has an X beside it.
Andrea,
The X on the servlet file, indicates that you haven't added the jar file to your project. Click here http://www.java2s.com/Code/JarDownload/servlet/servlet.jar.zip you have to extract it, copy the jar file to your project directory, and then in eclipse, go to project properties, on the list in the left click on Java Build Path, choose the libraries tab, click on Add External Jars, then add the file to your project. You also don't have to run Apache separately, you can add the server to your web application project, and eclipse will run it itself. The things you wrote under the comment where you said "Ok, I got rid of the database issue. Now I am getting just this:", are just normal Apache server logs, don't worry about them. Also, in order for eclipse to connect to MySQL, you have to add two more jars like I said before, you can find them under mysql and mysqljdbc topics in http://www.java2s.com/Code/Jar/m/Catalogm.htm.
Is everything OK now? Arman
No, I'm still having issues. I added the file to the project but it still does not work
Hi I was able to get the files on eclipse and have a working mysql server. When i run the program i type in a name, last name date of birth. When i click save i get a error message saying " description The requested resource (/SENG6230_TeamA_MediQuik/SavePatientServlet) is not available. " I was wondering if someone could help me
Sounds like your server.xml is incorrect. See the below image- when you first login, you hit a page with some URL- mine is "http://localhost:8080/SENG6230_TeamA_MediQuik/"... but I'm guessing yours is not. In order to get all the links and such to work, yours has to be. The way to fix that is to go into your server.xml file (which is in your tomcat directory, in a subdirectory named "bin" and replace whatever you have after the "http://localhost:8080/" with "SENG6230_TeamA_MediQuik".
For example, if your URL was "http://localhost:8080/WEBROOT/", you would find the server.xml file, search for and replace all instances of "WEBROOT" with "SENG6230_TeamA_MediQuik", and then restart and redeploy your application.
Andrea,
in the webcontent folder, double click on the jsp file and then click run, it should work.
It's still not working :(
Your mysql is either not running or misconfigured.
But, it is running. All my issues seem to be from the Apache side?
exception
org.apache.jasper.JasperException: java.lang.NullPointerException org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:534) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:457) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
java.lang.NullPointerException seng6230.teama.data.dao.PatientDAO.getAll(PatientDAO.java:76) org.apache.jsp.jsp.index_jsp._jspService(index_jsp.java:59) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
That stacktrace indicates that the error is on line 76 of the PatientDAO.java class. Line 76 create a preparedstatement from a connection, and is throwing an error because the connection is null.
The connection comes from the getConnection method of the DB.java class, which returns null in the case an exception... and prints out a stacktrace. That stacktrace would explain the error, but is not listed in the above screens. If you copy all the text from the console and upload it here (preferably as an attachment after you save it as a text file) we can figure out the issue.
It will only let me attach images in this comment section. Here is the console data:
Feb 18, 2013 7:08:50 PM org.apache.catalina.core.AprLifecycleListener init
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\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;.
Feb 18, 2013 7:08:50 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SENG6230_TeamA_MediQuik' did not find a matching property.
Feb 18, 2013 7:08:50 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Feb 18, 2013 7:08:50 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Feb 18, 2013 7:08:50 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 677 ms
Feb 18, 2013 7:08:50 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Feb 18, 2013 7:08:50 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Feb 18, 2013 7:08:51 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Feb 18, 2013 7:08:51 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Feb 18, 2013 7:08:51 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 436 ms
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2367)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2288)
at com.mysql.jdbc.ConnectionImpl.
"Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)"
Make sure your password for "root" is set to "toor".
I don't know how to change it. It only accepts "root" as the password
Hi Richard I found the server.xml file which is under the tomcat directory, but in the file i don't see any place where I can make a change to the localhost URL
Why won't it let me get access into this so I can set the password?
Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Andrea>cd "C:\Program Files\MySQL\MySQL Server 5.6\bin"
C:\Program Files\MySQL\MySQL Server 5.6\bin>mysql -u root mysql ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
C:\Program Files\MySQL\MySQL Server 5.6\bin>mysql -u root mysql.exe ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
C:\Program Files\MySQL\MySQL Server 5.6\bin>mysql -u root mysql.exe ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N O)
C:\Program Files\MySQL\MySQL Server 5.6\bin> C:\Program Files\MySQL\MySQL Server 5.6\bin>
I figured out how to change the password with some google research... whew........... I don't remember setting the password to root, but apparently I had done that. :-\ Wow, this was very confusing getting all this working. Thanks for all the help and being patient, obviously database, server, and connecting those with the IDE is not my cup of tea. I should have everything now since my screen looks like Richard's.
I found the server.xml file which is under the tomcat directory, but in the file i don't see any place where I can make a change to the localhost URL
When I click the Open Connection to Start Querying page in the MySQL Workbench, on the Connect to Database pop-up under the Parameters - what information do I enter into the Hostname, port, default schema?