java.nio.file.FileSystemNotFoundException: Provider 'wsjar' not installed

I am getting this exception report due to a file path not being found correctly.

Caused by: java.nio.file.FileSystemNotFoundException: Provider "wsjar" not installed at java.nio.file.Paths.get(Paths.java:158) 

I am running Websphere v8.5.5.0.

I am calling the Path Like this:

Class<?> clazz = ... URI uri = clazz.getResource("/project.properties").toURI(); Path propertyFilePath = Paths.get(uri); //error here. 

Can someone please explain what the wsjar file name means? and what i can do to get around this error?

P.S. i will get the actual uri.toString here once i run it with a System.out.println statement.

UPDATE: the actual URI string is as follows:

wsjar:file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer_1/profiles/AppSrv01/installedApps/AUSSYDCVTLJ007Node02Cell/ 

1 Answer

wsjar is the websphere specific URL protocol for an entry in a jar file.

And one solution that can be done from your code can be to reconstruct the URL like something below:

 if (uri.getProtocol().startsWith("wsjar")) URL updatedURL = new URL("jar", uri.getHost(), uri.getPort(), uri.getPath()); 

Similar issue discussed here.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like