[jcifs] Exception when using Cataline/Tomcat with the jCIFS s ervlet.

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Wed Nov 20 12:51:21 EST 2002


> -----Original Message-----
> From:	Siamak Nazari [SMTP:siamaknazari at yahoo.com]
> Sent:	Tuesday, November 19, 2002 8:45 PM
> To:	Allen, Michael B (RSCH)
> Subject:	RE: [jcifs] Exception when using Cataline/Tomcat with the jCIFS s ervlet.
> 
> 
> --- "Allen, Michael B (RSCH)" <Michael_B_Allen at ml.com>
> wrote:
> > No. It's something else then. Are you restating
> > Tomcat? Were do you put the jar?
> > I heard a report that Resin required it be in the
> > container path (top level lib) and then
> > restart the server. Maybe Tomcat has a similar
> > problem.
> > 
> > It has to be finding the jar or you'd get
> > ClassNotFound exceptions instead.
> > 
> 
> It is definitely finding the jar, otherwise 
> as you said it would not be able to see
> jcifs.smb.SmbFile
> in the stack trace. It appears as if the "smb:"
> URL did not get registered so that
> java.net.URL.(URL.java:586)
> is unable to grok smb:// style URL's.
> I don't know how java.net.URL is supposed to figure
> out the parsing rules for smb: anyhow, given
> that is was not compiled with that knowledge
> so my guess is that this has to be somehow
> "registered" but I don't know how.
> 
	It reads a System property on startup which we modify in a static block in jcifs.Config:

	    static {
	        Properties sys = System.getProperties();
	        synchronized( sys ) { 
	            if( sys.getProperty( "java.version" ).startsWith( "1.1." )) {
	                System.err.println( "jCIFS requires Java 1.2 or above. You are running " +
	                            sys.getProperty( "java.version" ));
	            }
	            String pkgs = sys.getProperty( "java.protocol.handler.pkgs" );
	            if( pkgs == null ) {
	                pkgs = "jcifs";
	            } else {
	                pkgs += "|jcifs";
	            }
	            sys.put( "java.protocol.handler.pkgs", pkgs ); 
	        }

	Then in SmbFile we make sure this is executed before accessing java.net.URL with:

	Class.forName( "jcifs.Config" )

	Just as an experiment, can you try to put this above line somewhere and run it *before*
	trying to use jcifs classes and see if that makes a difference?

> I have stopped and restarted both Apache
> and Tomcat servers, but that does not seem
> to help. The file jcifs_0.7.0b8.jar was copied
> to the tomcat shared/lib directory
> which should expose it.
> 
> 
> 
> 
> 
> > > -----Original Message-----
> > > From:	Siamak Nazari [SMTP:siamaknazari at yahoo.com]
> > > Sent:	Tuesday, November 19, 2002 8:20 PM
> > > To:	jcifs at lists.samba.org
> > > Subject:	RE: [jcifs] Exception when using
> > Cataline/Tomcat with the jCIFS s ervlet.
> > > 
> > > I am using 
> > > 
> > > java version "1.4.1"
> > > Java(TM) 2 Runtime Environment, Standard Edition
> > > (build 1.4.1-b21)
> > > Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed
> > > mode)
> > > 
> > > Does this mean I need to downgrade?
> > > 
> > > Siamak
> > > 
> > > --- "Allen, Michael B (RSCH)"
> > <Michael_B_Allen at ml.com>
> > > wrote:
> > > > You need Java 1.3.
> > > > 
> > > > > -----Original Message-----
> > > > > From:	Siamak Nazari
> > [SMTP:siamaknazari at yahoo.com]
> > > > > Sent:	Tuesday, November 19, 2002 5:53 PM
> > > > > To:	jcifs at lists.samba.org
> > > > > Subject:	[jcifs] Exception when using
> > > > Cataline/Tomcat with the jCIFS servlet.
> > > > > 
> > > > > I have set up the various setting of Apache
> > and
> > > > > Tomcat to run the Servlet that is  embeded in
> > > > > jcifs jar (this is jcifs_0.7.0b8) The jar
> > > > > file can be used on command line to browse
> > > > > the shares, but when used using the
> > Apache/Tomcat
> > > > > I get the following error.
> > > > > 
> > > > > Any ideas what step was not done correctly,
> > and
> > > > > how to fix it?
> > > > > 
> > > > > -----------------------------------------
> > > > > HTTP Status 500 - Internal Server Error
> > > > > 
> > > > > type Exception report
> > > > > 
> > > > > message Internal Server Error
> > > > > 
> > > > > description The server encountered an internal
> > > > error
> > > > > (Internal Server Error) that prevented it from
> > > > > fulfilling this request.
> > > > > 
> > > > > exception
> > > > > 
> > > > > java.net.MalformedURLException: unknown
> > protocol:
> > > > smb
> > > > > 	at java.net.URL.(URL.java:586)
> > > > > 	at java.net.URL.(URL.java:476)
> > > > > 	at java.net.URL.(URL.java:425)
> > > > > 	at jcifs.smb.SmbFile.(SmbFile.java:355)
> > > > > 	at
> > > > >
> > > >
> > >
> >
> jcifs.http.NetworkExplorer.doGet(NetworkExplorer.java:423)
> > > > > 
> > > > > 
> > > > >
> > __________________________________________________
> > > > > Do you Yahoo!?
> > > > > Yahoo! Web Hosting - Let the expert host your
> > site
> > > > > http://webhosting.yahoo.com
> > > > 
> > > 
> > > 
> > > __________________________________________________
> > > Do you Yahoo!?
> > > Yahoo! Web Hosting - Let the expert host your site
> > > http://webhosting.yahoo.com
> > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - Let the expert host your site
> http://webhosting.yahoo.com




More information about the jcifs mailing list