How to get newlines in classpath for JMSProvider using wsadmin

自古美人都是妖i 提交于 2019-12-11 07:22:58

问题


I want to create a JMSProvider object with a custom classpath. Here's how I'm doing it in jython:

... classpath = "a.jar:b.jar:c.jar".replace(":", "\n") properties = [ ['name', name], ['description', description], ['classpath', classpath], ['externalInitialContextFactory', externalInitialContextFactory], ['externalProviderURL', externalProviderURL], ['nativepath',[]], ['supportsASF','true'] ] AdminConfig.create('JMSProvider', node, properties) AdminConfig.save()

The JMSProvider is created, but the classpath variable has the newlines escaped:

a.jar\nb.jar\nc.jar

How can I tell wsadmin to not escape the newlines?


回答1:


Whilst the WAS admin console (the web page) requires you to enter the classpath with newlines, the wsadmin tool requires that it be separated by the host O/S file separator. So there is no need to modify the input string at all.

classpath = "a.jar;b.jar;c.jar"

Will work just fine.




回答2:


"\n" is a real newline.

Compare repr(classpath) immediately after classpath.replace() with the repr(classpath) that JMSProvider sees they should be the same.



来源:https://stackoverflow.com/questions/8516038/how-to-get-newlines-in-classpath-for-jmsprovider-using-wsadmin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!