Вопрос

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?

Это было полезно?

Решение

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.

Другие советы

"\n" is a real newline.

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top