Quotero Wiki » Install » Glassfish 3.1

Glassfish 3.1

Last modified by Jérôme Ludmann on 2011/03/14 10:46

If you need technical support for this product, contact Customer Support by email at support@quotero.com. If you have comments or suggestions about this documentation, contact us at documentation@quotero.com. This edition applies to version 2.0 of the Quotero solution with Glassfish 3.1.

Data Source

The instructions below show how to create a new Data Source with Glassfish Administration Interface.

JDBC Driver

Copy the JDBC library into ~/glassfish/domains/domain1/lib/ext application server directory. In this tutorial example, we’ll use postgresql-8.x-xxx.jdbc3.jar as JDBC Driver file.

Connection Pool

Run Glassfish and go to http://localhost:4848/ (only for a local Glassfish and default configuration settings).

Default authentication parameters:

  • login: admin
  • password: adminadmin

In the left menu, open Resources > JDBC > Connection Pools and click on New button.

Then, configure like below:

  • Name: QuoteroPool
  • Resource Type: javax.sql.Datasource
  • Database Vendor: PostgreSQL

Click on Next button and configure your Additional Properties:

  • url: jdbc:postgresql://localhost:5432/quotero-db
  • user: postgres
  • password: postgres

Finally, click "Finish" button.

You can also add the connection pool manually by editing ~/domain/domain1/config/domain.xml :

<jdbc-connection-pool driver-classname="" datasource-classname="org.postgresql.ds.PGSimpleDataSource" res-type="javax.sql.DataSource" description="" name="QuoteroPool" ping="true">
      <property name="portNumber" value="5432"></property>
      <property name="databaseName" value="quotero-db"></property>
      <property name="datasourceName" value="quoteroDataSource"></property>
      <property name="serverName" value="localhost"></property>
      <property name="user" value="postgres"></property>
      <property name="password" value="postgres"></property>
</jdbc-connection-pool>

Pool Test

From the pool list, you can check the pool by clicking Ping button.

JDBC Resource

Here, it's required to link your JNDI resource to the new created pool. To do this, go to Resources > JDBC > JDBC Resources and configure it:

  • JNDI Name: jdbc/quotero
  • Pool Name: select "QuoteroPool"
  • Status: "Enabled"

Click OK button. The Data Source is ready to work.

To add the resource manually, add entry into ~/domain/domain1/config/domain.xml :

<jdbc-resource pool-name="QuoteroPool" description="" jndi-name="jdbc/quotero"></jdbc-resource>

Quotero Properties

Now, edit the file named quotero-conf.properties (into ~/WEB-INF web app directory) to change the default transaction manager again:

jta.tx.factory=org.hibernate.transaction.JTATransactionFactory
jta.tx.managerlookup=org.hibernate.transaction.SunONETransactionManagerLookup

Then, specify yours database settings:

jdbc.databasetype=postgresql
jdbc.dialect=org.hibernate.dialect.PostgreSQLDialect
jdbc.schema=public
jdbc.jndids=java: jdbc/quotero

Transaction Manager

Here, it's necessary to change the transaction manager in the application context file. This file is located into ~/WEB-INF/conf/applicationContext.xml.

<bean name="transactionManager" id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>

This is a valid example for PostgreSQL and Glassfish application server.

Server Libraries

Many libraries are already loaded by the application server. Before to run the server, you have to remove them from the Web App library folder.

These files are located into ~/WEB-INF/lib:

  • atomikos-util-x.x.x.jar
  • geronimo-jta-x.x.x.jar
  • jta-x.x.x.jar
  • postgresql-x.x.x.jar
  • transactions-x.x.x.jar
  • transactions-api-x.x.x.jar
  • transactions-hibernate-x.x.x.jar
  • transactions-jdbc-x.x.x.jar
  • transactions-jdbc-deprecated-x.x.x.jar
  • transactions-jms-x.x.x.jar
  • transactions-jms-deprecated-x.x.x.jar
  • transactions-jta-x.x.x.jar
  • xercesImpl-x.x.x.jar
  • xml-apis-x.x.x.jar
  • xmlbeans-x.x.x.jar
  • xmlParserAPIs-x.x.x.jar

More help

Go to http://wiki.quotero.com/bin/view/Install/Quotero+Quick+Install for additional information.

Tags:
Created by Fabien Alin on 2011/03/09 17:26

This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 2.6.1.33884 - Documentation