[jcifs] JCIFS with Windows Vista / IE 7

Michael B Allen ioplex at gmail.com
Tue Jan 6 22:46:15 GMT 2009


On Tue, Jan 6, 2009 at 5:34 PM, shibaram <dunumania at yahoo.co.in> wrote:
>
> Thanks Mike, Chuck and John.
>
> @ John,
> No, its not like that.
> using the 1.3.1 jar file and  directly setting the properties in the web.xml
> under <filter> under <init-param>   I am able to run everything fine even in
> eclipse development phase.
> This is only breaking when I try to read the properties from an external
> property file.
>
> @ Mike:
> I am setting the property as said by Mike like below:
>
> -Djcifs.properties=<System Full Path>\jcifs.properties
> e.g. (in my case) :
> -Djcifs.properties=C:\Workspace_Eclipse33_SBC\JCIFS\WebContent\WEB-INF\opt\jcifs.properties
> in the server (Tomcat here) as command line setting.
>
> And now in Development phase in Eclipse IDE , when I access the property in
> my custom Ntlmfilter
> like below:
>
> public class NtlmCustomisedHttpFilter extends NtlmHttpFilter {
>
>     public void init( FilterConfig filterConfig ) throws ServletException {
>
>         String justGet = System.getProperty("jcifs.properties");
>
>         String propFile =
> filterConfig.getInitParameter("jcifs.properties");
>  //        Config.setProperty("jcifs.properties", propFile);
>
>
> System.out.println("-----------========================----------------------");
>         System.out.println("justGet = "+justGet);
>         System.err.println("Path of property file = "+propFile);
>         System.err.println(Config.getProperty("jcifs.netbios.wins", null));
>         System.err.println(Config.getProperty("jcifs.smb.client.domain",
> null));
>
> System.out.println("-----------========================----------------------");
>         super.init(filterConfig);
>     }
> }
>
> I am getting below outputs from above in the eclipse consol :
>
> INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
> -----------========================----------------------
> justGet = null
> Path of property file =
> C:\Workspace_Eclipse33_SBC\JCIFS\WebContent\WEB-INF\opt\jcifs.properties
> null
> null
> -----------========================----------------------
> Jan 6, 2009 5:28:14 PM org.apache.coyote.http11.Http11AprProtocol start
> INFO: Starting Coyote HTTP/1.1 on http-8080
> Jan 6, 2009 5:28:14 PM org.apache.coyote.ajp.AjpAprProtocol start
> INFO: Starting Coyote AJP/1.3 on ajp-8009
> Jan 6, 2009 5:28:14 PM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 397 ms
> Jan 6, 2009 5:28:15 PM org.apache.catalina.core.StandardWrapperValve invoke
> SEVERE: Servlet.service() for servlet default threw exception
> jcifs.smb.SmbException: A domain was not specified
>        at jcifs.smb.SmbSession.getChallengeForDomain(SmbSession.java:90)
>        at jcifs.http.NtlmHttpFilter.negotiate(NtlmHttpFilter.java:157)
>        at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:121)
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
>
> As you can see when I launch the tomcat within the eclipse ide and test the
> application.
> still I get a Null   for  System.getProperty("jcifs.properties").
>
> BUT, if I deploy the application as a war file and launching the Tomcat out
> side eclipse and access the application, it executes fine without error.
> Means in this case System.getProperty("jcifs.properties")   manages to read
> from the
> -Djcifs.properties=C:\Workspace_Eclipse33_SBC\JCIFS\WebContent\WEB-INF\opt\jcifs.properties
> from the command line proerty set in the tomcat server.
>
> But in the former case (Launching the application Run/ Debug mode in Eclipse
> with Tomcat), System.getProperty("jcifs.properties") does not read the
> settings by default.
>
> I looked up some help in Eclipse itself, and found that (probably) we need
> to pass the system settings in the "eclipse.ini" file as
> -Djcifs.properties=<System Full Path>\jcifs.properties

Yes. If you are running through an IDE then the tomcat command-line
options will not apply. You must then modify the command-line of the
program loading the JCIFS classes. Thus in the case of Eclipse you
must modify *it's* command-line (however that's done I don't know - I
don't use an IDE).

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/


More information about the jcifs mailing list