Date Created: Sat 09-Jul-2011

Get my WebSphere Application Server course here >> http://www.themiddlewareshop.com/products/


    How to add shared libraries to Tomcat within Eclipse

    Open Tomcat server definition



    Click Open launch configuration in the General Information section as shown below



    Clink on User Entries and then Add External JARs



    Browse and locate the shared lib (JAR)

    What I would I would recommend is that you create a separate Java project with Ant/Maven to automatically create the JAR file as required and place it into a shred JARS location, for referencing form Tomcat as required for testing development.

    Below is an example for a class not found when a shared library was not available.

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    javax.servlet.ServletException: Servlet execution threw an exception

    root cause

    java.lang.NoClassDefFoundError: com/screv/shared/utilities/ServletHelpers
    com.screv.GetSession.doGet(GetSession.java:61)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

    root cause

    java.lang.ClassNotFoundException: com.screv.shared.utilities.ServletHelpers
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
    com.screv.GetSession.doGet(GetSession.java:61)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

    note The full stack trace of the root cause is available in the Apache Tomcat/7.0.11 logs.

    Get my WebSphere Application Server course here >> http://www.themiddlewareshop.com/products/


Steve Robinson - IBM Champion 2013

About Me

Steve Robinson has been working in IT for over 20 years and has provided solutions for many large-enterprise corporate companies across the world. Steve specialises in Java and Middleware.

In January 2013, I was awarded the prestigous 'IBM Champion' accolade.


Read my books?

IBM WebSphere Application Server 8.0 Administration Guide

IBM WebSphere Application Server 8.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Categories

Other Categories