Mantis - Resin
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
988 | minor | always | 03-13-06 13:42 | 04-03-06 16:39 | |
|
|||||
Reporter: | igor | Platform: | jdk1.4.2_07 | ||
Assigned To: | ferg | OS: | windows xp / linux | ||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | |||
Product Build: | Hessian 3.0.8 | Resolution: | fixed | ||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 3.0.19 | ||
|
|||||
Summary: | 0000988: Authentication Exception 401 reporting problem | ||||
Description: |
Use Case: 1. Setting authentication data: HessianProxyFactory factory = new HessianProxyFactory(); String url = (String) props.get("url"); String user = (String) props.get("username"); String pwd = (String) props.get("password"); factory.setUser(user); factory.setPassword(pwd); return factory.create(clazz, url); 2. Calling <aService>.<aMethod> (no streams, regular web services call) 3. Using wrong user/password in order to test getting 401 error 4. Reported error does not contain error cause Code analysis ================ (see HessianProxy code fragment) (1) code = 401 (2) empty buffer (3) is = null (4) catch (IOException e) {} ==> this is original code, "null" action (5) throw exception with no details specified: buffer is empty and error code is not passed. Code change =========== catch (IOException e) { // added 3/13/06 (4) if (is == null) { throw new HessianProtocolException(e.getCause()); } } HessianProtocolException is wrapped round root cause exception and is propagated to client code. HessianProxy code fragment ========================== if (conn instanceof HttpURLConnection) { HttpURLConnection httpConn = (HttpURLConnection) conn; int code = 500; try { code = httpConn.getResponseCode(); // (1) } catch (Exception e) { } if (code != 200) { StringBuffer sb = new StringBuffer(); (2) int ch; try { is = httpConn.getInputStream(); // (3) if (is != null) { while ((ch = is.read()) >= 0) sb.append((char) ch); is.close(); } is = httpConn.getErrorStream(); if (is != null) { while ((ch = is.read()) >= 0) sb.append((char) ch); } } catch (FileNotFoundException e) { throw new HessianRuntimeException(String.valueOf(e)); } catch (IOException e) { // added 3/13/06 (4) if (is == null) { throw new HessianProtocolException(e.getCause()); } } if (is != null) is.close(); throw new HessianProtocolException(sb.toString()); // (5) } } |
||||
Steps To Reproduce: |
Use Case: 1. Setting authentication data: HessianProxyFactory factory = new HessianProxyFactory(); String url = (String) props.get("url"); String user = (String) props.get("username"); String pwd = (String) props.get("password"); factory.setUser(user); factory.setPassword(pwd); return factory.create(clazz, url); 2. Calling <aService>.<aMethod> (no streams, regular web services call) 3. Using wrong user/password in order to test getting 401 error 4. Reported error does not contain error cause |
||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|