[jcifs] Java 1.3 Required and Unknown Protocol SMB Exceptions with Certai n Servlet Containers

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Wed Dec 11 14:28:41 EST 2002


> I'm clearly not the Java expert I'd have to be to argue the point, but it 
> seems to me that there are a lot of reasons *not* to use the java.net.URL 
> class.  That requirement is breaking stuff.
> 
	There are two orthogonal problems here.

	1) The Java 1.3 requirement. Sucks but tough. If we back off the Java 1.3
	requirement to release us from the java.net.URL.set() requirement there will
	be no java.net.URL support *at all*. That means no class loader support and
	you quite simply cannot use SMB URLs with java.net.URL *at all*. If you
	don't remember why, read this:

	  http://developer.java.sun.com/developer/onlineTraining/protocolhandlers/

	and think about how you can maintain external state in a java.net.URL object
	(ans: you can't). If you're using an old release of Java (1.2 or below), use the
	old release of jCIFS (0.6.x).

	2) Some Servlet and J2EE containers are not compatible with *any* version of
	jCIFS because the URL protocol handler design and Container specifications
	both supplied by Sun et. al. fails to consider that a protocol handler
	implementation will need to set a system property (java.protocol.handler.pkgs)
	when the security policies of some containers forbid this (Tomcat appears to
	be one).

	Eric has described the situation best:

	"System.getProperty() only requires read access, so should be successful 
	under the default J2EE security policy.  The setProperty call above
	[in the code changes made to jcifs.Config in jcifs-0.7.0b10] will 
	fail, however; if you need to use SMB URLs (if you're just using 
	Ntlm[Http]Filter for simple NTLM HTTP authentication you probably don't) then 
	you would have to manually set the "java.protocol.handler.pkgs" property 
	yourself (probably by passing "-Djava.protocol.handler.pkgs=jcifs" to 
	the command line used to start the JVM or using whatever means your 
	application server provides to configure the environment properties).

	I don't know if this work and I'm not about to download every container and try.
	I know Resin works. This stuff will work itself out in time and we'll see soon
	enough if the 0.7.0b10 release which includes Erics suggested changes helps
	jcifs.http.NtlmHttpFilter users by simply suppressing that SecurityException.






More information about the jcifs mailing list