Cannot find setclasspath.sh when starting up Tomcat 7

In attempting to start Tomcat 7 on my MacBook Pro on El Capitan, I was getting the following error:


amp-macbook:Cellar anton$ catalina start
Cannot find /usr/local/Cellar/tomcat7/7.0.63/libexec/bin/setclasspath.sh
This file is needed to run this program

I found the issue to be due to my CATALINA_HOME environment variable. To resolve this, just do the following from your terminal:


unset CATALINA_HOME

That’s it!

ActiveMQ error: “java.lang.RuntimeException: javax.jms.JMSException: Invalid version: 6, could not load org.apache.activemq.openwire.v6.MarshallerFactory”

I was working on a project that needed to send JMS messages to an Apache ActiveMQ broker that was running an older version, specifically, 5.4.x. It started failing with the error below when I switched to it, but had no issues when it was connecting to another broker running 5.9.0.

java.lang.RuntimeException: javax.jms.JMSException: Invalid version: 6, could not load org.apache.activemq.openwire.v6.MarshallerFactory

Note: It could be another version.

I googled to see what the problem was and read that it had to do with a version mismatch between my client and broker. Turned out that I was using 5.9.0, which is why it didn’t conk out with the other broker. Unfortunately, I didn’t have control of the current broker running 5.4.x, so it was back to the drawing board.

Thankfully, I found that ActiveMQ has a legacy dependency that you can use to resolve the issue. Simply add the following and you’ll be good to go:


<dependency>
    <groupId>org.apache.activemq</groupId>
    <artifactId>activemq-openwire-legacy</artifactId>
    <version>5.9.0</version>
</dependency>

How to get admin access to Tomcat 7 on OS X Yosemite

In continuing the path to learn more about Tomcat 7, I had to configured my local instance to give me admin access to the “Server Status,” “Manager App,” and “Host Manager” pages.  It was actually quiet easy.

    1. In your terminal, go to /usr/local/Cellar/tomcat7/7.0.63/libexec/conf
    2. vim tomcat-users.xml
    3. Add the following:

    
      <role rolename="manager-gui"/>
      <role rolename="admin-gui"/>
      <user username="tomcat" password="s3cret" roles="manager-gui,admin-gui"/>
    

Fix for undeletable user-defined Squirrelmail folder

I run my own mail server and use Squirrelmail to facilitate webmail access using HTTPS.  I encountered problems trying to delete a folder that I created as part of a test to find out if things were working correctly:

ERROR : Could not delete “Archive” 
Given: Invalid mailbox name

SquirrelMail is a Webmail application started by Nathan and Luke Ehresman and written in the PHP scripting language. It can be installed on almost all web servers so long as PHP is present and the web server has access to an IMAP and SMTP server

After some digging around, I found that after modifying a setting via ./conf.pl I was able to delete the folder.  If you’re experiencing the same thing, do the following:

1.   Open a terminal window.

2.   Navigate to Squirrelmail’s root dir, which in my case is /usr/share/squirrelmail.

3.   Navigate to the config/ folder then type: ./conf.pl.

4.   Select option 3 then 1 and enter none.

5.   Save your changes and exit.

It may not work on all situations, and some have said that in version 1.4.0, you may need to set/pick your IMAP server (I use Dovecot), like so:

1.   Open terminal window (again).

2.   Navigate to the config/ folder then type: ./conf.pl.

3.  From the menu options, select D, then save and exit.

If you still have problems after performing these steps, modify your php.ini config file to report more verbosely by changing the following lines:

display_errors = on
error_reporting = E_ALL

After saving the modifications you just made, restart your web server via (I run FC6 so) service httpd restart, then watch your Apache error_log for more info. 

That’s it.  Hopefully, this helps you from having to do the legwork.  Take care.  =0)