Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-16-2008, 11:34 PM
Former Zimbran
 
Posts: 26
Question [SOLVED] error running ZimletHandler

After installing a zimlet I wrote, and despite the fact that it seems to be working correctly, I'm seeing a message like this in mailbox.log every time an email comes in:

Code:
2008-08-15 17:17:20,106 INFO  [LmtpServer-228] [ip=192.168.4.41;] lmtp - Delivering message: size=2440 bytes, nrcpts=1, sender=mike+caf_=mike=z.lodick.com@lodick.com, msgid=<2740.20080
815181706@wiialerts.com>
2008-08-15 17:17:20,108 WARN  [LmtpServer-228] [name=mike@lodick.com;mid=10;] ParsedMessage - Unable to parse part 1 (, text/plain) of message with Message-ID <2740.20080815181706@wiia
lerts.com>.  Object will not be indexed.
com.zimbra.cs.object.ObjectHandlerException: error running ZimletHandler net_milodev_tiny
    at com.zimbra.cs.object.ObjectHandler.parse(ObjectHandler.java:114)
    at com.zimbra.cs.mime.MimeHandler.getObjects(MimeHandler.java:266)
    at com.zimbra.cs.mime.MimeHandler.getDocument(MimeHandler.java:245)
    at com.zimbra.cs.mime.ParsedMessage.analyzePart(ParsedMessage.java:1156)
    at com.zimbra.cs.mime.ParsedMessage.analyzeBodyParts(ParsedMessage.java:379)
    at com.zimbra.cs.mime.ParsedMessage.analyzeNonBodyParts(ParsedMessage.java:407)
    at com.zimbra.cs.mime.ParsedMessage.analyzeFully(ParsedMessage.java:460)
    at com.zimbra.cs.mailbox.Mailbox.addMessage(Mailbox.java:4525)
    at com.zimbra.cs.mailbox.Mailbox.addMessage(Mailbox.java:4514)
    at com.zimbra.cs.filter.ZimbraMailAdapter.addMessage(ZimbraMailAdapter.java:395)
    at com.zimbra.cs.filter.ZimbraMailAdapter.doDefaultFiling(ZimbraMailAdapter.java:389)
    at com.zimbra.cs.filter.ZimbraMailAdapter.executeActions(ZimbraMailAdapter.java:268)
    at org.apache.jsieve.SieveFactory.evaluate(SieveFactory.java:159)
    at com.zimbra.cs.filter.RuleManager.applyRules(RuleManager.java:196)
    at com.zimbra.cs.lmtpserver.ZimbraLmtpBackend.deliverMessageToLocalMailboxes(ZimbraLmtpBackend.java:379)
    at com.zimbra.cs.lmtpserver.ZimbraLmtpBackend.deliver(ZimbraLmtpBackend.java:136)
    at com.zimbra.cs.lmtpserver.LmtpHandler.processMessageData(LmtpHandler.java:375)
    at com.zimbra.cs.lmtpserver.TcpLmtpHandler.continueDATA(TcpLmtpHandler.java:67)
    at com.zimbra.cs.lmtpserver.LmtpHandler.doDATA(LmtpHandler.java:364)
    at com.zimbra.cs.lmtpserver.LmtpHandler.processCommand(LmtpHandler.java:174)
    at com.zimbra.cs.lmtpserver.TcpLmtpHandler.processCommand(TcpLmtpHandler.java:61)
    at com.zimbra.cs.tcpserver.ProtocolHandler.processConnection(ProtocolHandler.java:160)
    at com.zimbra.cs.tcpserver.ProtocolHandler.run(ProtocolHandler.java:128)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:595)
Caused by: com.zimbra.cs.zimlet.ZimletException: null regex value
    at com.zimbra.cs.zimlet.ZimletException.ZIMLET_HANDLER_ERROR(ZimletException.java:36)
    at com.zimbra.cs.zimlet.handler.RegexHandler.match(RegexHandler.java:50)
    at com.zimbra.cs.object.ObjectHandler.parse(ObjectHandler.java:106)
    ... 24 more
The actual error varies slightly, but each time the "Caused by" message is the same - "com.zimbra.cs.zimlet.ZimletException: null regex value"

The only two references to regexes in my code are in the zimlet definition xml file, here:
Code:
...
<handlerObject>Net_Milodev_Tiny</handlerObject>
<serverExtension hasKeyword="tinyurl" extensionClass="com.zimbra.cs.zimlet.handler.RegexHandler"/>
<contentObject type="tinyurl">
  <matchOn>
    <regex attrs="ig">http:\/\/tnylnk.us\/(\w{6})</regex>
  </matchOn>
</contentObject>
...
and the javascript file, here:
Code:
...
Net_Milodev_Tiny.prototype._getHtmlContent =
function(html, idx, obj, context) {
	var escapedUrl = obj.replace(/\"/g, '\"');
	if (escapedUrl.substr(0, 4) == 'www.') {
		escapedUrl = "http://" + escapedUrl + "/";
	}
	html[idx++] = "<a target='_blank' href='";
	html[idx++] = escapedUrl;
	html[idx++] = "'>";
	html[idx++] = AjxStringUtil.htmlEncode(obj);
	html[idx++] = "</a>";
	return idx;
};
...
Sharp eyed observers will notice that I copied the last bit exactly from the com_zimbra_url zimlet, in order to get the tiny urls recognized to open in a new window, since I had to set the priority of this zimlet higher than the com_zimbra_url zimlet.

In searching the forums, I found 2 threads that obliquely reference similar problems, with no solutions (here and here).

Has anyone seen this before, or have an idea how to fix it? As I said, the zimlet appears to work correctly, but the errors are not exactly comforting.

Mike
Reply With Quote
  #2 (permalink)  
Old 08-30-2008, 08:08 PM
Former Zimbran
 
Posts: 26
Default

After talking to a Zimbra engineer, I was told that this error stemmed from not setting a ZIMLET_CONFIG_REGEX_VALUE in the globalConfig section in the config.xml file, while having the serverExtension element in the net_milodev_tiny.xml file.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.