新手求助,谢谢!按照教程做了hello world,改了包名和类名,出错信息里的main.MainConfig对应的就是demo.DemoConfig。此外,还在demo.DemoConfig加入了main方法。
public static void main(String[] args) {
JFinal.start("WebRoot", 8080, "/", 5);
}
之后,用eclipse ee直接export Runnable JAR file,配置了launch configuration,其它都是默认配置。
运行下来出错如下:
C:\>java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)
C:\>java -jar webapp.jar
2012-09-28 17:10:32.622:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
java.lang.NullPointerException
at com.jfinal.util.PathUtil.getRootClassPath(PathUtil.java:44)
at com.jfinal.server.JettyServer.doStart(JettyServer.java:128)
at com.jfinal.server.JettyServer.start(JettyServer.java:82)
at com.jfinal.core.JFinal.start(JFinal.java:165)
at main.MainConfig.main(MainConfig.java:43)
自动生成的MANIFEST.MF的内容如下:
Manifest-Version: 1.0
Class-Path: .
Main-Class: main.MainConfig
Name: common
Implementation-Vendor: Oracle
Implementation-Title: MySQL Connector/J
Implementation-Version: 5.1.20
Implementation-Vendor-Id: com.mysql
Specification-Vendor: Sun Microsystems Inc.
Specification-Title: JDBC
Specification-Version: 4.0