[jcifs] java.net.MalformedURLException: unknown protocol: smb

Michael B. Allen miallen at eskimo.com
Fri Oct 25 05:02:22 EST 2002


On Thu, 24 Oct 2002 11:39:54 +0200
Mats.Svensson at astrazeneca.com wrote:

> Hi!
> 
> I try to use the NetworkExplorer servlet on: 
> jcifs 0705b
> resin 215
> jdk 141_01
> w2k sp3
> 
> but I keep getting the exception included below.
> 
> 1) I can't find any documentation (other than the source) on 

See the overview page of the API documentation.

> how the URL (PathInfo) is supposed to be used, I guess it is 
> http://servletContainerHost/NetworkExplorer/someHostIwantToExplore/Share
> 
> 
> java.net.MalformedURLException: unknown protocol: smb
> 	at java.net.URL.<init>(URL.java:586)
> 	at java.net.URL.<init>(URL.java:476)
> 	at java.net.URL.<init>(URL.java:425)

Odd. This almost sounds like the protocol handler isn't being
initialized. But I don't see how that can be. The prococol handler is
initialize in a static block in jcifs.Config. And NetworkExplorer.init
and SmbFile use jcifs.Config. Unless ... jcifs.util.Config is creating
ambiguity.

Can you put

  Class.forName( "jcifs.Config" );

at the beginning of NetworkExplorer.init()? To rebuild the jar you will
need to append 'http' to smb target on line 41 of build.xml and do an
'ant jar' (assuming you have ant).

> 	at jcifs.smb.SmbFile.<init>(SmbFile.java:401)
> 	at jcifs.http.NetworkExplorer.doGet(NetworkExplorer.java:421)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:126)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
> 	at
> com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:9
> 6)
> 	at com.caucho.server.http.Invocation.service(Invocation.java:312)
> 	at
> com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
> 	at
> com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:221)
> 	at
> com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:163)
> 	at com.caucho.server.TcpConnection.run(TcpConnection.java:137)
> 	at java.lang.Thread.run(Thread.java:536)

How do I install these web.xml files? Where do they go? I've been editing
conf/resin.conf!

> 
> web.xml:
> <web-app>
>   <classpath id='WEB-INF/lib/jcifs-0.7.0b5.jar'/>
>     <servlet>
>         <servlet-name>NetworkExplorer</servlet-name>
>         <servlet-class>jcifs.http.NetworkExplorer</servlet-class>
>         <init-param>
>             <param-name>jcifs.smb.client.domain</param-name>
>             <param-value>ADOMAIN</param-value>
>         </init-param>
>         <init-param>
>             <param-name>jcifs.netbios.wins</param-name>
>             <param-value>192.168.1.32</param-value>
>         </init-param>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>NetworkExplorer</servlet-name>
>         <url-pattern>/NetworkExplorer/*</url-pattern>
>     </servlet-mapping>
> </web-app>


-- 
A  program should be written to model the concepts of the task it
performs rather than the physical world or a process because this
maximizes  the  potential  for it to be applied to tasks that are
conceptually  similar and, more important, to tasks that have not
yet been conceived. 



More information about the jcifs mailing list