[
https://issues.apache.org/jira/browse/DAEMON-453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17685451#comment-17685451
]
Thomas De Waelheyns commented on DAEMON-453:
--------------------------------------------
I have a working POC for windows. It needs to be cleaned up before testing it
extensively but it does the following:
* It looks for paths in the Classpath ending in * and tries to expand to
actual libraries
* It supports individual paths ending on quotes
** ServiceTest.jar;logback.xml;"lib with space\*"
* It supports the whole classpath being encapsulated in quotes
** "ServiceTest.jar;logback.xml;lib with space\*"
* For relative paths it uses the StartPath variable as a base to resolve
against
With these I made working services in java mode with wild cards in the
classpath.
For unix I still have to check. I use mainly windows so I have to check how
much of the logic of my windows solution can be used there with the code
[[email protected]] wrote for the jvm mode.
> Add support for wildcard classpath in java mode
> -----------------------------------------------
>
> Key: DAEMON-453
> URL: https://issues.apache.org/jira/browse/DAEMON-453
> Project: Commons Daemon
> Issue Type: Improvement
> Components: Procrun
> Affects Versions: 1.3.3
> Reporter: Thomas De Waelheyns
> Priority: Minor
> Attachments: image-2023-02-03-21-30-22-322.png
>
>
> Classpaths with wildcards are currently supported only in jvm mode of the
> launcher according to this [mail
> list|https://lists.apache.org/thread/xz3v6p6xcw8hcp0rm1yt9gd7xg9oryvf]. The
> jvm mode support was implemented in DAEMON-166.
> Since the code to expand the wildcard to actual references to jar files was
> already written, wouldn't it make sense to expand this to also include java
> mode?
>
> Relevant commits:
> Windows:
> [https://github.com/apache/commons-daemon/commit/6c0758fc052188dead563e4ce776a5da6e34acb9]
> Unix:
> [https://github.com/apache/commons-daemon/commit/5997b1355ecc2fe0bcf3608e33195e5c2968931e]
>
> For windows, in javajni.c, line 915-920 looks like a good place to call the
> __apxEvalClasspath which expands any wildcard paths into a complete list.
> {noformat}
> if (szClassPath) {
> p = (LPWSTR)apxPoolAlloc(hPool, (lstrlenW(JAVA_CLASSPATH_W) +
> lstrlenW(szClassPath)) * sizeof(WCHAR));
> lstrcpyW(p, JAVA_CLASSPATH_W);
> lstrcatW(p, szClassPath);
> (*lppArray)[i++] = p;
> }{noformat}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)