pradhnyaDev opened a new issue, #1850:
URL: https://github.com/apache/activemq/issues/1850
After upgrading to Apache ActiveMQ Client 6.2.2, I am encountering a
resource resolution issue resulting in the following exception:
`java.io.IOException: Could not find factory class for resource:
META-INF\services\org\apache\activemq\transport\tcp`
The issue appears to stem from OS-dependent behavior in Path handling,
specifically originating from Path.of(...).
**Observed Behavior**
The problem seems related to path resolution logic in
**FactoryFinder.resolvePath(final String key)** :
```
private String resolvePath(final String key) throws
InstantiationException {
// Normalize the base path with the given key. This
// will resolve/remove any relative ".." sections of the path.
// Example: "/dir1/dir2/dir3/../file" becomes "/dir1/dir2/file"
final Path resolvedPath = Path.of(path).resolve(key).normalize();
// Validate the resolved path is still within the original defined
// root path and throw an error of it is not.
if (!resolvedPath.startsWith(path)) {
throw new InstantiationException("Provided key escapes the
FactoryFinder configured directory");
}
return resolvedPath.toString();
}
```
**_Key Findings_**
- On Windows, the resolved path contains backslashes ( \ )
- On macOS, the resolved path contains forward slashes ( / )
- This OS-specific formatting affects downstream resource resolution (e.g.,
META-INF/services/...)
- As a result, the same application behaves differently depending on the
operating system
**Environment**
ActiveMQ Client: 6.2.2
Java: 21
OS: Windows
Any guidance would be appreciated.
Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact