Announcement Announcement Module
Collapse
No announcement yet.
Missing bundle constraints Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Missing bundle constraints

    Hi,

    I have both jasper reports and eclipse jdt bundles in my bundles/usr directory, bud the S2AP still complains that there are missing constraints

    Bundle: com.springsource.net.sf.jasperreports_2.0.5 - Missing Constraint: Import-Package: org.eclipse.jdt.core.compiler; version="[3.3.0,4.0.0)"

    Is this a bundle issue, or am I doing something wrong?

    Philippe

  • #2
    Missing bundle constraints

    Hi Philippe,

    Could you please post the complete error message / stack trace that you received?

    Thanks,
    Andy

    Comment


    • #3
      Missing bundle constraints

      You asked for it, you get it

      [2008-05-09 13:43:16.550] Connection(4)-127.0.0.1 <SPDE0018E> Unable to install application from location 'file:/opt/springsource-ap-1.0/stage/boekhouding-osgipresentation.war/'. Could not satisfy constraints for bundle 'nl.tjonahen.boekhouding.presentation' at version '1.0.0'.
      Cannot resolve: nl.tjonahen.boekhouding.presentation
      Resolver report:
      Bundle: com.springsource.net.sf.jasperreports_2.0.5 - Missing Constraint: Import-Package: org.eclipse.jdt.core.compiler; version="[3.3.0,4.0.0)"
      .
      [2008-05-09 13:43:16.692] Connection(4)-127.0.0.1 <SPDE0011E> Deployment failed.
      com.springsource.platform.deployer.core.Deployment Exception: Unable to satisfy constraints of 'nl.tjonahen.boekhouding.presentation' version '1.0.0': Cannot resolve: nl.tjonahen.boekhouding.presentation
      Resolver report:
      Bundle: com.springsource.net.sf.jasperreports_2.0.5 - Missing Constraint: Import-Package: org.eclipse.jdt.core.compiler; version="[3.3.0,4.0.0)"

      at com.springsource.platform.deployer.core.internal.S tandardApplicationDeployer.logExceptionIfNeeded(St andardApplicationDeployer.java:444)
      at com.springsource.platform.deployer.core.internal.S tandardApplicationDeployer.deploy(StandardApplicat ionDeployer.java:392)
      at com.springsource.platform.deployer.controls.Standa rdDeployerControl.deploy(StandardDeployerControl.j ava:62)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at sun.reflect.misc.Trampoline.invoke(MethodUtil.java :36)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java :243)
      at javax.management.modelmbean.RequiredModelMBean.inv okeMethod(RequiredModelMBean.java:1073)
      at javax.management.modelmbean.RequiredModelMBean.inv oke(RequiredModelMBean.java:954)
      at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke (DynamicMetaDataImpl.java:213)
      at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDa taImpl.java:220)
      at com.sun.jmx.interceptor.DefaultMBeanServerIntercep tor.invoke(DefaultMBeanServerInterceptor.java:815)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxM BeanServer.java:784)
      at javax.management.remote.rmi.RMIConnectionImpl.doOp eration(RMIConnectionImpl.java:1410)
      at javax.management.remote.rmi.RMIConnectionImpl.acce ss$100(RMIConnectionImpl.java:81)
      at javax.management.remote.rmi.RMIConnectionImpl$Priv ilegedOperation.run(RMIConnectionImpl.java:1247)
      at javax.management.remote.rmi.RMIConnectionImpl.doPr ivilegedOperation(RMIConnectionImpl.java:1343)
      at javax.management.remote.rmi.RMIConnectionImpl.invo ke(RMIConnectionImpl.java:784)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:294)
      at sun.rmi.transport.Transport$1.run(Transport.java:1 53)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport. java:149)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:466)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport.java:707)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: com.springsource.platform.osgi.framework.UnableToS atisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'nl.tjonahen.boekhouding.presentation' at version '1.0.0': Cannot resolve: nl.tjonahen.boekhouding.presentation
      Resolver report:
      Bundle: com.springsource.net.sf.jasperreports_2.0.5 - Missing Constraint: Import-Package: org.eclipse.jdt.core.compiler; version="[3.3.0,4.0.0)"

      at com.springsource.platform.osgi.framework.equinox.E quinoxBundleInstaller.satisfyConstraints(EquinoxBu ndleInstaller.java:339)
      at com.springsource.platform.deployer.app.legacy.Lega cyApplication.deploy(LegacyApplication.java:77)
      at com.springsource.platform.deployer.core.internal.S tandardApplicationDeployer.deploy(StandardApplicat ionDeployer.java:390)
      ... 33 more


      Philippe

      Comment


      • #4
        Missing bundle constraints

        Same problem when importing net.sf.cglib

        Content of my usr directory is:

        com.springsource.antlr-2.7.6.jar
        com.springsource.com.lowagie.text-2.0.8.jar
        com.springsource.javassist-3.3.0.ga.jar
        com.springsource.javax.servlet-2.4.0.jar
        com.springsource.javax.servlet.jsp-2.1.0.jar
        com.springsource.javax.servlet.jsp.jstl-1.1.2.jar
        com.springsource.net.sf.cglib-2.1.3.jar
        com.springsource.net.sf.ehcache-1.2.3.jar
        com.springsource.net.sf.jasperreports-2.0.5.jar
        com.springsource.org.apache.commons.beanutils-1.7.0.jar
        com.springsource.org.apache.commons.collections-3.2.0.jar
        com.springsource.org.apache.commons.dbcp-1.2.2.osgi.jar
        com.springsource.org.apache.commons.digester-1.8.0.jar
        com.springsource.org.apache.commons.fileupload-1.2.0.jar
        com.springsource.org.apache.commons.io-1.4.0.jar
        com.springsource.org.apache.commons.logging-1.1.1.jar
        com.springsource.org.apache.commons.pool-1.3.0.jar
        com.springsource.org.apache.derby-10.3.2000001.599110.jar
        com.springsource.org.apache.jasper.org.eclipse.jdt-6.0.16.jar
        com.springsource.org.apache.log4j-1.2.15.jar
        com.springsource.org.apache.taglibs.standard-1.1.2.jar
        com.springsource.org.apache.tiles-2.0.5.jar
        com.springsource.org.apache.tiles.core-2.0.5.osgi.jar
        com.springsource.org.apache.tiles.jsp-2.0.5.jar
        com.springsource.org.dom4j-1.6.1.jar
        com.springsource.org.eclipse.jdt.core.compiler.bat ch-3.3.0.jar
        com.springsource.org.hibernate-3.2.6.ga.jar
        com.springsource.org.jfree-1.0.12.jar
        com.springsource.org.jfree.chart-1.0.9.jar
        com.springsource.org.objectweb.asm-1.5.3.jar
        com.springsource.org.objectweb.asm.attrs-1.5.3.jar

        Philippe

        Comment


        • #5
          Missing bundle constraints

          Thanks Phillipe.

          Unfortunately that hasn't provided as much information as I hoped it would. Once we've determined the cause of the problem, I'll make sure that the error reporting is also improved so that it's not so difficult in future.

          In the meantime we've got a couple of options. If you're happy to send me a copy of your application then that would be my preferred option. You can send it to me at andy.wilkinson at springsource.com. Alternatively, I can describe how to use Equinox's telnet console to get some more information about the cause of the problem.

          Thanks again,
          Andy

          Comment


          • #6
            Missing bundle constraints

            Could you describe how to use Equinox's telnet console anyway? It sounds like something people would benefit from knowing about.

            Comment


            • #7
              Missing bundle constraints

              Hi Rob,

              Sure.

              Equinox provides an in-built console which can be accessed via telnet on port 2401. Once you've connected you should see output similar to the following:

              osgi>

              Probably the most useful command to get started with is ss which will provide the status of all of the installed bundles. The resulting list is in the form:

              <bundleId> <status> <bundleSymbolicName_bundleVersion>

              Each line will look similar to following:

              84 INSTALLED com.springsource.org.apache.commons.dbcp_1.2.2.osg i

              For cases like Phillipe's where a dependency cannot be satisfied it's bundles in INSTALLED state that are of interest. You can attempt to start a bundle that's in INSTALLED state by using the start command and specifying the bundle's id. E.g.:

              osgi> start 84

              This command will attempt to start the bundle with an id of 84. If the attempt fails Equinox will report an error explaining why the bundle couldn't be started. In the case of the commons DBCP bundle Equinox tells me the following:

              org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.commons.pool; version="[1.3.0,2.0.0)"

              I now know that the Commons DBCP bundle requires another bundle to be installed which exports the org.apache.commons.pool package. It also needs to have a version between 1.3.0 inclusive and 2.0.0 exclusive. That's it for this simple case. I don't have the Common Pool bundle in my Platform's repository so Commons DBCP can't be started.

              There are a large number of other commands available via the console. You can see a list of them by using the help command.

              One word of caution: to disconnect from the console use the disconnect command, rather than the exit command. Using exit will stop the Equinox instance to which you've connected, i.e. it'll shut down the Platform which isn't typically what you want to happen.

              Regards,
              Andy

              Comment


              • #8
                Missing bundle constraints

                Thanks for taking the time Andy.

                R.

                Comment


                • #9
                  Missing bundle constraints

                  Andy,

                  If I telnet and do a ss (bad name for a command ) then the only eclipse bundles I see are

                  the org.eclipse.osgi and the com.springsource.org.apache.jasper.org.eclipse.jdt

                  the bundle that is missing is the
                  com.springsource.org.eclipse.jdt.core.compiler.bat ch-3.3.0.jar

                  Looks like it that it is skipped during startup?

                  Philippe

                  Comment


                  • #10
                    Missing bundle constraints

                    Hi Phillipe,

                    Thanks for the latest info and for sending me your app, it's allowed me to figure out what the problem is. You've discovered a bug in the Platform for which I've opened a JIRA: http://issuetracker.springsource.com/browse/PLATFORM-33. Thanks for your help with finding this problem.

                    While you're waiting for a version of the Platform that includes the fix there's a simple workaround that you could try. Moving the com.springsource.org.eclipse.jdt.core.compiler.bat ch-3.3.0.jar file from the repository/bundles/usr directory to repository/bundles/ext should solve your problem for the time being as it'll allow the provisioning search logic to find the bundle rather than giving up after finding the Tomcat Jasper-specific match in ext.

                    Thanks again,
                    Andy

                    Comment


                    • #11
                      Missing bundle constraints

                      OK,

                      This works for me. Now at least the app starts without any problem. However when trying to run a report I get a class not found exception.

                      The classes the report cannot find are mine. Is there a way to tell the jasper bundle to also include my classes.
                      Or is there some other way to extend the class path of an existing bundle?

                      I am not sure if this is the place to ask.

                      Philippe

                      Comment


                      • #12
                        Missing bundle constraints

                        Hi Philippe,

                        We've seen a few problems with classloading in the Platform with various frameworks -- sometimes due to a problem in the Platform, and sometimes due to the way the framework is doing its classloading. Can you please post the stack trace of the ClassNotFoundException so that I can determine which is the case here.

                        Thanks,
                        Andy

                        Comment


                        • #13
                          Missing bundle constraints

                          Andy,

                          The stack trace:

                          java.lang.NoClassDefFoundError: nl/tjonahen/boekhouding/domein/KostenPlaats
                          toonfinancieelRapport_1208345853318_549926.evaluat e(toonfinancieelRapport_1208345853318_549926:166)
                          net.sf.jasperreports.engine.fill.JREvaluator.evalu ate(JREvaluator.java:186)
                          net.sf.jasperreports.engine.fill.JRCalculator.eval uate(JRCalculator.java:537)
                          net.sf.jasperreports.charts.fill.JRFillCategorySer ies.evaluate(JRFillCategorySeries.java:152)
                          net.sf.jasperreports.charts.fill.JRFillCategoryDat aset.customEvaluate(JRFillCategoryDataset.java:118 )
                          net.sf.jasperreports.engine.fill.JRFillElementData set.evaluate(JRFillElementDataset.java:140)
                          net.sf.jasperreports.engine.fill.JRCalculator.calc ulateVariables(JRCalculator.java:148)
                          net.sf.jasperreports.engine.fill.JRVerticalFiller. fillDetail(JRVerticalFiller.java:682)
                          net.sf.jasperreports.engine.fill.JRVerticalFiller. fillReportStart(JRVerticalFiller.java:255)
                          net.sf.jasperreports.engine.fill.JRVerticalFiller. fillReport(JRVerticalFiller.java:113)
                          net.sf.jasperreports.engine.fill.JRBaseFiller.fill (JRBaseFiller.java:895)
                          net.sf.jasperreports.engine.fill.JRBaseFiller.fill (JRBaseFiller.java:817)
                          net.sf.jasperreports.engine.fill.JRFiller.fillRepo rt(JRFiller.java:89)
                          net.sf.jasperreports.engine.JasperFillManager.fill Report(JasperFillManager.java:601)
                          org.springframework.web.servlet.view.jasperreports .AbstractJasperReportsView.fillReport(AbstractJasp erReportsView.java:639)
                          org.springframework.web.servlet.view.jasperreports .AbstractJasperReportsView.renderMergedOutputModel (AbstractJasperReportsView.java:570)
                          org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:252)
                          org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1173)
                          org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:901)
                          org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:809)
                          org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:571)
                          org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:511)
                          javax.servlet.http.HttpServlet.service(HttpServlet .java:710)
                          javax.servlet.http.HttpServlet.service(HttpServlet .java:803)

                          Philippe

                          Comment


                          • #14
                            Missing bundle constraints

                            Hi Phillipe,

                            I'm by no means a JasperReports expert but I've taken a look at JRClassGenerator which, I believe, is the class that creates the JREvaluator subclass, toonfinancieelRapport_1208345853318_549926. JRClassGenerator doesn't appear to generate code that uses Class.forName so my guess is that the generated code is using 'standard' classloading. Looking in the generated source code for toonfinancieelRapport_1208345853318_549926 around line 166 would help here.

                            Unfortunately, I can't tell from the information that we've got thus far which classloader is being used, seeing the source code for the generated evaluate method may help with that. Also, does your Web module's manifest contain an import for the nl.tjonahen.boekhouding.domein package?

                            Thanks,
                            Andy

                            Comment


                            • #15
                              Missing bundle constraints

                              Andy,

                              It is a cast into (nl/tjonahen/boekhouding/domein/KostenPlaats), The package is in my Manifest file.

                              This is maybe because I do not completely understand the classloading involved, but if I look at the stacktrace it is called from org.springframework.web.servlet.DispatcherServlet. This is from a differant bundle then my own, so a differnt classloader, one that does not understand my classes, hence the error.


                              Philippe

                              Comment

                              Working...
                              X