[jcifs] UnknownHostException

Michael B Allen mba2000 at ioplex.com
Thu Nov 2 15:05:02 GMT 2006


This is a hostname lookup error. You need to set jcifs.netbios.wins. Just
try one of the two examples in the doces.

Mike

On Thu, 2 Nov 2006 14:17:35 +0100
jbaker-cifs at javasystemsolutions.com wrote:

> Hello,
> 
> Following on from my earlier mail, I'm looking at the source:
> 
> http://jcifs.samba.org/src/src/jcifs/netbios/NameServiceClient.java
> 
> As I'd like to know what's causing this:
> 
> - Servlet.service() for servlet HomeServlet threw exception
> java.net.UnknownHostException: MYCOMPANY
>         at 
> jcifs.netbios.NameServiceClient.getAllByName(NameServiceClient.java:292)
>         at jcifs.netbios.NbtAddress.getAllByName(NbtAddress.java:454)
>         at jcifs.smb.SmbSession.getChallengeForDomain(SmbSession.java:95)
>         at jcifs.http.NtlmHttpFilter.negotiate(NtlmHttpFilter.java:150)
>         at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:114)
>         at
> 
> So consider the getAllByName method. I think it could do with some extra 
> logging before the exception is thrown at the end (perhaps just to say "I've 
> given up doing whatever ...") - right now, the exception could be coming from 
> two places. But given this:
> 
>             try {
>                 send( request, response, RETRY_TIMEOUT );
>             } catch( IOException ioe ) {
>                 if( log.level > 1 )
>                     ioe.printStackTrace( log );
>                 throw new UnknownHostException( name.name );
>             }
> 
> Prints the stack trace to the log, that can not be the cause as we can't see 
> it in the logs. That just leaves the final line of the method.
> 
> What is the purpose of this method? UnknownHostException seems a little 
> misleading as we're discussing a domain..
> 
> 
> John
> 


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


More information about the jcifs mailing list