• strict warning: Non-static method view::load() should not be called statically in /home/john567/ on line 843.
  • strict warning: Declaration of views_plugin_display::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/john567/ on line 1877.
  • strict warning: Declaration of views_plugin_display_page::options_submit() should be compatible with views_plugin_display::options_submit(&$form, &$form_state) in /home/john567/ on line 481.
  • strict warning: Declaration of views_plugin_display_block::options_submit() should be compatible with views_plugin_display::options_submit(&$form, &$form_state) in /home/john567/ on line 193.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /home/john567/ on line 745.
  • strict warning: Declaration of views_handler_argument_broken::ui_name() should be compatible with views_handler::ui_name($short = false) in /home/john567/ on line 770.
  • strict warning: Declaration of views_handler_sort_broken::ui_name() should be compatible with views_handler::ui_name($short = false) in /home/john567/ on line 82.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home/john567/ on line 585.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home/john567/ on line 585.
  • strict warning: Declaration of views_handler_filter_broken::ui_name() should be compatible with views_handler::ui_name($short = false) in /home/john567/ on line 609.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /home/john567/ on line 128.

JBoss shutdown a running standalone instance

To Shutdown a running standalone instance running on OS X:

  1. open Terminal
  2. navigate to [JBOSS_HOME]/bin
  3. ./ --connect command=:shutdown

JBoss should stop. You see output like{"outcome" => "success"}

Useful Git Commands

Use Case: I create a local branch that I want to push into GitHub

git push -u origin local_branch_name

this will push that branch up to GitHub


Use Case: I want to pull and track a remote branch that I currently don't have in local

git checkout --track origin/remote_branch

this pulls the remote_branch to local, configures tracking it on the remote. Locally you will now be on that branch


Use Case: I want to delete a remote branch and its local branch

git push origin :branch_name

git branch -d branch_name

This pushes an empty to the remote and thus deletes remote branch. The second command deletes the local branc


Use Case: running git branch -a on my local repo shows remote branches which have been already deleted in the remote.

git remote prune origin


This fixes the information that local has about the remote. Now git branch -a will return the correct information about remote branches.


Use Case: I want to clone a git repo to specific changeset/revision:



Use Case: I went to a version of one file from one branch into the branch I'm working in.

Run this from the branch that you want to receive the file


git checkout otherbanch theFile.txt


Error org.springframework.web.util.Log4jConfigListener

Cannot start java web application in STS (tcServer, Tomcat). This error occurs when starting a tcServer.


SEVERE: Error configuring application listener of class org.springframework.web.util.Log4jConfigListener
java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener


I have been able to fix this problem by running "maven clean" and "maven install" from STS and then restarting the server.

Subversion and Maven Tips and Tricks to save time updating

Lately I've been programming with a mid-sized group of developers. We are working on Windows for our development environment. Using subversion for source code control and maven for our build process. Because we have enough developers that there are code check-ins almost 24x7 it is important that other developers update their local code every day.


For a few days I had been manually updating the code from our repository by using TortoiseSVN and then running a command line "mvn clean install". Although this only took a few minutes to do each day I decided to write a batch file to automate this process.

What I wanted was something that would run:


svn update --username

mvn clean install -Dmaven.test.skip=true


This was simple enough to do in a single batch file. However once the process completed the cmd window would close so that I couldn't read any messages that were output. To get around this I created three batch files.  The first file that runs is named DailyUpdate.bat and includes one line:

cmd /K svnUpdate.bat

the file svnUpdate.bat has two lines

svn update --username

cmd /K mvnCleanInstall.bat

the final file mvnCleanInstall.bat has one line:

mvn clean install -Dmaven.test.skip=true


Now the cmd window stays open after this completes. I simplified the process for updating to the latest code and doing a local build.

Normally I have a shortcut to  DailyUpdate.bat in my windows startup directory so that it runs every time I start up my machine. There are some weeks where I don't want this running on startup, in that case I remove the shortcut.


Sending email from localhost

I have recently used Simplenews  module to publish and send newsletters to lists of subscribers.  Simplenews has a feature to send an email to a test user, I wanted to use this to see exactly how the newletters would look.  I do much of my development from a local machine and I found that my test emails from my local machine were being incorrectly categorized as spam.  Basically I couldn't receive any email which I sent.


 I looked at my mail.log file to see the exact details of what was happening. Below is a section of what I found:<>,[]:25, delay=1.5, delays=0.33/0.05/0.94/0.17, dsn=5.0.0, status=bounced (host[] said: 554 Service unavailable; Client host [] blocked using zen.dnsbl; (in reply to RCPT TO command))...


I spent a few hours seaching on the internet for a way that I could send email from my localhost without having it bounce back as spam. A friend pointed my to this information from page 9 of the MAMP manual:


Smart Host: Many spam filters will identify emails sent through dynamic IPs as spam. To avoid this, you can select a SMTP server with static IP that will cover the
actual sending process of the email for you.


This was very helpful because it helped move me toward a fix.  After a lot of searching  and trial and error I finally came to a solution. I didn't hit too many deadends along the way either, which was nice.

 The solution was to change the configuration of my local postfix installation.  These are configured in the file /private/etc/postfix/ and they affect how email is handled from my local machine.  I added the following four lines to the end of my file

 mydomain =
myorigin = $mydomain
relayhost = []

After making this change I have had no problems sending Simplenew test emails from my local machine and they are no longer categories as spam.  I have been receiving the test emails in less than one minute. Once I'm satisified that the test email renders as expected I migrate my newletter to a hosted webserver.

 * the actual URLs that I worked with have been replaced with above


Nice Menus Duplicate issue

Nice menus appear to output duplicate menus i.e. the same menu is output twice. This happens in certain configurations and can be difficult to fix if you do not know where to look.

For example, in the image below, the menu item "Menu to Front" is output twice. This site is configured with 1 menu item enabled in the Primary Links menu. There is also a nice_menus block enabled which has its Source Menu Tree set to Primary Links.

nice menu duplicate

Nice_menus is working exactly as it should. The reason this happens is that the Theme is outputting the Primary Links menu and Nice_menus is also outputting the Primary Links menu. 

I know of two configurations that can fix this which will allow the menu to appear only once. 

Method 1: Configure your Theme not to output the menu. In effect Nice_menus will be outputting your menu and the menu will appear only once.

  1. Navigate to Administer | Site Building | Themes
  2. Find your Theme and click configure
  3. Under Toggle display uncheck the box for Primary Links (or whichever menu you want the theme not to output)

Method 2: You can create a new menu, a menu that your Theme does not natively output. You will then configure Nice_menus to output this menu.

  1. Navigate to Administer | Site Building  | Themes
  2. Click Add Menu
  3. Give your menu a Menu name and Title , click Save
  4. Click Add Item and then add your menu items.
  5. Navigate to Administer | Site Building | Blocks
  6. Find your nice_menus block, click configure
  7. Under the Source Menu Tree select the new menu that you created in #3 above.

I prefer method 2 above because not every theme will have the configuration option. It also seems more intuitive to keep the expected Primary Link settings as provided by the theme.

Monthly archive block

If you look at any website today you may notice that many have links to archived content. I find this feature extremely useful because it is a very intuitive way to view content. Implementing a Monthly archive block in Drupal is very easy. In fact it took me only about 15 minutes to implement and to post about my experience. I followed the tutorial Drupal archive list. The steps are very easy to follow. You will need to do some minimal Views configuration and you need to configure the block to appear on your site. But that is all. I am very happy with my results and I think everyone doing this will be happy with their results too.

Acquia Webinar

Acquia runs 1 hour long Webinars each week. I watched and listened to one recently Getting started with Acquia Drupal and the Acquia network. This was hosted by Acquia Marketing Director Bryan House. It was a very informative webinar and it had got me thinking more about what Drupal can do.

Drupal photo gallery

The photo gallery on DrupalGanger was built with the help of Jeff Eaton's tutorial. The tutorial teaches a great way to display photos on a Drupal site. Now that I've used this photo gallery for a few months I highly recommend the tutorial.

Syndicate content