This post addresses running the flex-bugs-web example from the book's source code. Of course, this is not the only way to make things work, but it is one way and it worked for me.
I am using:
- Ubuntu Linux 10.10
- Java SE 1.6.0_23
- Maven 2.2.1
- Subversion 1.6.12
You can be using a different OS of course, but make sure that you have Java, Maven, and Subversion installed. Other versions may also work.
Below, commands are prefixed with '$' to make them stand out, but the '$' should not be included when you type the command at the command line.
For sanity, check your environment with this command:
$ mvn -v
That should show you the versions of Maven and Java that you have installed. Next,
$ svn --version
should show you the version of Subversion.
Create a clean directory in which to work. On the command line, go to that directory. Retrieve the source code from the book's Google Code repository:
$ svn export
http://flexonjava.googlecode.com/svn/flex-bugs/trunk/ flex-bugs
> Exported revision 365.
$ cd flex-bugs
$ ls
You should see something like:
flex-bugs-air flex-bugs-air-package flex-bugs-blaze-config flex-bugs-lib flex-bugs-ria
flex-bugs-web pom.xml src
Go to the flex-bugs-air-package directory and edit the pom.xml file in your favorite text editor. Near the very bottom of the file, but before the </project> tag, add the following:
<repositories>
<repository>
<id>flexonjava-repository</id>
<url>http://flexonjava.googlecode.com/svn/repository</url>
</repository>
</repositories>
Now go back up to the flex-bugs directory and run this command:
$ mvn -Dmaven.test.skip=true install
Edit the file: flex-bugs-blaze-config/src/main/resources/services-config.xml
Go to the flex-bugs-web directory.
Edit src/main/java/org/foj/action/CommentAction.java and change "setCommentManager" to "setCommentService", and change "setIssueManager" to "setIssueService". Make the same changes in src/main/java/org/foj/action/IssueAction.java.
Edit src/main/java/org/foj/service/impl/IssueManagerImpl.java and comment out the two instances of the call to "send" on messageTemplate:
// messageTemplate.send("flexMessage", messageBody);
Launch the web application with this command:
$ mvn -P hsqldb -Dmaven.test.skip=true jetty:run-war
Now, access the flexbugs web application with this URL in your browser:
http://localhost:8080/flexbugs
You can log in with username:admin and password:admin. Try creating an issue.
Finally, access the Flex UI for flexbugs with the following URL:
http://localhost:8080/flexbugs/flexbugs.jsp
You can log in with username:admin and password:admin. You should see the issue that you created previously
Hope that helps. Happy New Year!
Fred Daoud