Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-1528

Deploying a custom Mailet results in ClassNotFound exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0-beta4
    • None
    • None
    • Ubuntu 13.04, 64 bit on EC2 micro instance

    Description

      Hi,

      I created a custom Mailet and created a jar file from it. I copied the custom-mailet.jar into $JAMES_HOME/conf/lib folder as suggested by $JAMES_HOME/bin/setenv.sh. Then I copied $JAMES_HOME/conf/mailetcontainer-template.conf to $JAMES_HOME/conf/mailetcontainer.conf and added the following line below <processor state="transport" enableJmx="true">
      <mailet match="All" class="com.company.CustomMailet"/> which is the full classpath of the Mailet that I added with custom-mailet.jar

      However, when I want to (re-)start James, the server crashes with the following exception:

      Caused by: java.lang.ClassNotFoundException: com.company.CustomMailet
      at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
      at org.apache.james.container.spring.bean.factory.mailetcontainer.AbstractLoaderBeanFactory.load(AbstractLoaderBeanFactory.java:44)
      at org.apache.james.container.spring.bean.factory.mailetcontainer.MailetLoaderBeanFactory.getMailet(MailetLoaderBeanFactory.java:45)
      ... 29 more

      To my understanding, James does not find the class that I added with $JAMES_HOME/conf/lib/custom-mailet.jar. Is this a bug or am I doing something wrong?

      Thanks!

      Attachments

        Activity

          People

            Unassigned Unassigned
            sardinendose Markus Klems
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: