Skip to content

Archive

Archive for March, 2010

Seems like everytime I need to configure Apache to use mod.rewrite, I follow all of the instructions to ensure that the library files are installed with Apache and also check that the .htaccess file is all correct…yet it still does not work. There is one extra step that seems to be left out of all of the online documentation – and it is such a simple fix. I wish Apache would add it to the documentation.

Look at the Directory section of the httpd.conf file. By default on most operating systems (Red Hat, Fedora, CentOS) the default value for AllowOverride is “None”. Change the value to “All” and it is likely the solution to your problem.

<pre>
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www/html">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
    Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all

</Directory>
</pre>

Maven is a build tool for Java based web apps – plain and simple.

Before learning about Maven I did my builds using Ant. And when it came to building webapps, I was always frustrated about getting things in source control in such a way that all of the developers could build their apps no matter what IDE they were using. For example, you get some developers using Eclipse and others using Net Beans, and the different IDEs wants things set up their own way.

By using Maven (instead of ANT or batch files), you do your builds independent of the IDE using the command line; nevertheless, the build can still be done using the IDE if you choose to do so. However, by using the command line, you ensure that your IDE isn’t playing tricks on you.

Follow the instructions of the documentation for getting Maven installed on your development machine.

Next run the command from the command line:

mvn archetype:generate -Dfilter=org.apache:struts

This alone will result in the generation of a basic Hello World generic struts application to get you started.

You will be able to further build out your application using the directory structure following the instructions on Maven Directory Structure.

/
+- src/
|  +- main/
|  |  +- java/
|  |  |  +- ...
|  |  +- resources/
|  |     +- ...
|  +- test/
|  |  +- java/
|  |  |  +- ...
|  |  +- resources/
|  |     +- ...
|  +- site/
|     +- xdoc/
|        +- ...
+- target/
|  +- ...
+- project.xml
+- README.txt
+- LICENSE.txt

Directory 1:
src -> main -> java
In this directory, place your java class files. In the basic struts template, you will have the example package stored here.

src -> main -> java -> example -> ExampleSupport.java
src -> main -> java -> example -> Login.java
src -> main -> java -> example -> HelloWorlds.java

Directory 2:
src -> main -> resources
In this directory, place your resource files.

src -> main -> resources -> example.xml
src -> main -> resources -> struts.xml
src -> main -> resources -> NOTICE.txt
src -> main -> resources -> LICENSE.txt
src -> main -> resources -> example -> Login-validation.xml
src -> main -> resources -> example -> package.properties
src -> main -> resources -> example -> package_es.properties

Directory 3
src -> main -> webapp
Location for the jsp files

src -> main -> webapp -> example -> HelloWorld.jsp
src -> main -> webapp -> example -> Login.jsp
src -> main -> webapp -> example -> Menu.jsp
src -> main -> webapp -> example -> Missing.jsp
src -> main -> webapp -> example -> Register.jsp
src -> main -> webapp -> example -> Welcome.jsp
src -> main -> webapp -> WEB-INF -> web.xml

Directory 4
Now set up a place for your unit tests. This is actually not part of the basic struts application but could be if test cases are added by the developers.

src -> test -> java -> example -> ExampleSupportTest.java
src -> test -> java -> example -> LoginTest.java
src -> test -> java -> example -> HelloWorldsTest.java

POM File
A lot of additional configurations are placed in the POM file. Follow the Maven documentation for specifics. However, for beginners, you will want to use Eclipse or some other tool to build your base pom.xml file held at the root to the app. I added the jar files used by struts in the maven dependencies sections and it automatically filled out the appropriate sections of the POM.xml file.

My beginning POM file looks like this.

  4.0.0
  trisummit
  trisummit
  0.0.1-SNAPSHOT
war
  trisummit

    Jira
    http://applications.trisummit.net/jira/

    Bamboo
    http://applications.trisummit.net/bamboo/

   Brian Nettles
      svn://trisummit.net:3690/trisummit/

    Trismmit Technologies
    http://trisummit.net

          org.apache.maven.plugins
         maven-compiler-plugin
         2.1
                  1.6 1.6 

      com.opensymphony
      xwork-core
      2.1.6
      jar
      compile

      ognl
      ognl
      2.7.3
      jar
      compile

      freemarker
      freemarker
      2.3.9
      compile

                junit
                junit
                4.8.1

      commons-fileupload
      commons-fileupload
      1.2.1

      commons-io
      commons-io
      20030203.000550

      org.apache.struts
      struts2-core
      2.1.8.1

        ip-97-74-115-5.ip.secureserver.net
        ip-97-74-115-5.ip.secureserver.net-releases
        http://applications.trisummit.net/artifactory/libs-releases-local

Now open the command line and from the root of the application, type:

mvn compile

This will compile your application

Now type

mvn war:war

This will create your war file complete with the jar files included and place it in the target directory. Your jar files are managed from the repositories and not stored in your source control.

Now go deploy your war file on Tomcat.

Jive Software has now released their new plugin called Ideation. It is an idea storming application to be used directly within your communities. We have been seeking the perfect idea storming application for some of our various communities and there are several things that I like about this one.

1. It sits directly inside of your community as a new tab. Many idea storming solutions are hosted outside of the community.
2. It is implemented as a plugin so it does not require any customization to your base application.
3. It has all of the components of a full blown idea storming application to bring your community driven ideas to fruition.
4. If you are already a customer of Jive Software, the cost for the implementation is similar to most of thier other add-on modules – about $20,000.

For now I am posting the pdf file provided by Jive Software which goes over the high level conceptualization of idea storming. I am also providing the link to the 45 minute recorded webex presentation provided by Jive Software.

PDF Presentation Slides

Webex Presentation of Ideation

Other enterprise level idea storming applications we have looked at were as follows:
1. Salesforce.com which was quoted to us at around $100,000.
2. Lithium technologies which also does well with this application – but you need to be on Lithium for your communities to use this.
3. Jira has idea storming built in; however, this is in a project management / bug tracking application – not the community which is where it would be most useful. Atlassian would benefit by placing this application inside of Confluence instead.

Now that we have been able to kick the tires some, we give the Jive Software Ideation plugin two thumbs up.

ideation

You ever run into this statement when you are already logged in as root? Quite confusing. I encountered it while installing Jive SBS on a Red Hat Linux 4.0 machine. I would run the installation script as rpm -ip jive-sbs-versionnumber.rpm and would encounter the error message. To continue I had to uninstall the failed installation of Jive using the following commands:

rpm -qa j* and then find the name of the jive installed package.
rpm -e jive-sbs_versionnumber
rm -rf /usr/local/jive

Afterwards, I successfully installed the application by running the command prepended with sudo.

sudo rpm -ip jive-sbs-versionnumber.rpm

What I come to find out is that the Jive application runs as the Jive user. All start | stop | restart commands are inteded to be run as the user “Jive”. You can run all of these commands as root by prepending them with sudo. Or you can change the password of the jive user to a password you know, login as the jive user, and then run the commands without prepending with sudo.