Warm tip: This article is reproduced from serverfault.com, please click

failed to run tomcat in eclipse

发布于 2020-11-29 06:06:57

I was doing a servlet project in eclipse. when i tried to run my tomcat server in eclipse like this(right click server-start) run tomcat in eclipse (and neither can i run my servlet app on tomcat through eclipse) it'll show "a java exception has occured" java exception and in the debugging window,it look like this console output

Exception in thread "main" java.lang.NoClassDefFoundError: java/util/logging/Logger


at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:61)
    at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:181)
    at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:133)
    at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:156)
    at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:211)
    at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:50)
Caused by: java.lang.ClassNotFoundException: java.util.logging.Logger
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 6 more

the problem is ,the server was perfectly well in eclipse yesterday,and although i can't run tomcat in eclipse ,i can start tomcat outside eclipse.i tried a different version of tomcat,reinstall eclipse and tomcat,and searched online,but the problem was not solved

i installed jdbc for sqlserver and imported the sql-jar in one of the java project in eclipse ,and besides that,i cant think of anything that can possibly make this happen....

and before i tried to reinstall tomcat,there was another error in eclipse ,,Could not load the Tomcat server configuration at \Servers\Tomcat v8.0 Server at localhost-config and after i reinstalled tomcat,this was gone ,but tomcat still cant run

thank you for your time..btw

Questioner
Boucii
Viewed
0
Boucii 2020-11-29 20:22:52

the problem was solved just after i posted this question..... i tried to use a different completely new workspace for eclipse ,and it worked.. i have no idea why...

-----update---------------------------------------------

i found where the problem is,but still dont know why. like i said above,i was trying to install jdbc and java-sql environment,within the steps,there was one step it requires to specify the exact loction where my jre folder is,(something like that) and i was using jdk12, which dont have a jre folder in the jdk folder,and i found a way to generate the jre folder manually,and that was what i did.and the database part worked out pretty good. (it seems the jdbc version i used is not the best,i suppose in the correct version it doesnt require a jre folder to be specified)

anyway,after i deleted the jre folder i generated manually, i re-configured the tomcat server in eclipse,and then the server can run in eclipse