hj_maven多模块项目war,jar运行踩坑

一个项目,分成多个maven模块,jar,war包的相互调用依赖,需注意不要形成一个死循环,

Tomcat拉入war包运行,一个启动器只能放一个war包,注意切换,idea可以多配置几个启动器.

可能存在缓存问题,需要mvn clean 然后 mvn package 重新编译打包下,可能就解决了很多莫名的错误.

代码逻辑调用,依赖关系一定要理清,不要相互,循环调用.

"C:\Program Files\Java\jdk1.8.0_231\bin\java.exe" "-javaagent:D:\softInstall\backendDev\IntelliJ IDEA 2019.1\lib\idea_rt.jar=51664:D:\softInstall\backendDev\IntelliJ IDEA 2019.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_231\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_231\jre\lib\rt.jar;D:\softWorkSpace\zhiyuan\ideaSpace\haoyuanrental\erp-core-api\target\classes;D:\softInstall\backendDev\maven\maven-repository\org\springframework\spring-webmvc\4.3.2.RELEASE\spring-webmvc-4.3.2.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\spring-beans\4.3.2.RELEASE\spring-beans-4.3.2.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\spring-context\4.3.2.RELEASE\spring-context-4.3.2.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\spring-core\4.3.2.RELEASE\spring-core-4.3.2.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\spring-expression\4.3.2.RELEASE\spring-expression-4.3.2.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\spring-context-support\4.3.2.RELEASE\spring-context-support-4.3.2.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\spring-jdbc\4.3.2.RELEASE\spring-jdbc-4.3.2.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\spring-tx\4.3.2.RELEASE\spring-tx-4.3.2.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\spring-web\4.3.2.RELEASE\spring-web-4.3.2.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\spring-orm\4.3.2.RELEASE\spring-orm-4.3.2.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\spring-aop\4.3.2.RELEASE\spring-aop-4.3.2.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\spring-websocket\4.3.2.RELEASE\spring-websocket-4.3.2.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\spring-messaging\4.3.2.RELEASE\spring-messaging-4.3.2.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\data\spring-data-redis\1.6.1.RELEASE\spring-data-redis-1.6.1.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\slf4j\slf4j-api\1.7.12\slf4j-api-1.7.12.jar;D:\softInstall\backendDev\maven\maven-repository\redis\clients\jedis\2.7.3\jedis-2.7.3.jar;D:\softInstall\backendDev\maven\maven-repository\net\sf\json-lib\json-lib\2.4\json-lib-2.4-jdk15.jar;D:\softInstall\backendDev\maven\maven-repository\commons-beanutils\commons-beanutils\1.8.0\commons-beanutils-1.8.0.jar;D:\softInstall\backendDev\maven\maven-repository\commons-lang\commons-lang\2.5\commons-lang-2.5.jar;D:\softInstall\backendDev\maven\maven-repository\net\sf\ezmorph\ezmorph\1.0.6\ezmorph-1.0.6.jar;D:\softInstall\backendDev\maven\maven-repository\com\alibaba\fastjson\1.2.14\fastjson-1.2.14.jar;D:\softInstall\backendDev\maven\maven-repository\com\google\code\gson\gson\2.7\gson-2.7.jar;D:\softInstall\backendDev\maven\maven-repository\com\fasterxml\jackson\core\jackson-annotations\2.3.0\jackson-annotations-2.3.0.jar;D:\softInstall\backendDev\maven\maven-repository\com\fasterxml\jackson\core\jackson-core\2.3.1\jackson-core-2.3.1.jar;D:\softInstall\backendDev\maven\maven-repository\com\fasterxml\jackson\core\jackson-databind\2.3.3\jackson-databind-2.3.3.jar;D:\softInstall\backendDev\maven\maven-repository\javax\servlet\jstl\1.2\jstl-1.2.jar;D:\softInstall\backendDev\maven\maven-repository\org\apache\commons\commons-lang3\3.4\commons-lang3-3.4.jar;D:\softInstall\backendDev\maven\maven-repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;D:\softInstall\backendDev\maven\maven-repository\commons-dbcp\commons-dbcp\1.4\commons-dbcp-1.4.jar;D:\softInstall\backendDev\maven\maven-repository\commons-pool\commons-pool\1.4\commons-pool-1.4.jar;D:\softInstall\backendDev\maven\maven-repository\commons-codec\commons-codec\1.4\commons-codec-1.4.jar;D:\softInstall\backendDev\maven\maven-repository\commons-digester\commons-digester\2.1\commons-digester-2.1.jar;D:\softInstall\backendDev\maven\maven-repository\commons-io\commons-io\2.4\commons-io-2.4.jar;D:\softInstall\backendDev\maven\maven-repository\com\sun\mail\javax.mail\1.5.2\javax.mail-1.5.2.jar;D:\softInstall\backendDev\maven\maven-repository\javax\activation\activation\1.1\activation-1.1.jar;D:\softInstall\backendDev\maven\maven-repository\com\google\guava\guava\19.0\guava-19.0.jar;D:\softInstall\backendDev\maven\maven-repository\com\thoughtworks\xstream\xstream\1.4.2\xstream-1.4.2.jar;D:\softInstall\backendDev\maven\maven-repository\xmlpull\xmlpull\1.1.3.1\xmlpull-1.1.3.1.jar;D:\softInstall\backendDev\maven\maven-repository\xpp3\xpp3_min\1.1.4c\xpp3_min-1.1.4c.jar;D:\softInstall\backendDev\maven\maven-repository\org\jdom\jdom2\2.0.5\jdom2-2.0.5.jar;D:\softInstall\backendDev\maven\maven-repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;D:\softInstall\backendDev\maven\maven-repository\commons-httpclient\commons-httpclient\3.0.1\commons-httpclient-3.0.1.jar;D:\softInstall\backendDev\maven\maven-repository\org\aspectj\aspectjweaver\1.7.4\aspectjweaver-1.7.4.jar;D:\softInstall\backendDev\maven\maven-repository\org\apache\commons\commons-pool2\2.3\commons-pool2-2.3.jar;D:\softInstall\backendDev\maven\maven-repository\org\apache\httpcomponents\httpclient\4.5.2\httpclient-4.5.2.jar;D:\softInstall\backendDev\maven\maven-repository\org\apache\httpcomponents\httpcore\4.4.4\httpcore-4.4.4.jar;D:\softInstall\backendDev\maven\maven-repository\org\apache\mina\mina-core\2.0.9\mina-core-2.0.9.jar;D:\softInstall\backendDev\maven\maven-repository\commons-fileupload\commons-fileupload\1.2.2\commons-fileupload-1.2.2.jar;D:\softInstall\backendDev\maven\maven-repository\ch\qos\logback\logback-classic\1.1.3\logback-classic-1.1.3.jar;D:\softInstall\backendDev\maven\maven-repository\ch\qos\logback\logback-core\1.1.3\logback-core-1.1.3.jar;D:\softInstall\backendDev\maven\maven-repository\org\logback-extensions\logback-ext-spring\0.1.2\logback-ext-spring-0.1.2.jar;D:\softInstall\backendDev\maven\maven-repository\org\slf4j\jcl-over-slf4j\1.7.12\jcl-over-slf4j-1.7.12.jar;D:\softInstall\backendDev\maven\maven-repository\org\mybatis\mybatis\3.4.0\mybatis-3.4.0.jar;D:\softInstall\backendDev\maven\maven-repository\org\mybatis\mybatis-spring\1.3.0\mybatis-spring-1.3.0.jar;D:\softInstall\backendDev\maven\maven-repository\com\github\pagehelper\pagehelper\4.0.0\pagehelper-4.0.0.jar;D:\softInstall\backendDev\maven\maven-repository\com\github\jsqlparser\jsqlparser\0.9.1\jsqlparser-0.9.1.jar;D:\softInstall\backendDev\maven\maven-repository\com\belerweb\pinyin4j\2.5.0\pinyin4j-2.5.0.jar;D:\softInstall\backendDev\maven\maven-repository\junit\junit\4.12\junit-4.12.jar;D:\softInstall\backendDev\maven\maven-repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;D:\softInstall\backendDev\maven\maven-repository\org\jdom\jdom\1.1\jdom-1.1.jar;D:\softInstall\backendDev\maven\maven-repository\org\postgresql\postgresql\9.4.1211\postgresql-9.4.1211.jar;D:\softInstall\backendDev\maven\maven-repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar;D:\softInstall\backendDev\maven\maven-repository\xml-apis\xml-apis\1.0.b2\xml-apis-1.0.b2.jar;D:\softInstall\backendDev\maven\maven-repository\com\rabbitmq\amqp-client\3.6.5\amqp-client-3.6.5.jar;D:\softInstall\backendDev\maven\maven-repository\com\zaxxer\HikariCP\2.5.1\HikariCP-2.5.1.jar;D:\softInstall\backendDev\maven\maven-repository\org\apache\shiro\shiro-core\1.3.2\shiro-core-1.3.2.jar;D:\softInstall\backendDev\maven\maven-repository\org\apache\shiro\shiro-web\1.3.2\shiro-web-1.3.2.jar;D:\softInstall\backendDev\maven\maven-repository\org\apache\shiro\shiro-spring\1.3.2\shiro-spring-1.3.2.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\data\spring-data-mongodb\1.8.2.RELEASE\spring-data-mongodb-1.8.2.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\springframework\data\spring-data-commons\1.10.0.RELEASE\spring-data-commons-1.10.0.RELEASE.jar;D:\softInstall\backendDev\maven\maven-repository\org\mongodb\mongo-java-driver\2.14.3\mongo-java-driver-2.14.3.jar;D:\softInstall\backendDev\maven\maven-repository\com\cheruyun\platform\cheruyun-platform\1.0.2\cheruyun-platform-1.0.2.jar;D:\softInstall\backendDev\maven\maven-repository\com\cheruyun\license\cheruyun-license\1.0.1\cheruyun-license-1.0.1.jar;D:\softInstall\backendDev\maven\maven-repository\com\cheruyun\common\2.0.4\common-2.0.4.jar;D:\softInstall\backendDev\maven\maven-repository\cn\jpush\api\jpush-client\3.2.9\jpush-client-3.2.9.jar" com.haoyuanzhihai.core.util.ApiUtils
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 7 more
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main"
Process finished with exit code 1

上一篇:java部分工具库使用


下一篇:springcloud实体类抽离