facebook

Errors starting Tomcat 5 from within Eclipse via MyEclipse

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #230862 Reply

    JamesHearn
    Member

    I am trying to run and debug a tomcat server from within Eclipse. While I can run it from the command line just fine, when I try to launch it from within the IDE it aborts shortly after begining to initialize. I see this message in the Eclipse console:

    Bootstrap: Class loader creation threw exception
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
        at org.apache.tomcat.util.compat.JdkCompat.<clinit>(JdkCompat.java:55)
        at org.apache.catalina.startup.ClassLoaderFactory.<clinit>(ClassLoaderFactory.java:63)
        at org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:103)
        at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:196)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:402)

    I am using the Native Eclipse 3.1.0M7 from the Fedora Core 3 development branch, MyEclipse 3.8.4+QF2-BetaFor3.M7, Tomcat 5.0.30 from the JPackage project, and the JDK java-1.5.0-sun-1.5.0.03 built from source rpm to the JPackage.org guidelines. The appropriate jakarta-commons packages are installed as well. This is a fresh install of Eclipse and MyEclipse.

    I am using the same jdk for both Eclipse and Tomcat:

    java version "1.5.0_03"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
    Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode, sharing)

    I have installed the pde plugins from the JPackage repository.

    [jjh94@mijin lib]$ la /usr/share/eclipse/plugins/ | grep pde
    -rw-rw-r--  1 root java 144K May 26 11:01 org.eclipse.pde_3.1.0.jar
    drwxrwxr-x  8 root java 4.0K Jun  7 10:54 org.eclipse.pde.build_3.1.0
    -rw-rw-r--  1 root java 463K May 26 11:01 org.eclipse.pde.core_3.1.0.jar
    drwxrwxr-x  4 root java 4.0K Jun  7 10:54 org.eclipse.pde.doc.user_3.1.0
    drwxrwxr-x  3 root java 4.0K Jun  7 10:54 org.eclipse.pde.junit.runtime_3.1.0
    -rw-rw-r--  1 root java 138K May 26 11:01 org.eclipse.pde.runtime_3.1.0.jar
    drwxrwxr-x  3 root java 4.0K Jun  7 10:55 org.eclipse.pde.source_3.1.0
    -rw-rw-r--  1 root java 2.5M May 26 11:00 org.eclipse.pde.ui_3.1.0.jar

    Here is the output when I launch Tomcat from the command line:

    [jjh94@mijin lib]$ sudo tomcat5 run
    Using CATALINA_BASE:   /usr/share/tomcat5
    Using CATALINA_HOME:   /usr/share/tomcat5
    Using CATALINA_TMPDIR: /usr/share/tomcat5/temp
    Using JAVA_HOME:       /usr/lib/jvm/java
    Jun 10, 2005 10:37:19 AM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Jun 10, 2005 10:37:19 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 1641 ms
    Jun 10, 2005 10:37:19 AM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Jun 10, 2005 10:37:19 AM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.0
    Jun 10, 2005 10:37:19 AM org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    Jun 10, 2005 10:37:19 AM org.apache.catalina.core.StandardHost getDeployer
    INFO: Create Host deployer for direct deployment ( non-jmx )
    Jun 10, 2005 10:37:19 AM org.apache.catalina.core.StandardHostDeployer install
    INFO: Installing web application at context path /neteng from URL file:/var/lib/tomcat5/webapps/neteng
    Jun 10, 2005 10:37:21 AM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    Jun 10, 2005 10:37:21 AM org.apache.jk.common.ChannelSocket init
    INFO: JK2: ajp13 listening on /0.0.0.0:8009
    Jun 10, 2005 10:37:21 AM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=1/48  config=/usr/share/tomcat5/conf/jk2.properties
    Jun 10, 2005 10:37:21 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 1996 ms
    Jun 10, 2005 10:37:41 AM com.byu.neteng.server.tests.TestPicoConfig <init>
    SEVERE: java.lang.RuntimeException: Failed to access the data directory: /opt/neteng/data

    (That runtime exception is expected as I am in the process of cleaning up a crusty old codebase that I just inherited at my new job.)

    These are the settings under the MyEclipse > Application Servers > Tomcat 5 preferences.

    [x] Enable
    Tomcat Home Directory: /usr/share/tomcat5
    Tomcat Base Directory: /usr/share/tomcat5
    Tomcat Temp Directory: /usr/share/tomcat5/temp
    Optional Program Arguments: [blank]
    
    Tomcat JDK name: java-1.5.0-sun-1.5.1.03
    Optional Java VM Arguments: [blank]
    [x] Debug mode

    No paths were altered from their defaults.

    This is the contents of the /usr/share/tomcat5/server/lib directory:

    [catalina-ant5].jar
    catalina-cluster.jar
    catalina-i18n-es.jar
    catalina-i18n-fr.jar
    catalina-i18n-ja.jar
    catalina.jar
    catalina-optional.jar
    [commons-beanutils].jar
    [commons-digester].jar
    [commons-el].jar
    [commons-fileupload].jar
    [commons-logging].jar
    [commons-modeler].jar
    [jaas].jar
    [jmxri].jar
    [regexp].jar
    servlets-cgi.renametojar
    servlets-common.jar
    servlets-default.jar
    servlets-invoker.jar
    servlets-ssi.renametojar
    servlets-webdav.jar
    tomcat-coyote.jar
    tomcat-http11.jar
    tomcat-jk2.jar
    tomcat-jk.jar
    tomcat-jni.jar
    tomcat-util.jar

    This is the contents of the /usr/share/tomcat5/common/lib directory:

    [ant].jar
    [commons-collections].jar
    [commons-dbcp].jar
    [commons-el].jar
    [commons-logging-api].jar
    commons-logging.jar
    [commons-pool].jar
    [jaf].jar
    [jasper5-compiler].jar
    [jasper5-runtime].jar
    [javamail]imap-1.3.1.jar
    [javamail]imap.jar
    [javamail]mailapi-1.3.1.jar
    [javamail]mailapi.jar
    [javamail]nntp-1.3.1.jar
    [javamail]nntp.jar
    [javamail]pop3-1.3.1.jar
    [javamail]pop3.jar
    [javamail]providers-1.3.1.jar
    [javamail]providers.jar
    [javamail]smtp-1.3.1.jar
    [javamail]smtp.jar
    [jdbc-stdext].jar
    [jmxri].jar
    [jndi].jar
    [jspapi].jar
    [jta].jar
    naming-common.jar
    naming-factory.jar
    naming-java.jar
    naming-resources.jar
    [servletapi5].jar

    The .jar files in [brackets] are symlinks to the actual file in the /usr/share/java directory.

    I am deploying my project in exploded mode.

    Hopefully this is a thorough enough description of the problem and environment to find a quick solution.

    Thanks for any help and advice you might have to offer.

    –James Hearn

    ——
    For completeness’ sake I have included the content’s of today’s Eclipse .log:

    [jjh94@mijin lib]$ cat ~/Documents/Development-Work/Eclipse/.metadata/.log | grep 2005-06-10
    !SESSION 2005-06-10 07:56:14.342 -----------------------------------------------
    !ENTRY org.eclipse.xsd 2 0 2005-06-10 09:57:25.830
    !ENTRY org.eclipse.xsd 2 0 2005-06-10 09:57:55.536
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:42.811
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:42.815
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:42.848
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:46.909
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:46.919
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:46.928
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:46.935
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:46.941
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:46.950
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:46.957
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:46.966
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:46.977
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:47.02
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:47.10
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:47.19
    !ENTRY com.ibm.xtools.common.ui.properties 4 2 2005-06-10 10:02:47.28
    !ENTRY org.eclipse.xsd 2 0 2005-06-10 10:05:37.519
    !SESSION 2005-06-10 10:11:05.815 -----------------------------------------------
    !ENTRY com.ibm.sse.editor.xml 4 4 2005-06-10 10:16:21.197
    
    #230863 Reply

    JamesHearn
    Member

    And oh, the Properties information on the dead Tomcat process in Debug Perspective yields:

     /usr/lib/jvm/java-1.5.0-sun-1.5.0.03/bin/java -Dcatalina.home=/usr/share/tomcat5 -Dcatalina.base=/usr/share/tomcat5 -Djava.endorsed.dirs=/usr/share/tomcat5/common/endorsed -Djava.io.tmpdir=/usr/share/tomcat5/temp -Djava.library.path=/usr/lib/jvm/java-1.5.0-sun-1.5.0.03/bin:/usr/share/tomcat5/bin -Dsun.io.useCanonCaches=false -classpath /usr/share/tomcat5/bin/bootstrap.jar:/usr/lib/jvm/java-1.5.0-sun-1.5.0.03/lib/tools.jar -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,suspend=y,address=localhost:32869 org.apache.catalina.startup.Bootstrap start
    #230949 Reply

    JamesHearn
    Member

    Ok, I managed to solve this one myself.

    There were a few problems:

    First, I had some permissions errors. I needed to make the tomcat installation writeable by myself. (Rather, I made it writeable by members of the group ‘java’ of which I am a member.)

    Second, I had to add /usr/share/tomcat5/bin/commons-logging-api.jar to the classpath in the Application Server -> Tomcat 5 entry for MyEclipse.

    With that done, things seem to be working properly.

    #231249 Reply

    Scott Anderson
    Participant

    James,

    Thanks very much for following up to help others. I don’t know how we missed your original posts as you should certainly have gotten a reply from us before now. My apologies – we’ll do better next time. 🙂

    #254706 Reply

    shuetrim
    Participant

    I am having an identical problem to the one described in this thread. By adding /usr/share/tomcat5/bin/commons-logging-api.jar to the
    classpath in the MyEclipse Application Server for Tomcat 5 entry the class loader creation exception was replaced by:

    Can’t load server.xml
    Can’t load server.xml
    13/07/2006 11:56:36 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 0 ms
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
    Caused by: java.lang.NullPointerException
    at org.apache.catalina.startup.Catalina.await(Catalina.java:619)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:579)
    … 6 more

    Before making changes to permissions in my Tomcat installation, I am wanting to get more information
    about the nature of the changes that are required. Specifically, do we need to change permissions in the conf
    bin etc directories within the Tomcat $CATALINA_HOME directory or are changes only required within the webapps directory?

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Errors starting Tomcat 5 from within Eclipse via MyEclipse

You must be logged in to post in the forum log in