Search code examples
javaservletsjarstormpath

Stormpath runtime error: com.stormpath.sdk.servlet.filter.StormpathFilter was found, but is missing another required class


I'm trying to run a java web application including Stormpath for user registration.

I've added the following libraries to the WebContent/WEB-INF/lib:

-javax.servlet-api-3.1.0.jar
-stormpath-sdk-api-1.0.RC3.1.jar
-stormpath-sdk-servlet-1.0.RC3.1.jar
-stormpath-servlet-plugin-1.0.RC3.1.jar

However, at runtine (after deploy) I get the following error:

Error 500: javax.servlet.ServletException: Filter [StormpathFilter]: com.stormpath.sdk.servlet.filter.StormpathFilter was found, but is missing another required class.

Anybody that can help?
I'm a newbie in web developing.

Thanks.


Solution

  • You should be using Maven to manage your dependencies since the jars that you have added depend on many other ones.

    In case you still want to do it manually:

    1.Check out the project from GitHub:

    $ git clone https://github.com/stormpath/stormpath-sdk-java.git
    

    2. Build the project:

    $ mvn clean install
    

    3. Download all runtime dependencies:

    $ mvn dependency:copy-dependencies -DincludeScope=runtime
    

    4. Enter the target/dependency directory of the module you will be using. For example, with the Stormpath Java SDK, the default option is an Apache HTTP-client-based runtime:

    $ cd extensions/httpclient/target/dependency
    

    Here you will find a list of all the runtime dependencies necessary for the module.

    Note that Stormpath and Shiro use the SLF4J logging API instead of commons-logging. Commons-logging is however in the runtime dependency list because HTTPClient needs it. Because of this conflict, you will probably want to excludecommons-logging.jar and include jcl-over-slf4j.jar (downloaded from maven central) instead, which is compatible with SLF4J logging and satisfies the needs of HTTPClient.