Stephen Kouretas [
https://community.jboss.org/people/skoure] created the discussion
"Re: URL-Protocol Handler doesn't work"
To view the discussion, visit:
https://community.jboss.org/message/729373#729373
--------------------------------------------------------------
David,
If I understand you correctly jboss.protocol.handler.modules requires a
URLStreamHandlerFactory.
The jcifs package does not include a URLStreamHandlerFactory since
java.protocol.handler.pkgs only requires a URLStreamHandler.
Hence, I created a seperate jar with a URLStreamHandlerFactory and placed it in the
modules/jcifs/main directory. (see code below)
In the META-INF/services directory of this jar contains a text file named
java.net.URLStreamHandlerFactory which contains the fully-qualified name of this factory.
In the module.xml file I added this new jar as a resource-root and removed the
service-loader-resources directory from the resources list.
the org.jboss.as.standalone module still has a dependency on the jcifs module.
I am still getting the same MalformedURLException unknown protocol: smb.
I put a break point on the createURLStreamHandler method, but it never seems to be
called.
public class SmbStreamHandlerFactory implements URLStreamHandlerFactory {
@Override
public URLStreamHandler createURLStreamHandler(String protocol) {
if((protocol != null) && ("smb".equals(protocol.toLowerCase()))) {
return new jcifs.smb.Handler();
}
return null;
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/729373#729373]
Start a new discussion in JBoss AS 7 Development at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]