Search code examples
javatomcatservletswebmail

javax.servlet.unavailablexception on jwebmail launch


I'm having some trouble on using the popular jWebmail (or Java Webmail) jar on both tomcat 5.5 and 6.

I am currently trying to make it work on Tomcat 6, and I have put the javamail jar on the lib folder of tomcat as I found somewhere advised, but still cannot make it to run.

I got this error:

jul 22, 2013 10:28:54 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Excepción de reserva de espacio para servlet WebMail
javax.servlet.UnavailableException
    at net.wastl.webmail.server.WebMailServer.initStorage(Unknown Source)
    at net.wastl.webmail.server.WebMailServer.doInit(Unknown Source)
    at net.wastl.webmail.server.WebMailServlet.init(Unknown Source)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)

but I do have the last javax mail jar from Oracle website. There is no net.wastl.webmail.server.WebMailServer class in there so maybe I am missing something else and I don't find any post around where it is already solved

thanks in advance

edit:

I found this code, that must be inside the war classes, where the exception seems to be rising, but still don't understand what is happening there

protected void initStorage() {
/* Storage API */
    try {
        Class storage_api=Class.forName(config.getProperty("webmail.storage"));

        Class[] tmp=new Class[1];
        tmp[0]=Class.forName("net.wastl.webmail.server.WebMailServer");
        Constructor cons=storage_api.getConstructor(tmp);

        Object[] sargs=new Object[1];
        sargs[0]=this;

        storage=(Storage)cons.newInstance(sargs);

    } catch(InvocationTargetException e) {
        Throwable t=e.getTargetException();
        System.err.println("Nested exception: ");
        t.printStackTrace();
        System.err.println("Fatal error. Could not initialize. Exiting now!");
        System.exit(1);
    } catch(Exception e) {
        e.printStackTrace();
        System.err.println("Fatal error. Could not initialize. Exiting now!");
        System.exit(1);
    }
}

Solution

  • It's solved:

    I was trying to deploy on a Windows OS, and the Catalina log was rising advise: "WARNING: This software has never been tested under your OS"

    So, I deployed in a linux Tomcat and as soon as I added the CATALINA_HOME and the jars in the bin of the tomcat, it worked!

    Despite the requirements of jwebmail are not specifying a system, wouldn't advise to try it on Windows, I don't think I'd ever succeeded

    thanks to all!