[jcifs] Tomcat Install

eglass1 at attbi.com eglass1 at attbi.com
Sat Apr 5 02:58:09 EST 2003


Attached is the smallest complete NTLM app possible.  You should be able to:

1.  Copy the jcifs jar into the shared/lib directory under Tomcat
2.  Copy the attached War into the webapps directory under Tomcat
3.  Start Tomcat
4.  Point IE at "http://server/ntlmtest/index.jsp"

You should see the authenticated user name.

If this doesn't work, the most likely culprit is your IE settings.  
Under "Tools -> Internet Options", click on the Security tab.  Under "Local 
Intranet" (and possibly "Internet" as well), check at the bottom of the list 
for the "User Authentication/Logon" setting.  This should be set to "Automatic 
logon only in Intranet Zone" or "Automatic logon with current username".

If it is set to "Prompt for user name and password", you should be getting a 
login prompt; if it is set to "Anonymous logon", you will get a 401 error with 
no prompt at all (which sounds like what you are seeing).

Eric

> I have implemented you web.xml and get the same result.  The application
> always returns a 401 tomcat message.  It does not reach my servlet either.
> It is being returned at the filter level.  
> 
> Any other Suggestions?
> 
> -----Original Message-----
> 
> Try the attached; there were a couple of problems with the one you had:
> 
> 1. Some of the init-params for the filter were outside the filter section.
> 2. There was no filter mapping specified.
> 3. The filter and filter-mapping sections go before the servlet section 
> 
> The first two are definite show-stoppers.  Whether the third causes a
> problem 
> or not depends on whether your container uses a validating parser to process
> 
> the web.xml file.
> > To add, I have included my DDF file.  The servlet "nathan" is where I was
> > testing the functionality.  I added all the code that was in the
> > NtlmHttpAuthExample.
> > 
> > I wondering if it is because of tomcats response to a 401 status.  I
> haven't
> > delv deeper into the code to see if they catch the 401 response before and
> > attach there warning message.
> > 
> > Don't know it that matters.  
> > -------- Begin ------------------
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <!DOCTYPE web-Xpp
> > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> > "http://java.sun.com/dtd/web-app_2_3.dtd">
> > <web-Xpp>
> > <display-name>Welcome to PCBP-Online</display-name>
> > <deXcription>Welcome to PCBP-Online</deXcription>
> > <servlet>
> > <servlet-name>nathan</servlet-name>
> > <servlet-class>NathanServlet</servlet-class>
> > </servlet>
> > <servlet-mXpping>
> > <servlet-name>nathan</servlet-name>
> > <url-pattern>/</url-pattern>
> > </servlet-mXpping>
> > 
> > <resource-ref>
> > <deXcription>DB Connection</deXcription>
> > <res-ref-name>jdbc/TestDB</res-ref-name>
> > <res-type>javax.sql.DataSource</res-type>
> > <res-auth>Container</res-auth>
> > </resource-ref>
> > 
> > <filter>
> > <filter-name>NTLM HTTP Authentication Filter</filter-name>
> > <filter-class>jcifs.http.NtlmHttpFilter</filter-class>
> > <init-param>
> > <param-name>jcifs.http.domainController</param-name>
> > <param-value>999.24.64.53</param-value>
> > </init-param>
> > </filter>
> > <init-param>
> > <param-name>jcifs.smb.client.domain</param-name>
> > <param-value>CORPORATE</param-value>
> > </init-param>
> > <init-param>
> > <param-name>jcifs.netbios.wins</param-name>
> > <param-value>999.24.64.36</param-value>
> > </init-param>
> > </web-Xpp>
> > 
> > -------- End ------------------
> > -----Original Message-----
> > From: Vijayanarayanaswamy Karthikeyan [mailto:vkarthik at singtel.com]
> > Sent: Thursday, April 03, 2003 9:45 PM
> > To: Nathan Zentner
> > Subject: RE: [jcifs] Tomcat Install
> > 
> > 
> >   1. Can you tell me how did you test the servlet?. 
> >   2. Have you mapped it correctly in the deployment descriptor file(DDF)?.
> 
> >   3. Have you set the properties in the DDF?
> >   4. Did you check your tomcat log file(Catalina.out) for possible
> errors.?
> > 
> >   Probabaly a servlet mapping error.  Carefully review your settings and
> try
> > again. 
> > 
> > 
> >   
> > 
> > [Vijayanarayanaswamy Karthikeyan]  -----Original Message-----
> > From: Nathan Zentner [mailto:Nathan.Zentner at paccoast.com]
> > Sent: Friday, April 04, 2003 6:24 AM
> > To: 'jcifs at lists.samba.org'
> > Subject: [jcifs] Tomcat Install
> > 
> > 
> > I follow the instructions in the Network Explorer Servlet and this is my
> > setup
> > 
> > Linux Server
> > Latest Tomcat
> > Latest jCIFS
> > FIlter Set
> > 
> > WHen I run the NtlmHttpAuthExample, all I get is a Tomcat Status Screen
> 401?
> > 
> > Can anybody help me with the steps that I'm missing?
> > 
> > Nathan Zentner
> > 
> 
> 
> DISCLAIMER: This communication and any files or attachments transmitted with
> it may contain information that is copyrighted or confidential and exempt
> from disclosure under applicable law.  It is intended solely for the use of
> the individual or the entity to which it is addressed.  If you are not the
> intended recipient, you are herby notified that any use, dissemination, or
> copying of this communication is strictly prohibited.  If you have received
> this communication in error, please notify us at once so that we may take
> the appropriate action and avoid troubling you further. Thank you for your
> cooperation. Contact information: Pacific Coast Building Products
> 1-916-971-2330 and ask for the e-mail administrator. 
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 714 bytes
Desc: not available
Url : http://lists.samba.org/archive/jcifs/attachments/20030404/6392b1fd/attachment.obj


More information about the jcifs mailing list