Unable to set JAVA_OPTS variable -Dweceem.config.location for Weceem Grails CMS
Domanda
I am trying to have Weceem (Grails CMS) installed locally on my machine (Windows XP), but I am having a really hard time setting the JAVA_OPTS variable -Dweceem.config.location.
My environment is as follows:
- Java 6 with JAVA_HOME environment variable added to the Path
- Tomcat 6 Installed
- Grails 1.3.7 installed and set under GRAILS_HOME variable and added to the Path environment variable.
- MySQL Installed
- MySQL JDBC jar added under Tomcat_home/lib folder.
- A Database called weceem with weceem as username and password created and full permissions to create all kinds of database objects.
PROBLEM
In order to install WECEEM GRAILS CMS you have to have a weceem.properties files in Tomcat's classpath. I am having a hard time setting that up. I did as follows:
Created a weceem.properties under tomcat_home/lib with the settings as follows:
dataSource.pooled=true dataSource.driverClassName=com.mysql.jdbc.Driver dataSource.username=weceem dataSource.password= weceem dataSource.dbCreate=update dataSource.url=jdbc:mysql://localhost:3306/weceem
Opened up tomcat6w.exe and added the following JAVA_OPT under Java Tab\Java Options textarea:
-Dweceem.config.location=C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\weceem.properties
Place weceem-1.1.2.war under tomcat_home\webapps
Double click on tomcat6.exe under tomcat_home\bin
Everything seems to be deploying/initializing fine but I notice that at the beginning it says: Classpath resource[C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\weceem.properties] cannot be opened because it does not exist.
Anybody has any ideas on how to fix this?
Any good step by step detailed solution on how to install Weceem?
Thanks, Viriato
Soluzione
I have got it to work on Linux. It also gave me a lot of headaches but this is what I did:
CREATE DATABASE weceem CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'weceem' IDENTIFIED BY 'weceem';
GRANT ALL ON *.* TO 'weceem'@'%';
Then put the weceem.properties file under tomcat_home/conf. Replace localhost with your servername or server IP Address.
dataSource.pooled=true
dataSource.driverClassName=com.mysql.jdbc.Driver
dataSource.username=weceem
dataSource.password= weceem
dataSource.dbCreate=update
dataSource.url=jdbc:mysql://localhost:3306/weceem
Finally, edit catalina.sh with the following right after the Header comments
JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx512m -
XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -
XX:+DisableExplicitGC -Dweceem.config.location=file:/usr/share/apache-tomcat-
6.0.32/conf/weceem.properties"
If anybody knows how to do it on Windows please share because I do not have the equivalent catalina.sh (catalina.bat) in my tomcat_home/bin folder.
Altri suggerimenti
I used weceem on windows(with postgres). Steps tweaked from above
create c:/apps/weceem/
create a file weceem.properties
in above folder. Contents below
# Control whether or not connection pooling is enabled
dataSource.pooled=true
# Set the JDBC driver class name - class must be on classpath
dataSource.driverClassName=org.postgresql.Driver
# The user name for the SQL databasee
dataSource.username=weceem
# The password for the SQL database
dataSource.password=weceem
# The database update mode. Leave as "update"
dataSource.dbCreate=update
# The JDBC URL of your database
dataSource.url=jdbc:postgresql://localhost:5432/weceem
# OR you can specify a JNDI data source with just this line, and nothing else
# but you must have configured the JNDI database resource in your servlet container/
#dataSource.jndiName=java:comp/env/jdbc/WeceemDS
# The path to use for storing search index files - MUST be writable
searchable.index.path=c:/temp/weceem/search-indexes
Created a setenv.bat just one line
set CATALINA_OPTS=-Xmx1100m -XX:MaxPermSize=300m -Dweceem.config.location=file:///C:/apps/weceem/weceem.properties
The filename must be retained. It must be in tomcat's bin directory. The catalina.bat sources values from the file. Also note that weceem.config.location
is URL , so must starts with file:///
)
I copied postgresqljdbc.jar to the applications lib area ( tomcathome\webapps\weceem-1.1.2\WEB-INF\lib
)
Created user and database in postgres
postgres=# create user weceem password 'weceem';
postgres=# create database weceem owner weceem encoding 'UTF8';