GlassFish HTTP Status 500 - Internal Server Error(JSTL) - java

When I try to run my Web Application using JSP, the GlassFish server returns the follow message:
HTTP Status 500 - Internal Server Error
type Exception report
messageInternal Server Error
descriptionThe server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
root cause
javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 5.1.0 logs.
GlassFish Server Open Source Edition 5.1.0
And I don't knhow what to do. I think the error is connected to Can't find javax.servlet.jsp.jstl.jar library in glassfish server

You will need to make the MySQL JDBC jar file available to Glassfish.
https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-usagenotes-glassfish-config.html

So I have figured it out, all I had to do was to set the datasource class name to
com.mysql.cj.jdbc.MysqlDataSource
since I was using MySql connetor J version 8.
Initally I had set the datasource class name to
com.mysql.jdbc.jdbc2.optional.MySqlDataSource

Related

project not geting deployed in glassfish server

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

Error while opening JDBC connection from Weblogic server 10.3.5

I developed an ADF application in Jdeveloper11.1.1.7 and deployed it in Weblogic server 10.3.5. From Jdeveloper every thing working perfectly But from weblogic server I can see in the server stack the error (Error while opening JDBC connection, Caused by null password given; logon denied) here is part of exception thrown:
Exception inside -------.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
at oracle.jbo.server.ConnectionPool.createConnection(ConnectionPool.java:207)
at oracle.jbo.server.ConnectionPool.instantiateResource(ConnectionPool.java:166)
at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:583)
at oracle.jbo.pool.ResourcePool.useResource(ResourcePool.java:316)
at oracle.jbo.server.ConnectionPool.getConnectionInternal(ConnectionPool.java:102)
at oracle.jbo.server.ConnectionPool.getConnection(ConnectionPool.java:67)
.......................................
.......................................
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:69)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: java.sql.SQLException: ORA-01005: null password given; logon denied
I did what is suggested in the following links:
My Learning's # Work - by Lakshmipathi Kakarla: ORA-01005: null password given
Extending WebLogic Server for ADF Applications Step 23
I added Djps.app.credential.overwrite.allowed=true to the JAVA_PROPERTIES and EXTRA_JAVA_PROPERTIES and restart the server but the issue is not resolved. Any idea what goes wrong? Please note that the file (setDomainEnv) in the bin folder for the weblogic domain contains more that setting to the previous variables, the change I did is always rise in the first set of the variables
Attached where exactly the command is added in setDomainEnv is it the right place to add? what is missing?
I was getting this error:
oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
Went here, said to alter AppModule configuration. So... right click on AppModule->Configurations->Edit
Connection Type for me was set to "JDBC Datasource". I set it to "JDBC URL". Note:
For some reason the JDBC URL may have to be tweaked. Here's mine:
jdbc:oracle:thin:#(description=(address=(host=FULLY_QUALIFIED_HOST)(protocol=tcp)(port=1521))(connect_data=(service_name=ORACLE_SID)(server=DEDICATED)))
It worked. On to the real problem.
Referring to this link:
Error while opening JDBC connection from Weblogic server 10.3.5
problem solved by changing application module configuration form using JDBC URL to using DataSource.

java.lang.ExceptionInInitializerError on JSP page

HTTP Status 500 - Internal Server Error
type Exception report
messageInternal Server Error
descriptionThe server encountered an internal error that prevented it from fulfilling this request.
exception
java.lang.ExceptionInInitializerError
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.0 logs.
GlassFish Server Open Source Edition 4.0
Got When I Run my JSP project on Netbeans 7.3
How to solve this ?
this is because there is a number to long in the code, maybe go back and check if you added a number to long and you just need to change it, check all of the integers!

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

Apache Roller Weblogger Configuration for ORACLE

I am using Apache Roller 5.0.1 Weblogger, deploying in Tomcat6.0.29 with Oracle database with all the configration in roller-custom.properties.
I am able to login and create a blog. but after creating a blog if i try to access the created blog by the link **//localhost:8080/roller/blogname** in the browser but i am getting an Unexpected Exception:
Status Code: 500
Message
Type
Exception: Roller has encountered and logged an unexpected exception
Can anyone help?

Categories

Resources