Thursday, April 1, 2010

Importing a new project into Subversion

Every once in a while I have to import a new project into subversion. Invariably I end up having to remind myself of how to do this. Therefore as an easy way to find this I thought I would put it up on my blog. If anybody else finds it useful then all the better.

Firstly create your project in a structure similar to the following:

--- trunk
--- tags
--- branches

The trunk, tags and branches are all folders. Place the code you want to add into the trunk folder.

Then enter the following:

svn import ProjectName file:///path/to/repository/ProjectName -m "Initial sources"

This is the Unix/Mac version if you are working on Windows then you will need something more along the lines of:

svn import ProjectName file:///path/to/repository/ProjectName -m "Initial sources"

Once added I think check out a version to actually work against so in this case

svn co file:///path/to/repository/ProjectName/trunk ProjectName

Saturday, March 27, 2010

The project 'XXX' does not have any GWT SDK's on its build path

I'm currently working on a GWT project using the Eclipse IDE, GWT plugin and maven2.

I have been getting an error stating - The project 'XXX' does not have any GWT SDK's on its build path.

I do have the GWT libs declared in my maven pom.xml file, however the GWT plugin also requires the GWT SDK library to be added to the project, which I had done. However, what is not clear is that the GWT SDK library must appear before the Maven dependencies in the "Order and Export" tab. Once I moved it up the order this error was resolved.

Hope this is of some use!

Sunday, March 7, 2010

Writing a VIDEO_TS folder to a DVD

If you are trying to back up a VIDEO_TS folder (legally obtained of course) to a DVD (or an .iso) then this can be achieved by using the command line tool hdiutil on the Apple Mac.

Open a terminal window and use the following command:

hdiutil makehybrid -udf -udf-volume-name -o .iso /path/to/parent/folder

1. Replace with the name of the DVD.
2. Replace as the file name for the generated ISO file.
3. /path/to/parent/folder should be changed to the parent folder of the VIDEO_TS folder not the VIDEO_TS folder itself.

Tuesday, March 2, 2010

JIRA WAR Tomcat Installation

I have been trying to setup a single Tomcat 6.0.x server to maintain a number of project lifecycle apps. One of these apps is JIRA. I found documentation that described how to setup JIRA as an EAR/WAR. However the method defined involved copying was a number of jar files into the Tomcat server lib directory that I was uncomfortable with. I wanted to keep the number of jars going into the server lib folder to a minimum. After some work, the only jar I had to put in the tomcat/lib folder was the MySQL JDBC driver.

The following instructions describe the steps that I took to achieve this.

  • MacOSX (Snow Leopard)
  • JIRA version 4.0.2
  • MySQL

1. Download the EAR/WAR version of JIRA (NOTE if it isn't visible on the downloads page then look for the small link that says "Show All" rather than just recommended.

2. Once downloaded, unpack the archive to a folder. From now on know as $JIRA_INSTALL. According to the Atlassian website there have been reported problems with the Windows extractor not extracting all files and a similar situation with WinRAR. Try using WinZip or another alternative.

3. Download and install mysql. This is beyond the scope of this post but there are plenty of good howto's and tutorials out there on how to do it.

4. Once my sql is installed we need to create a user for our jira database. Run the following commands to create the user replacing the changeme100 with your desired password:

5. Now we need to create the jira db. Log into MySQL as an administrator and run the following commands replacing the changeme100 with your desired password:

CREATE DATABSE jiradb character set utf8;
CREATE USER 'jira'@'localhost' IDENTIFIED BY 'changeme100';

6. Download the mysql Connector/J JDBC driver and place the jar file in your $CATALINA_HOME/lib folder.

7. Open $JIRA_INSTALL/edit-webapp/WEB-INF/class/entityengine.xml in a text editor and change the

<datasource name="defaultDS" class="org.ofbiz.core.entity.GenericHelperDAO" keys="false" indices="false" start="true">
<jndi-jdbc name="default">


<datasource name="defaultDS" class="org.ofbiz.core.entity.GenericHelperDAO" keys="false" indices="false" check="" start="true">
<jndi-jdbc name="default">

8. Open $JIRA_INSTALL/edit-webapp/WEB-INF/classes/ in a text editor and change the "jira.home" property near the top of the file to an absolute folder. I'm using /usr/share/jira.

10. Download the required Tomcat jars for JIRA to work. Unzip the folder and copy the contents (jar files) into the $JIRA_INSTALL/webapp/WEB-INF/lib folder.

11. Create a new folder called META-INF in the $JIRA_INSTALL/edit-webapp/META-INF folder and then create a new file called context.xml inside it. Open this file up in a text editor and add the following contents:

<context path="/jira">
<resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource" username="jira" password="changeme100" driverclassname="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/jiradb"/>

<resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction" factory="org.objectweb.jotm.UserTransactionFactory" timeout="60">
<manager pathname=""/>

12. Now in a command window go to the $JIRA_INSTALL folder and run build.bat (Windows) or ./ (Unix/Linux/Mac).

13. Once the build is complete copy the $JIRA_INSTALL/dist-tomcat/atlassian-jira-4.0.2.war to your $CATALINA_HOME/webapps folder

14. You should now be able to start up your tomcat instance and browse to http://localhost:8080/jira.

Please let me know if you have any issues or problems :)