Creating connection pools in Glassfish

I am trying to create a connection pool in a glass shawl. I have done this a million times, so "how" is not a problem.

After I filled out all the information that the form should create a connection pool, and I hit "create / finish", then the screen simply reboots and returns to the main screen without creating a connection pool.

This is super disappointing! (Aaaargh !!!). I tried several times to restart the application server, but it does not work. Any tips on what I can do to fix this? Maybe there is a manual way to add a connection pool by editing some XML file or something else?

Thanks in advance!

+6
source share
3 answers

The configuration is saved as a domain.xml file ( .../<yourDomain>/config/domain.xml ), and you can edit this file manually (preferably while the application server is down).

Search for:

 <jdbc-connection-pool name="yourDS" ...> <description>...</description> <property name="DatabaseName" value="..."/> <property name="Password" value="..."/> <property name="User" value="..."/> <property name="ServerName" value="localhost"/> <property name="PortNumber" value="3306"/> </jdbc-connection-pool> 
+13
source

Edit the xml according to jeha's answer or use a command like this

 asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --restype javax.sql.ConnectionPoolDataSource --property "User=myUser:Password=myPassword:URL=jdbc\:mysql\://localhost/dbname" myConnPoolName asadmin create-jdbc-resource --connectionpoolid myConnPoolName jdbc/myConnPoolName 

If the administrative console crashes, it may be due to the language of the browser, if it is different from English.

+9
source

This is great for Oracle and Glassfish 3, just replace your specfic bits as needed

 create-jdbc-connection-pool --restype=javax.sql.DataSource --datasourceclassname=oracle.jdbc.pool.OracleDataSource --property=user=<USER>:password=<PWD>:url=<YOUR_SERVER>\\:<PORT>\\:<SID> <DataSourceName> 

Pay attention to double slashes to avoid nested colons.

+1
source

Source: https://habr.com/ru/post/899766/


All Articles