0

I make a project of web in JSP for displaying my mysql database in web. I used JSF, GlassFish server 4.1 and mysql-5.6.24 for my project. mysql is on port 3306 and GlassFish receives HTTP request on port 8080 but my project displays this error message to me in a web browser. "Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect."

1527 port is for Derby and i am using mysql which is on port 3306 why it shows me this port error with which mysql didn't any concern 1527 is for Derby.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Saad
  • 97
  • 8
  • Look for the "jdbc connection URL" in your code, or in your project configuration files (data source configurations, etc.). Somewhere you've configured your project to open a Derby connection. The connection URL will read "jdbc:derby://localhost:1527/database/name", so you can search for that in your source code using a tool like grep. – Bryan Pendleton Jul 02 '15 at 13:58
  • @BryanPendleton hey i checked every single point of my project everything is fine the url the configuration files data source and glassfish configuration not a single mistake i found. The port is 3306 everywhere. Can't understand why its not working. I need this so help me plz. – Saad Jul 02 '15 at 21:29
  • Can you change your application to gather more details from the Exception? For example, "e.printStackTrace()". You can get the stack trace into a string and display it on your web page, this way: http://stackoverflow.com/a/1149712/193453 – Bryan Pendleton Jul 03 '15 at 01:06

0 Answers0