[jcifs] NoClassDefFoundError Exception

Michael B Allen mba2000 at ioplex.com
Mon Oct 20 07:36:48 EST 2003


> Hello Michael,
>
> Unfortunately, it is not a classpath problem.  I am using jcifs within
> a s1as7 web container which implements a java SecurityManager.  The code
> at line 304 of SmbFile, which is 'Class.forName( "jcifs.Config" );' is
> throwing the NoClassDefFoundError when the SecurityManager is enabled.
> Perhaps you can tell me what java permissions the jcifs package needs.
> I have temporarily solved the problem by disabling the SecurityManager.
> Any help in identifying the needed permissions would be helpful.

Actually I don't think this is a SecurityManager problem as much as it is
a ClassLoader problem. Because jCIFS needs to install the
jcifs.smb.Handler URL Protocol Handler, the jCIFS classes must be loaded
by the system ClassLoader. I don't recall the specific permissions
necessary to install the Handler from a custom ClassLoader but it was
discussed at length on the mailing list at one time (unfortunately the
lists.samba.org archives appear to have been "simplified" to the point of
being largely useless). This might be related to your problem. The
SecurityManager could require a special ClassLoader scheme be used
although it is odd that your application can load jcifs.smb.SmbFile and
not jcifs.Config. I would think it would get farther than that. Try
putting the jcifs-x.x.x.jar in the container classpath (e.g. with Resin
this is a matter of putting the jar in the top-level lib directory).

Mike

-- 
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