eclipse-ee4j / eclipse-ee4j/metro-wsit
NPE if specifying message-level policy but not binding-level.
- Dominant language
- Java
- Stars
- 6
- Forks
- 21
- Avg merge
- 10h 2m
- Merged PRs (30d)
- 1
Description
Hello, for a SOAP client call, if I comment out the binding-level policy
reference but not the message-level references, such as here:
I will get an NPE:
[INFO] [exec:exec]
[INFO] Exception in thread "main" java.lang.NullPointerException
[INFO] at
com.sun.xml.wss.jaxws.impl.RMPolicyResolver.getOperationLevelPolicy(RMPolicyResolver.java:74)
[INFO] at
com.sun.xml.wss.jaxws.impl.SecurityTubeBase.buildProtocolPolicy(SecurityTubeBase.java:1216)
[INFO] at
com.sun.xml.wss.jaxws.impl.SecurityTubeBase.collectPolicies(SecurityTubeBase.java:732)
[INFO] at
com.sun.xml.wss.jaxws.impl.SecurityTubeBase.(SecurityTubeBase.java:276)
[INFO] at
com.sun.xml.wss.jaxws.impl.SecurityClientTube.(SecurityClientTube.java:131)
[INFO] at
com.sun.xml.wss.provider.wsit.SecurityTubeAppender.appendTube(SecurityTubeAppender.java:189)
Probably best to switch this to a user-friendly error message ("Message-level
policy specified without a binding-level policy" or similar).
#### Environment
Operating System: All
Platform: All
#### Affected Versions
[current]
Source: [https://github.com/javaee/metro-wsit/issues/1044](https://github.com/javaee/metro-wsit/issues/1044)
Author: glassfishrobot
Contributor guide
Research direction
Start in com.sun.xml.wss.jaxws.impl.RMPolicyResolver.java at getOperationLevelPolicy, then inspect its call from SecurityTubeBase.buildProtocolPolicy. Reproduce the SOAP client configuration with message-level policy references but no binding-level reference, and make the failure report a user-friendly policy error instead of an NPE.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100