我有这个用于tomcat.jmx的jvmarg,选项跨越多行,并且我想打破这些选项,每行一个。但蚂蚁不能接受这一点。人们如何用长值参数来编写这个xml。
<property name="tomcat.jvmarg.jmx" value="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=${tomcat.jmxport}
-Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.rmi.port=${tomcat.jmxport} -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.local.only=true -Dcom.sun.management.jmxremote.ssl.need.client.auth=true -Dcom.sun.management.jmxremote.ssl.enabled.protocols=TLSv1 -Djavax.net.ssl.keyStore=${tomcat.jmxkeystore} -Djavax.net.ssl.keyStorePassword=${tomcat.jmxpass}"/>我试了一下,启动tomcat失败了,因为参数中的换行符是一个障碍。
无效
<property name="tomcat.jvmarg.jmx"
value="-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=${tomcat.jmxport}
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.rmi.port=${tomcat.jmxport}
-Djava.rmi.server.hostname=localhost"
/>发布于 2016-05-26 15:03:53
tomcat.jvmarg.jmx是否被赋予<java>任务?如果是这样,请考虑在<jvmarg>下嵌套<java>元素..。
<java ...>
<jvmarg value="-Dcom.sun.management.jmxremote"/>
<jvmarg value="-Dcom.sun.management.jmxremote.port=${tomcat.jmxport}"/>
<jvmarg value="-Dcom.sun.management.jmxremote.authenticate=false"/>
<jvmarg value="-Dcom.sun.management.jmxremote.ssl=false"/>
<jvmarg value="-Dcom.sun.management.jmxremote.rmi.port=${tomcat.jmxport}"/>
<jvmarg value="-Djava.rmi.server.hostname=localhost"/>
<jvmarg value="-Dcom.sun.management.jmxremote.local.only=true"/>
<jvmarg value="-Dcom.sun.management.jmxremote.ssl.need.client.auth=true"/>
<jvmarg value="-Dcom.sun.management.jmxremote.ssl.enabled.protocols=TLSv1"/>
<jvmarg value="-Djavax.net.ssl.keyStore=${tomcat.jmxkeystore}"/>
<jvmarg value="-Djavax.net.ssl.keyStorePassword=${tomcat.jmxpass}"/>
</java>这提供了一种在避免换行符问题的同时轻松查看所有参数的方法。
https://stackoverflow.com/questions/37446924
复制相似问题