[jcifs] Problem with jcifs + Tomcat + Active Directory

Ossie Moore jcifs.exposes.email.address at gmail.com
Fri Jun 13 15:49:21 GMT 2008


SUMMARY OF PROBLEM:

If I *restart* Tomcat, Authentication only works for the first user to
connect to the Tomcat application. All subsequent user authentication
attempts fail.

If I *stop* Tomcat, delete the work directory, *start* Tomcat, all
works well for any number of users tested.

If I *restart* Tomcat, Authentication only works for the first user to
connect. However, watching Tomcat output, if i wait for
   0: socket closed: Socket[addr=/192.168.1.1,port=445,localport=3759]
then I can login as a different, new user. But then only that user can
authenticate.

QUESTIONS:

1. Does anyone know a work around for this issue that does not involve
purging the work directory?
2. Does anyone know *why* this is happening?

DETAILS (SHOULD YOU NEED THEM):

Restarting the Tomcat server without purging the work directory
results in any application deployed that relies on jcifs to perform
authentication fails for all but the first user. The first user can
successfully login but no other user after that can login. They are
prompted for their username and password but entering the correct
values fails to authenticate.

I have tried various combinations of tomcat 6.0.14 & 6.0.16 with jcifs
1.2.17 and 1.2.21. I am running Java 1.6.0_05 and Windows Server 2003.
We are authenticating against active directory. I have also tried
renaming index.html to index.jsp.

EXAMPLE WEB APP USED TO CONFIRM PROBLEM:

My example web application consists of the following files:

   test-webapp\index.html
   test-webapp\WEB-INF\lib\jcifs-1.2.21.jar
   test-webapp\web.xml

Contets of test-webapp\index.html :

   <html><body>it worked!</body></html>

Contents of web.xml: (username, password, domain and ip altered here
for obvious reasons)

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"
version="2.5">
  <display-name>test-webapp</display-name>
  <filter>
    <filter-name>NtlmHttpFilter</filter-name>
    <filter-class>jcifs.http.NtlmHttpFilter</filter-class>
    <init-param>
      <param-name>jcifs.http.domainController</param-name>
      <param-value>192.168.1.1</param-value>
    </init-param>
    <init-param>
      <param-name>jcifs.smb.client.domain</param-name>
      <param-value>MYDOMAIN</param-value>
    </init-param>
    <init-param>
      <param-name>jcifs.smb.client.username</param-name>
      <param-value>usernamehere</param-value>
    </init-param>
    <init-param>
      <param-name>jcifs.smb.client.password</param-name>
      <param-value>supersecretpassword</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>NtlmHttpFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>
</web-app>


More information about the jcifs mailing list