Supplied root object of class * cannot be marshalled without top-level mapping
April 22nd, 2009Came up against a problem with (JibX) marshalling an object down to XML. Part of the problem was not finding any reference to what the error message means. So for future generations I’ve documented it here. The error message is:
org.springframework.oxm.jibx.JibxMarshallingFailureException: JiBX marshalling exception: Supplied root object of class java.util.LinkedList cannot be marshalled without top-level mapping; nested exception is org.jibx.runtime.JiBXException: Supplied root object of class java.util.LinkedList cannot be marshalled without top-level mapping
Although I had all the marshalling beans set up I was passing in a collection instead of the object that JibX was expecting. For example:
Code:
ListOfUuids lou = new ListOfUuids () ; | |
lou.setList (export) ; | |
String xml = MarshallerUtils.convertObjectToXML (marshaller, export) ; |
Which should have been (see line 3):
Code:
ListOfUuids lou = new ListOfUuids () ; | |
lou.setList (export) ; | |
String xml = MarshallerUtils.convertObjectToXML (marshaller, lou) ; |
An easy mistake to make, but made more difficult to find by not knowing what the error message means!
Create a new mailing list in Horde webmail
April 16th, 2009Horde Webmail has a couple of problems with it’s user interface which makes remembering how to do things a bit tricky. I can never seem to remember how you create mail lists (sometimes called mail groups) so thought I’d write it down.
- Log in to horde: Goto http://webmail.mydomain.com/
- Click the Inbox icon from the left hand frame.
- Click the Address Book icon from the navigation bar at the top of the screen.
- From the navigation bar again select Browse.
- From the drop down select (Create a new Contact List in) “My Address Book”
- Select the checkbox on the top line next to Name. This will select all the items on the page.
- Uncheck all the selected names so that just the checkbox on the Name row is checked.
- Click Add.
- If you want you can select some email addresses before clicking Add. Those email addresses will be added to the mailing list first.
- When the New contact list dialogue window pops up, enter the name of the new mailing list you want to add, and click Ok.
For each person you would like to add to the list:
- Select the letter navigation page link of the person you would like to add so for Tom Jones it’s filed under “T".
- Check Tom’s entry and select the name of the new mailing list from the Contacts drop down box.
- Click Add.
If you want to check which email addresses are on the list, then this is quite simple. The mail list is filed in the address book in the same way as normal address book entries.
- Click the first initial of the mailing list’s name from the navigation links at the bottom of the screen.
- Click on the name of the entry when it appears.
- This will show all the members of the list
Deleting a mailing list couldn’t be simpler.
- Find the mailing list from the initial links.
- Select the check box.
- Click the Delete link from the navigation links.
- Click Ok to say you are sure.
Deleting emails with a certain subject on the Plesk server
April 14th, 2009Occasionally a user will receive so much email that it blows the file system limit for a domain. This can be because they haven’t picked up their mail for a while or the domain has fallen into disuse.
Usually when you tell the user they have 6,000 emails to go through they start to cry! You as an administrator can help reduce the number. Generally speaking most of the emails will be spam. Here is a quick clean up program that will find and delete all the mail messages with a subject starting with “*****SPAM". These emails have been tagged by SpamAssassin as junk mail.
Code:
cd /var/qmail/mailnames/mydomain.com/firstname.surname/Maildir/new | |
ls | while read file | |
do | |
sub=`grep '^Subject: \*\*\*\*\*SPAM' "$file"` | |
if [ "$sub" != "" ] | |
then | |
echo "$file : $sub" | |
rm -f "$file" | |
fi | |
done |
Where is my Firefox web cache?
March 31st, 2009Can’t find your Firefox web cache? Simple, type:
about:cache
into the address bar. This will give you your cache statistics. There are three sections:
- Memory cache - files in memory e.g. pages, css, images
- Disk cache - files on disk e.g. pages, css, images
- Offline cache - off lines files e.g. web site icons, downloaded java classes
Each section gives the memory currently in use and the maximum available. The the case of Disk and Offline cache the directory where those files are stored is given.
If you want to fish a file from the cache, there’s an easy but awkward way of doing it. Each of the sections lets you list the contents, so to get a file from the Disk cache click the List Cache Entries link. This displays a page which contains all the elements in that cache. Search for the one you want and make a note of the file size. At the top of the page the Cache Directory is given. Open that directory and order the files by file size. Match the 2 file sizes!
All the files in the cache will have cache file names like “4A62C7E5d01″ which are nice and easy for computers to read but useless for humans. When you think you have found the one you want, make a copy of it and rename it to it’s original file name.
Voila - you’re done!
Thanks to: Display and view firefox cache files without browser cache viewer.
Setting up mailing lists under Plesk
March 14th, 2009Plesk 8 uses Mailman to manage mail lists. The default Plesk configuration allows you to create a mail lists and add users to it, but it doesn’t switch it on!
So here is what you do…
- Log in to your Plesk server via ssh
Check the status of mailman, to see if it’s running:
/etc/init.d/mailman status
- If it is running, you can go to the configure your list section below.
- If not, you will have to set the system to start it up.
- Change to the boot start up directory:
cd /etc/rc.d/rc3.d/
- and check that it is set up to start it up on boot. Check that it is not already set up:
ls -l | grep mailman
- Start up scripts start with an ‘S’ and shutdown scripts start with a ‘K’. If there isn’t one to start up mailman you must create one:
ln -s ../init.d/mailman S98mailman
- You can alter that 98 number to change the start up order.
- Next we need to start up the service:
/etc/init.d/mailman start
- You can check to make sure it is running with the status mailman command:
/etc/init.d/mailman status
- If it is running you can go to the configure your list
- If not - you are on your own! Sorry…!
- Now you can go into your Plesk admin pages, and start creating mail lists
I have almost finished the plesk mailman cheat sheet blog so I’ll post that when it’s ready.

