Installation instructions for PETS ================================== Required software: MySQL 5 GlassFish v2 Installation ------------ * Get PETS source: svn co https://www.htk.tlu.ee/repos/modules/pets/trunk/ * Create a useraccount in MySQL and a database named pets_database * run pets.sql file * Add a user into database.., so later you could log in as manager (username: manager, password: manager) (After you are logged in you can change both username and password to whatever you want them to be) INSERT INTO usertable(user_id, username, password) VALUES (1,"manager","1d0258c2440a8d19e716292b231e3190"); INSERT INTO grouptable(user_id, username, group_id) VALUES (1,"manager","manager"); INSERT INTO profiles(user_id, username, user_role) VALUES (1, "manager", "manager"); In GlassFish lib directory has to be mysql-connector-java*.jar file, it can be downloaded at http://dev.mysql.com/downloads/connector/j/ * Start glassfish v2 server and open admin console * Create a JDBC connection pool named PetsPool (Resources -> JDBC -> Connection Pools) Name: PetsPool Resource type: javax.sql.DataSource Database Vendor: MySQL Change following options: URL: jdbc:mysql://localhost:3306/pets_database?useUnicode=true&characterEncoding=UTF-8 User: your mysql user Password: your mysql password * Create a JDBC resource (Resources -> JDBC -> JDBS Resources) JNDI Name: jdbc/PetsPool Pool Name: PetsPool * Create a security realm (Configuration -> Security -> Realms) Name: jdbc_realm Class Name: com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm JAAS context: jdbcRealm JNDI: jdbc/PetsPool User Table: usertable User Name Column: username Password Column: password Group Table: grouptable Group Name Column: group_id * open pets project resolve reference problems (pets-ejb, pets-war) open required projects create library PetsLibs: pets-war -> Libraries -> Create New Library add to this library all .jar files in pets-war/web/WEB-INF/lib folder * Create pets.properties file "pets.properties" file must be located at the glassfish's domain directory. eg. in /domains/domain1/pets.properties add following lines to this file: waramu.username=waramuusername waramu.password=waramupassword r2q2.url=http://where/r2q2/is/located mail.smtp.host=yourmailhost * Deploy pets