Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Trying to debug uses violation

  1. #1

    Default Trying to debug uses violation

    This is related to the "Shell hanging" post. My shell hung when I tried to debug a uses violation, which is described next.

    When I deployed my app, I received the following error:

    ------BEGIN ERROR-----------------
    Could not satisfy constraints for bundle 'com.apress.prodmserver.vehicle.repository.jpa' at version '1.0.0'. Cannot resolve: com.apress.prodmserver.vehicle.repository.jpa
    Resolver report:
    Uses violation: <Import-Package: org.springframework.beans.factory.aspectj; version="0.0.0"> in bundle <com.apress.prodmserver.vehicle.repository.jpa_1.0 .0>
    Possible matches:
    <Export-Package: org.springframework.beans.factory.aspectj; version="3.0.0.CI-395"> from <org.springframework.aspects_3.0.0.CI-395>
    No dependent constraint mismatch. Try refreshing the <org.springframework.aspects_3.0.0.CI-395> bundle.
    ------END ERROR-----------------

    I read Rod Harrop's post on Diagnosing OSGi uses conflicts, and tried employing similar strategies to locate the cause. Because my shell hung whenever I used "headers" for one of the suspects, there is no way for me to further debugging. My understanding is that I look for conflicts in the imports of org.springframework.aspects_3.0.0.CI-395 and com.apress.prodmserver.vehicle.repository.jpa_1.0. 0. Below I am pasting the respective files.

    (spring.aspect)
    ------BEGIN org.springframework.aspects_3.0.0.CI-395 MANIFEST.MF Import Section -----------------

    Import-Package:
    org.apache.commons.logging;version="[1.1.1, 2.0.0)",
    org.aspectj.internal.lang.annotation;version="[1.5.4, 2.0.0)";resolution:="optional",
    org.aspectj.lang;version="[1.5.4, 2.0.0)";resolution:="optional",
    org.aspectj.lang.annotation;version="[1.5.4, 2.0.0)";resolution:="optional",
    org.aspectj.lang.reflect;version="[1.5.4, 2.0.0)";resolution:="optional",
    org.springframework.beans;version="[3.0.0, 3.0.1)",
    org.springframework.beans.factory;version="[3.0.0, 3.0.1)",
    org.springframework.beans.factory.annotation;versi on="[3.0.0, 3.0.1)",
    org.springframework.beans.factory.wiring;version="[3.0.0, 3.0.1)",
    org.springframework.transaction.annotation;version ="[3.0.0, 3.0.1)";resolution:="optional",
    org.springframework.transaction.interceptor;versio n="[3.0.0, 3.0.1)";resolution:="optional"
    ------END org.springframework.aspects_3.0.0.CI-395 -----------------

    (jpa)
    ------BEGIN com.apress.prodmserver.vehicle.repository.jpa_1.0. 0 MANIFEST.MF Import Section ----------------

    Import-Package: com.apress.prodmserver.vehicle.domain,
    com.apress.prodmserver.vehicle.repository,
    javax.sql

    Import-Bundle: com.springsource.org.eclipse.persistence;version="[1.1.0,1.1.0]";import-scope:=application,
    com.springsource.javax.persistence;version="[1.0.0,2.0.0)",
    com.springsource.org.aspectj.weaver;version="[1.6.6,1.6.7)"

    Import-Library: org.springframework.spring;version="[3.0.0,3.0.1)"

    ------END com.apress.prodmserver.vehicle.repository.jpa_1.0. 0 ------

    The Import-Package section in jpa is straight forward, and shouldn't conflict with spring.aspect. Import-Library shouldn't conflict with spring.aspect neither since spring.aspect is part of the library. Finally, I was about to examine the headers in bundles under Import-Bundle, but my shell didn't work.

    Hopefully someone with a keen eye can spot the conflict.
    Last edited by candy.chiu.ad; Oct 21st, 2009 at 07:48 PM.

  2. #2

    Default Checked SpringSource Bundle Repository

    I resorted to checking the import-package declarations in the repository. I didn't find any conflicts. Although both com.springsource.org.aspectj.weaver and org.springsource.aspects both import org.apache.commons.logging, they are importing the exact same versions. And they are not exporting this import through uses.

    By the way, I am not seeing any bundles in my server with more than one version installed. I am not even sure how did the uses violations come up at the first place.
    Last edited by candy.chiu.ad; Oct 21st, 2009 at 08:00 PM.

  3. #3
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    An alternative to the shell is to use the admin console to explore the state dump as demonstrated briefly in a screencast. You should get a better insight into the possible sources of the package, although I agree that it is far from clear why you get a uses constraint violation in this particular case.
    Glyn Normington
    SpringSource

  4. #4

    Default

    Thanks for pointing me to the admin tool.

    I got the following page when I clicked on the Unresolved link on my bundle's state page. Seems like an error from the admin console instead of the bundle.

    ---- BEGIN report --------------------

    HTTP Status 500 -

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/jsp/fragments/state-resolve.jsp at line 10

    7:
    8: <jsp:include page="state-header.jsp" />
    9:
    10: <c:set var="bundle" value="${failure.failedBundle}" />
    11: <c:set var="hostsFragmentsMessage" value="NA" />
    12: <c:set var="hostsFragments" value="" />
    13: <c:choose>


    Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handle JspException(JspServletWrapper.java:505)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:416)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel(InternalResourceVi ew.java:239)
    org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:250)
    org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1072)
    org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:808)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:726)
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:636)
    org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:545)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:690)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    root cause

    java.lang.NumberFormatException: For input string: "failedBundle"
    java.lang.NumberFormatException.forInputString(Num berFormatException.java:48)
    java.lang.Integer.parseInt(Integer.java:449)
    java.lang.Integer.parseInt(Integer.java:499)
    javax.el.ListELResolver.toInteger(ListELResolver.j ava:373)
    javax.el.ListELResolver.getValue(ListELResolver.ja va:167)
    javax.el.CompositeELResolver.getValue(CompositeELR esolver.java:143)
    org.apache.el.parser.AstValue.getValue(AstValue.ja va:118)
    org.apache.el.ValueExpressionImpl.getValue(ValueEx pressionImpl.java:186)
    org.apache.jasper.runtime.PageContextImpl.propriet aryEvaluate(PageContextImpl.java:925)
    org.apache.jsp.WEB_002dINF.jsp.fragments.state_002 dresolve_jsp._jspx_meth_c_005fset_005f0(state_002d resolve_jsp.java:198)
    org.apache.jsp.WEB_002dINF.jsp.fragments.state_002 dresolve_jsp._jspService(state_002dresolve_jsp.jav a:98)
    org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel(InternalResourceVi ew.java:239)
    org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:250)
    org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1072)
    org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:808)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:726)
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:636)
    org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:545)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:690)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:803)

    ---- END report --------------------
    Last edited by candy.chiu.ad; Oct 22nd, 2009 at 05:28 PM.

  5. #5

    Default v1.0.2

    One more piece of information - my bundles worked under 1.0.2.SR02.

  6. #6
    Join Date
    Oct 2008
    Posts
    493

    Default

    Thanks for the update, and apologies for the problem you've found in the admin console. I've opened DMS-1798 for it.

    It looks like the problem you're facing is a transitive uses problem, i.e. the uses constraint isn't occurring at the top of the dependency graph. We've been doing some work in this sprint to improve the diagnostics in such cases (DMS-126). It'll be interesting to see if they help in this particular case. If possible, could you upload the bundles that you're using to create the problem so that we can try them out against the new diagnostics?
    Andy Wilkinson
    SpringSource

  7. #7

    Default Another try with the CI-450

    I tried deploying my bundles on CI-450. The same uses violation came up. This time, both the admin console and the server output console gave the exact same error. I am uploading the bundles (Note - bundles.zip was originally bundles.7z).

    Another observation I had is that the admin console rolled back all the changes when the deployment failed. The error message, on the other hand, advised refreshing one of the bundles (in this case - org.springframework.aspects_3.0.0.RC1) which has been uninstalled during the rollback. I had to reinstall the dependencies bundles by hand in order to refresh.

    ---- BEGIN Error message ------------------

    Resolver report:
    Uses violation: <Import-Package: org.springframework.beans.factory.aspectj; version="0.0.0"> in bundle <com.apress.prodmserver.vehicle.repository.jpa_1.0 .0>
    Possible matches:
    <Export-Package: org.springframework.beans.factory.aspectj; version="3.0.0.RC1"> from <org.springframework.aspects_3.0.0.RC1>
    No dependent constraint mismatch. Try refreshing the <org.springframework.aspects_3.0.0.RC1> bundle.

    ---- END Error message ------------------
    Attached Files Attached Files
    Last edited by candy.chiu.ad; Oct 26th, 2009 at 04:38 PM.

  8. #8
    Join Date
    Oct 2008
    Posts
    493

    Default

    Thanks. We're doing more work in this area in this sprint. I've added a pointer to your comments and your bundles to DMS-126.
    Andy Wilkinson
    SpringSource

  9. #9

    Default

    Steve - I saw your comment on DMS-126. Where should I send my bundles? My bundles were zipped using 7z, not zip. You may need to change the extension to 7z before unzipping, then you should see jar/war/pars.

  10. #10
    Join Date
    Feb 2009
    Location
    Hursley, near Winchester, UK
    Posts
    37

    Default bundles.zip

    @candy.chiu.ad
    The 7z hint was what I needed -- I have managed to unzip your files, and will try them. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •