文本浏览器

IDEA更新后tomcat无法启动: catalina.sh: eval: line 369: syntax error near unexpected token `('

发布者 : 管理员-Adler | 发布时间 : 2019-02-02 13:47:23
文章号 : 44 | 阅读量 : 94+1 | AAW值(?) : 0.01 (仅供参考)

报错如下

/Users/adler/Downloads/apache-tomcat-7.0.92/bin/catalina.sh run
[2019-02-02 01:37:15,916] Artifact SSMWork:war exploded: Waiting for server connection to start artifact deployment...
/Users/adler/Downloads/apache-tomcat-7.0.92/bin/catalina.sh: eval: line 369: syntax error near unexpected token `('
/Users/adler/Downloads/apache-tomcat-7.0.92/bin/catalina.sh: eval: line 369: `exec "/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java" "-Djava.util.logging.config.file=/Users/adler/Library/Caches/IntelliJIdea2018.3/tomcat/Unnamed_(1)_TestSSM/conf/logging.properties" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Drebel.base=/Users/adler/.jrebel -Drebel.env.ide.plugin.version=2018.2.5 -Drebel.env.ide.version=2018.3.4 -Drebel.env.ide.product=IU -Drebel.env.ide=intellij -agentpath:/var/folders/6t/7ncp9jn162v7ly6jdlbsw3vm0000gn/T/jrebel-JRebel-201901241354-griffin/lib/libjrebel64.dylib -Dfile.encoding=UTF-8 -Dcom.sun.management.jmxremote= -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=/Users/adler/Library/Caches/IntelliJIdea2018.3/tomcat/Unnamed_(1)_TestSSM/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/Users/adler/Library/Caches/IntelliJIdea2018.3/tomcat/Unnamed_(1)_TestSSM/jmxremote.access -Djava.rmi.server.hostname=127.0.0.1 -Djdk.tls.ephemeralDHKeySize=2048 -Dignore.endorsed.dirs="" -classpath "/Users/adler/Downloads/apache-tomcat-7.0.92/bin/bootstrap.jar:/Users/adler/Downloads/apache-tomcat-7.0.92/bin/tomcat-juli.jar" -Dcatalina.base="/Users/adler/Library/Caches/IntelliJIdea2018.3/tomcat/Unnamed_(1)_TestSSM" -Dcatalina.home="/Users/adler/Downloads/apache-tomcat-7.0.92" -Djava.io.tmpdir="/Users/adler/Downloads/apache-tomcat-7.0.92/temp" org.apache.catalina.startup.Bootstrap start'

理清思路

  1. IDEA提示的是syntax error near unexprected token `(' (即无法识别的括号)
  2. 翻阅catalina.sh, 发现369行为: eval exec "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \
  3. 看上方报错时IDEA生成的文件名: Unnamed_(1)_TestSSM 中就含有未被转义的括号, 所以无法识别

解决方案

那么问题就是由于IDEA生成包的时候自动生成的文件名问题, 由于我新建了多个Tomcat服务端, 所以IDEA自动命名为(2) (3)......
所以应该删除或改名已经新建的Tomcat服务端
然后再新建一个新的Tomcat服务端, 只要不重名IDEA就不会加括号了. 问题解决






评论加载中...

+ 参与讨论