Eclipse/WOLips

I have Eclipse/WOLips working (Eclipse 2.1.3 with WOLips 1.0.7.50 on OS X Panther). Eclipse is a very nice Java IDE, providing many features that Xcode currently is missing for WebObjects/Java development (re-factoring tools, code completion, etc) and without some of Xcode’s peculiarities (indexing anyone?).

I had to struggle a bit to get it going, but with help from a couple of lists [ A , B ] I’ve got it all straightened out.

Here are a few things I ran into that might help someone else:

  • Apply the WebObjects 5.2 hack found here. I made copies of the required frameworks into /System/Library/PrivateFrameworks_Disabled/ and then linked the correct ones into /System/Library/PrivateFrameworks/ so I can easily switch back and forth if I need to change IDE’s.
  • Do not try Eclipse 3.0 M* with WOLips – It’s really not ready… really.
  • Remove the Apache Xerces.jar from your class path – It will crash Eclipse 2.1.3 and cause you to waste an entire day discovering how really not ready Eclipse 3.0 M* is… Oh, yeah, this is documented in the Eclipse/WOLips help section… once you get Eclipse running. OK, its on the WOLips website too, but who would think to look there? Honestly.
  • Apply the Eclipse org.eclipse.core.ant patch found here
  • To add Webserver Resources (like images, etc) you need to do two things:
    First, add them to the wsresources section of the build.xml file so it looks something like this:

    <wsresources dir=".">
    	<include name="*.jpg"/>
    	<include name="*.gif"/>
    	<exclude name="**/*.woa/**"/>
    </wsresources>

    Then, go to: Eclipse -> Window -> Preferences -> WOLips -> ProjectBuilder -> WOApp Resources Include and add *.jpg, *.gif, etc. to the list.

I think that’s it for now, I’ll post more if I come across it..

Bad, bad mailserver! (redux)

As a follow up to my initial post on the subject, an additional problem that seems to be affecting people with OS X and Cyrus pertains to new log files. Apparently Cyrus roll’s its log file when it exceeds 10MB. For some people the ownership of the new log file is incorrect (root/wheel instead of cyrus/mail) and it causes Cyrus to fail.

This Apple forum thread offers a fix by Matthias Stegner. He suggests creating a bunch of log files in advance:

touch log.0000000002 
... 
touch log.0000000099 
touch log.0000000100 
chown cyrus:mail * 

This might buy you some time until Apple has posted a fix

404 fun..

Found on the web:

404 File Not Found

I ate your Web page.
Forgive me. It was juicy

And tart on my tongue.

Translation:

The URL you requested could not be found on this server.

Some people! Some people’s web pages…

Bad, bad mailserver!

I had a client call me to day with a catastrophic failure of their Cyrus IMAP server running on Panther. They were getting this error in their Cyrus startup log:

DBERROR db4: 
    fatal region error detected; run recovery
DBERROR: dbenv->open '/var/imap/db' failed:  
DB_RUNRECOVERY: 
    Fatal error, run database recovery
    Fatal error: can't initialize mboxlist 
    environment
DBERROR db4: 
    fatal region error detected; run recovery
DBERROR: dbenv->open '/var/imap/db' failed: 
DB_RUNRECOVERY: 
    Fatal error, run Fatal error: can't 
    initialize mboxlist environment

Trying to reconstruct resulted in this error:

reconstruct:
    can't initialize mboxlist environment

Some searching in the Apple discussion forums led to this thread: 10.3.2 Mail Server: error on RECONSTRUCT which contains a fix by Dr. Fishopolis.

Since the Apple discussion forums are so hopelessly pokey right now I’ve decided to document the fix here (so I can find it again if I need it 🙂

Before you start: These instructions assume that the Cyrus mail store is in its default location: /var/spool/imap, and hasn’t been moved somewhere else (like to the XRAID for instance). Check the location in: Server Admin -> Mail -> Settings -> Advanced -> Mail store and replace any mention of /var/spool/imap with your sepecific path.

  • Become root for a while:
    sudo -s
  • Backup the /var/imap/ and var/spool/imap directories:
    ditto /var/imap/ /var/imap.bak/
    ditto /var/spool/imap/ /var/imap.spool.bak/
  • Blow away the /var/imap/ directory:
    rm -r /var/imap
  • And recreate it:
    /usr/bin/cyrus/tools/mkimap
  • Correct the permissions:
    chown -R cyrus /var/imap
    chgrp -R mail /var/imap
  • If the cyrus user doesn’t have a shell specified, do it now:
    niutil -createprop . /users/cyrus shell /bin/bash
  • Become the cyrus user:
    su cyrus
  • Now run the reconstruct command:
    /usr/bin/cyrus/bin/reconstruct
  • You should see cyrus work through your mail accounts like this:
    user/user1
    user/user1/Folder1
    user/user1/Folder2
    user/user2
    user/user2/Folder1
    user/user2/Folder2
  • If any of your users are missing personal mail folders reconstruct them individually using the account reference above (ie: user/user1) – You may need to run this command multiple times if the user has nested personal folders. Just run it until it stops producing errors:
    /usr/bin/cyrus/bin/reconstruct -r -f user/username
  • Finally, stop being cyrus, then stop being root:
    exit
    exit

There, now wasn’t that fun.

Follow-up 1: There is associated problem pertaining to log files which is documented here.

Follow-up 2: Apparently there is an undocumented flag for the reconstruct command in the Panther version of Cyrus: "-i". It is supposed to rebuild nested user folders. I haven’t tested it (because I don’t have a broken email server right now :-)) but it is being recommended by Apple support.

Follow-up 3: Apple has posted a knowledge base article on the subject, read about it here.

Follow-up 4: Could it be we’ve discovered the ultimate fix for this? Read on.

Update day

(kinda like a snow day, only… not)

So, I’ve installed OS X 10.3.3, and WebObjects 5.2.3, and every thing is just working swimingly…

Happy, happy, happy, happy, I’m so happy