project not geting deployed in glassfish server - java

i am trying to debug my project but its showing error message as such :
"cannot Deploy WebForm
Deployment Error for module: WebForm: Error occurred during deployment: Exception while preparing the app : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: 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.
Error Code: 0."
i have done every possible step with the persistence.xml as well as the JPA tables but still it's not deploying.
Help!

You have some sort of DB-connection configured in your app. The message "Error connecting to server localhost on port 1527 with message Connection refused: connect. Error Code: 0" says, your program tries to reach a DB on port 1527. The possibilities are:
on the production server is no DB running: install and configure DB
the program does not have the rights to access DB
the DB-connection on production-server is reached differently than in development - adjust your configuration

Related

how to fix Keystore was tampered with, or password was incorrect on glassfish server

i'm trying to create a connection pool and JDBC Resource to deploy a java application on glassfish server, however, I couldn't deploy the project, and this is what it said:
Error occurred during deployment: Exception while preparing the app :
Exception [EclipseLink-4002] (Eclipse Persistence Services -
2.7.0.v20170811-d680af5): org.eclipse.persistence.exceptions.DatabaseException Internal
Exception: java.sql.SQLException: Error in allocating a connection.
Cause: The connection could not be allocated: Cannot open
file:C:\Users\nguye\GlassFish_Server500\glassfish\domains\domain1/config/keystore.jks
[Keystore was tampered with, or password was incorrect] Error Code: 0.
Please see server.log for more details.
Just try adding
?autoReconnect=true&useSSL=false to you database on NetBeans as well as on connection pool URL.

Embedded Database project

So I received this error message:
java.sql.SQLNonTransientConnectionException: java.net.ConnectException
: Error connecting to server localhost on port
What does this even mean? I searched it up and what I found was that I never created an embedded database but rather a server? Regardless, the steps I followed were exact in order to create an embedded database.

Java EE Web Application Glassfish error database not found

I am working on what is basically my first Java Enterprise-project following this video (source) tutorial. I have the exact same code as the guy in the video, but when trying to run my project I get this error code in the Glassfish server log:
Allvarlig: Exception while deploying the app [CRUDWebApplication] :
Exception [EclipseLink-4002] (Eclipse Persistence Services -
2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a
connection. Cause: Connection could not be allocated because: The
connection was refused because the database studentDB was not found.
Error Code: 0
So the problem is that the database studentDB can't be found and I cannot seem to figure out what may be the cause of this...

Can not create a database in my computer. java.sql.SQLNonTransientConnectionException error

I can not create a database in my computer. When I tried changing the java.policy file, it denied my access. I don't know what's going on. But on netBeans I saw this error:
"An error occurred while creating your database:
java.sql.SQLNonTransientConnectionException:
java.net.connectException: Error connecting to server localhost on
port 1527 with message. Connection refused. "
What's going on. How can I fix this problem, and create a database with out my operating system denying my own access?

Unable to get connection, DataSource invalid - Netbeans, MySQL

I'm following the tutorial of Netbeans site:
https://netbeans.org/kb/docs/web/mysql-webapp.html
everything was working fine until this step: Implementing JSTL code STEP 4 where the list should be displayed I get the following error:
javax.servlet.ServletException: javax.servlet.jsp.JspException:
Unable to get connection, DataSource invalid: "java.sql.SQLException: 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."
root cause
javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: 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."
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.0 logs.
I suppose netbeans still tries to connect to the Derby DB. How can i change it to MySQL DB?
I am using Java EE7, MySQL, Netbeans, Glassfish 4
The stack trace indicates that the MySQL DB is not running on port 1527
See https://netbeans.org/kb/docs/ide/mysql.html
Use GlassFish Server Open Source Edition 3.x and Java EE Version 5 or 6
Then it works.
I had a similar problem and I solved it using a different approach. I changed the settings in the glassfish-web.xml file found in IFPWAFCAD/WebPages/WEB-INF folder. The following settings worked for me for this particular tutorial https://netbeans.org/kb/docs/web/mysql-webapp.html:
Resource Reference name: jdbc/IFPWAFCAD
JNDI Name: jdbc/IFPWAFCAD
Principal Name: root
Principal Password: nbuser
These settings will work for this particular tutorial - I used glassfish 4 - and Java EE 5. No need to install glassfish 3

Categories

Resources