THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
Archiva On GlassFish with MySQL
General server configuration
- Ensure that the property appserver.base is set. Archiva uses this to locate log files.
Glassfish web configuration
- Deploy the war file on your Glassfish server from the admin page (http://localhost:4848).Go to Ressources -> JavaMail Sessions and create a new ressource, otherwise you will get "Error creating bean with name 'mailSession'" on startup.
MySQL console
- Create the two needed databases:
CREATE DATABASE users;
CREATE DATABASE archiva; - Create account to access them:
GRANT ALL PRIVILEGES ON users.* TO 'users'@'*' IDENTIFIED BY 'users' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON archiva.* TO 'archiva'@'*' IDENTIFIED BY 'archiva' WITH GRANT OPTION;
Note: the tables should be latin1 character set. If you use UTF8 you ran out of max key length:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
Glassfish file configuration
Edit the file <GLASSFISH_FOLDER>/domains/domain1/config/domain.xml to add the following tags:
- Go to Ressources -> JavaMail Sessions and create a new ressource with jndi-name='mail/Session', otherwise you will get "Error creating bean with name 'mailSession'" on startup. Or add it to the config file:
Code Block ... <resources> <mail-resource debug="false" enabled="true" from="me@email.example.com" host="email.example.com" jndi-name="mail/Session" object-type="user" store-protocol="imap" store-protocol-class="com.sun.mail.imap.IMAPStore" transport-protocol="smtp" transport-protocol-class="com.sun.mail.smtp.SMTPTransport" user="me"/> ...
Set appserver.base and appserver.home properties
Ensure that the property appserver.base is set. Archiva uses this to locate log files.Code Block ... <java-config ... <jvm-options>-Dappserver.base=${com.sun.aas.installRoot}/domains/domain1</jvm-options> <jvm-options>-Dappserver.home=${com.sun.aas.installRoot}/domains/domain1</jvm-options> ...
JDBC resources
Code Block |
---|
... </applications> <resources> <jdbc-resource enabled="true" jndi-name="jdbc/users" object-type="user" pool-name="usersMysqlPool"/> <jdbc-resource enabled="true" jndi-name="jdbc/archiva" object-type="user" pool-name="archivaMysqlPool"/> ... |
...