Create JDBC connection pool in glassfish 4

0

I want to create a JDBC Connection Pool in glassfish 4.

I run my application server in eclipse Mars, and I access to the administration page of glassfish.

Then, I go to JDBC -> JDBC CONNECTION POOL -> NEW...

In the form, I informs following information:

enter image description here

And when I clic on next I get this error page

enter image description here

And the error log is :

2015-11-11T16:13:20.350+0000|Avertissement: Context path from ServletContext:  differs from path from bundle: /
2015-11-11T16:13:21.789+0000|Infos: Redirecting to /index.jsf
2015-11-11T16:13:21.878+0000|Infos: Admin Console: Initializing Session Attributes...
2015-11-11T16:13:21.978+0000|Avertissement: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
2015-11-11T16:13:30.379+0000|Infos: Exception Occurred :null
2015-11-11T16:13:30.382+0000|Grave: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException while attempting to process a 'beforeCreate' event for 'event144'.

2015-11-11T16:13:44.087+0000|Infos: Exception Occurred :null
2015-11-11T16:14:00.368+0000|Avertissement: StandardWrapperValve[FacesServlet]: Servlet.service() for servlet FacesServlet threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
java
jdbc
glassfish
connection-pooling
asked on Stack Overflow Nov 11, 2015 by Mahmoud • edited Nov 11, 2015 by Mahmoud

1 Answer

0

I'm facing the same issue and I found a solution: instead of creating the connection pool using my IDE (Netbeans), I used the command line:

My DB username is root with an empty password and I'm working on my localhost. My table is named tmpDb.

Here is the command I used:

$> cd "c:\Program Files\glassfish4\bin"
$> asadmin create-jdbc-connection-pool --restype  javax.sql.DataSource --datasourceclassname org.apache.derby.jdbc.ClientDataSource --validationmethod table --validationtable DUAL --property User=root:Password="":ServerName=localhost:tmpDb --ping true MyPool

Does this work for you?

answered on Stack Overflow Jan 15, 2017 by Ala Eddine JEBALI

User contributions licensed under CC BY-SA 3.0