Bug 5828 - Multiple WINS - ArrayIndexOutOfBoundException @ at jcifs.netbios.NbtAddress.getWINSAddress(NbtAddress.java:533)
Summary: Multiple WINS - ArrayIndexOutOfBoundException @ at jcifs.netbios.NbtAddress.g...
Status: NEW
Alias: None
Product: jCIFS
Classification: Unclassified
Component: core (show other bugs)
Version: 1.2
Hardware: x86 Windows 2003
: P3 normal
Target Milestone: ---
Assignee: Samba Bugzilla Account
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-17 07:19 UTC by Ralf H.
Modified: 2009-04-13 08:15 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf H. 2008-10-17 07:19:37 UTC
We are using "jcifs-1.2.22" in the following environment:

OS: Windows 2003 R2 SP2 english
Tomcat: 5.5
JDK: Bea jrockit-R27.5.0-jdk1.6.0_03
AD-Domain: Windows 2000

Infrastructure:
two WINS and three DC (Domain Controller)


We have the following filter-configuration for our webapplications:

web.xml (1):
<filter>
 <filter-name>NTLM HTTP Authentication Filter</filter-name>
 <filter-class>jcifs.http.NtlmHttpFilter</filter-class>
 <init-param>
  <param-name>jcifs.smb.client.domain</param-name>
  <param-value>MyDOMAIN</param-value>
 </init-param>
</filter>
<filter-mapping>
 <filter-name>NTLM HTTP Authentication Filter</filter-name>
 <url-pattern>/*</url-pattern>
</filter-mapping>

web.xml(2):
<filter>
 <filter-name>NTLM HTTP Authentication Filter</filter-name>
 <filter-class>jcifs.http.NtlmHttpFilter</filter-class>
 <init-param>
  <param-name>jcifs.netbios.wins</param-name>
  <param-value>20.x.x.1,20.x.x.2</param-value>
 </init-param>
 <init-param>
  <param-name>jcifs.smb.client.domain</param-name>
  <param-value>MyDOMAIN</param-value>
 </init-param>
</filter>
<filter-mapping>
 <filter-name>NTLM HTTP Authentication Filter</filter-name>
 <url-pattern>/*</url-pattern>
</filter-mapping>

Sometimes the following error occures during processing each web-request and as a result we have to reboot the Tomcat service OR - if the error still occures - the whole machine:

SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.ArrayIndexOutOfBoundsException: 2
 at jcifs.netbios.NbtAddress.getWINSAddress(NbtAddress.java:533)
 at jcifs.UniAddress.getAllByName(UniAddress.java:279)
 at jcifs.UniAddress.getByName(UniAddress.java:245)
 at jcifs.http.NtlmHttpFilter.negotiate(NtlmHttpFilter.java:156)
 at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:114)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:482)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:834)
 at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:640)
 at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)
 at java.lang.Thread.run(Thread.java:619)

My sourcecode inspections lead me to the assumption that you have an error in the following code/class:

NbtAdress.java @ lines 533 and 545
return NBNS.length == 0 ? null : NBNS[nbnsIndex]; 
should be:
return NBNS.length < nbnsIndex ? null : NBNS[nbnsIndex]; 

AND/OR in the calculation of the nbnsIndex


Best regards,

Ralf Heyde
Comment 1 Gerald (Jerry) Carter (dead mail address) 2009-04-13 08:15:07 UTC
Reassigning since current assignee mail addr is bouncing