2、问题:在Eclipse中执行,报Could not find the main class.PRogram will exit. console窗口: java.lang.ExceptionInInitializerError Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException) (Caused by org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException)) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351) at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:53) Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstrUCtor(LogFactoryImpl.java:397) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) ... 4 more Caused by: java.lang.NullPointerException at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:374) ... 5 more Exception in thread "main"
解答: Possible solution: I edited the file "tomcat50x.server" under C:/eclipse/plugins/com.objectlearn.jdt.j2ee_3.0.1/servers and changed -Djava.endorsed.dirs="${serverRootDirectory}/bin;${serverRootDirectory}/common/endorsed" to -Djava.endorsed.dirs="${serverRootDirectory}/common/endorsed" in the following ´tags´: <startVmParameters>-DJAVA_HOME="${jrePath}" -Dcatalina.base="${serverRootDirectory}" -Dcatalina.home="${serverRootDirectory}" -Djava.io.tmpdir="${serverRootDirectory}/temp" -Djava.endorsed.dirs="${serverRootDirectory}/bin;${serverRootDirectory}/common/endorsed"</startVmParameters> and <stopVmParameters>-DJAVA_HOME="${jrePath}" -Dcatalina.base="${serverRootDirectory}" -Dcatalina.home="${serverRootDirectory}" -Djava.io.tmpdir="${serverRootDirectory}/temp" -Djava.endorsed.dirs="${serverRootDirectory}/bin;${serverRootDirectory}/common/endorsed"</stopVmParameters>