Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses constraint violation for org.joda.time packages #23059

Closed
jhanders34 opened this issue Oct 21, 2022 · 0 comments · Fixed by #23051
Closed

Uses constraint violation for org.joda.time packages #23059

jhanders34 opened this issue Oct 21, 2022 · 0 comments · Fixed by #23051
Assignees
Labels
release bug This bug is present in a released version of Open Liberty release:220012

Comments

@jhanders34
Copy link
Member

Describe the bug
After changing the server.xml to add features to the featureManager list, the server can fail to start with Uses constraint violation errors related to org.joda.time packages.

[10/21/22, 11:20:47:823 CDT] 00000021 30-com.ibm.ws.org.apache.wss4j.ws.security.web.2.3.0.jakarta E CWWKE0702E: Could not resolve module: com.ibm.ws.org.apache.wss4j.ws.security.web.2.3.0.jakarta [330]
Unresolved requirement: Import-Package: org.apache.wss4j.dom.engine; version="[2.3.0,3.0.0)"
-> Export-Package: org.apache.wss4j.dom.engine; bundle-symbolic-name="com.ibm.ws.org.apache.wss4j.ws.security.dom.2.3.0.jakarta"; bundle-version="1.0.70.202210111310"; version="2.3.0"; uses:="javax.security.auth.callback,javax.xml.datatype,javax.xml.namespace,org.apache.wss4j.common.crypto,org.apache.wss4j.common.ext,org.apache.wss4j.common.saml,org.apache.wss4j.common.token,org.apache.wss4j.common.util,org.apache.wss4j.dom,org.apache.wss4j.dom.action,org.apache.wss4j.dom.callback,org.apache.wss4j.dom.handler,org.apache.wss4j.dom.message.token,org.apache.wss4j.dom.processor,org.apache.wss4j.dom.validate,org.w3c.dom"
com.ibm.ws.org.apache.wss4j.ws.security.dom.2.3.0.jakarta [327]
Bundle was not resolved because of a uses constraint violation.
org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource com.ibm.ws.org.apache.wss4j.ws.security.dom.2.3.0.jakarta [osgi.identity; osgi.identity="com.ibm.ws.org.apache.wss4j.ws.security.dom.2.3.0.jakarta"; type="osgi.bundle"; version:Version="1.0.70.202210111310"] because it is exposed to package 'org.joda.time' from resources com.ibm.ws.org.joda.time.2.9.9 [osgi.identity; osgi.identity="com.ibm.ws.org.joda.time.2.9.9"; type="osgi.bundle"; version:Version="1.0.70.202210111212"] and com.ibm.ws.org.joda.time.1.6.2 [osgi.identity; type="osgi.bundle"; version:Version="1.0.70.202210111212"; osgi.identity="com.ibm.ws.org.joda.time.1.6.2"] via two dependency chains.

Chain 1:
com.ibm.ws.org.apache.wss4j.ws.security.dom.2.3.0.jakarta [osgi.identity; osgi.identity="com.ibm.ws.org.apache.wss4j.ws.security.dom.2.3.0.jakarta"; type="osgi.bundle"; version:Version="1.0.70.202210111310"]
import: (&(osgi.wiring.package=org.joda.time)(&(version>=2.9.0)(!(version>=3.0.0))))
|
export: osgi.wiring.package: org.joda.time
com.ibm.ws.org.joda.time.2.9.9 [osgi.identity; osgi.identity="com.ibm.ws.org.joda.time.2.9.9"; type="osgi.bundle"; version:Version="1.0.70.202210111212"]

Chain 2:
com.ibm.ws.org.apache.wss4j.ws.security.dom.2.3.0.jakarta [osgi.identity; osgi.identity="com.ibm.ws.org.apache.wss4j.ws.security.dom.2.3.0.jakarta"; type="osgi.bundle"; version:Version="1.0.70.202210111310"]
import: (&(osgi.wiring.package=org.apache.wss4j.common.principal)(&(version>=2.3.0)(!(version>=3.0.0))))
|
export: osgi.wiring.package=org.apache.wss4j.common.principal; uses:=org.joda.time
com.ibm.ws.org.apache.wss4j.ws.security.common.2.3.0.jakarta [osgi.identity; osgi.identity="com.ibm.ws.org.apache.wss4j.ws.security.common.2.3.0.jakarta"; type="osgi.bundle"; version:Version="1.0.71.202210211116"]
import: (osgi.wiring.package=org.joda.time)
|
export: osgi.wiring.package: org.joda.time
com.ibm.ws.org.joda.time.1.6.2 [osgi.identity; type="osgi.bundle"; version:Version="1.0.70.202210111212"; osgi.identity="com.ibm.ws.org.joda.time.1.6.2"]

Steps to Reproduce

  1. Create a new server
  2. Edit server.xml to have microprofile-5.0 feature
  3. Start server
  4. Stop server
  5. Update server.xml to add wsSecurity-1.1 feature to the feature list
  6. Start server

Expected behavior
Server should start successfully without errors for step 6 above.

Diagnostic information:

  • OpenLiberty Version: Seeing it on latest releases, but can be reproduced on earlier releases as well.
  • Affected feature(s) Combination of features that use different versions of joda time function. admincenter-1.0, wsSecurity-1.1 and mpHealth features are examples

Additional context
This problem can be worked around by adding the --clean option when starting the server with step 6 above.

@jhanders34 jhanders34 added the release bug This bug is present in a released version of Open Liberty label Oct 21, 2022
@jhanders34 jhanders34 self-assigned this Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release bug This bug is present in a released version of Open Liberty release:220012
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants