Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 98751 invoked from network); 13 Jul 2010 21:13:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Jul 2010 21:13:46 -0000 Received: (qmail 24977 invoked by uid 500); 13 Jul 2010 21:13:46 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 24918 invoked by uid 500); 13 Jul 2010 21:13:45 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 24910 invoked by uid 99); 13 Jul 2010 21:13:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jul 2010 21:13:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jul 2010 21:13:41 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o6DL5oPt025788 for ; Tue, 13 Jul 2010 21:05:50 GMT Message-ID: <25838959.359201279055150416.JavaMail.jira@thor> Date: Tue, 13 Jul 2010 17:05:50 -0400 (EDT) From: "Richard S. Hall (JIRA)" To: dev@felix.apache.org Subject: [jira] Reopened: (FELIX-2459) Wrong error message on a missing package In-Reply-To: <24038868.153991277994589413.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/FELIX-2459?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Richard S. Hall reopened FELIX-2459: ------------------------------------ The implemented fix causes a regression in fragment handling since the thrown exception is used to detach conflicting fragments from the host. By rethrowing the exception, we don't see that the requirement came from a fragment which means we don't detach it in some cases where there is a conflict. We need to think about this some more. > Wrong error message on a missing package > ---------------------------------------- > > Key: FELIX-2459 > URL: https://issues.apache.org/jira/browse/FELIX-2459 > Project: Felix > Issue Type: Bug > Components: Framework > Affects Versions: framework-3.0.1 > Reporter: Florent BENOIT > Assignee: Richard S. Hall > Fix For: framework-3.2.0 > > Attachments: jonas-web-container-tomcat-6.0-5.2.0-M3-SNAPSHOT-ipojo.jar > > > Hi, > Here is the case : > I have one bundle with a missing import, I need to fix the bundle but Felix 3.0.1 is not helping me with the errors that are thrown. (the missing package required to start my bundle is "org.apache.juli.logging") and this missing package is not reported as a missing package in 3.0.1 while it was reported with Felix 2.0.5 > When testing this bundle with Felix 3.0.1, I get the following message : > org.osgi.framework.BundleException: Unresolved constraint in bundle xxx [89]: Unable to resolve 89.0: missing requirement [89.0] package; (&(package=org.apache.catalina.tribes.group.interceptors)(version>=7.0.0)) - [89.0] package; (&(package=org.apache.catalina.tribes.group.interceptors)(version>=7.0.0)) > at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3421) > at org.apache.felix.framework.Felix.startBundle(Felix.java:1754) > at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:905) > This package (org.apache.catalina.tribes.group.interceptors) is present in my bundle archive. > It tells me that a requirement is not available but I don't know which package is missing which is a big problem as it's quite difficult to fix an issue when there is a missing information > By switching back to Felix v2.0.5, I have the following error : > org.osgi.framework.BundleException: Unresolved constraint in bundle xxx [89]: package; (package=org.apache.juli.logging) > at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3299) > at org.apache.felix.framework.Felix.startBundle(Felix.java:1657) > at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:905) > And now, we can see that the missing package is printed > By adding some breakpoint in Felix 3.0.1, I can see that the original error is raised in ResolverImpl class but then this error is ignored > Here is the code that is raising my expecting missing package : > if ((candidates.size() == 0) && !req.isOptional()) > { > ResolveException ex = > new ResolveException("Unable to resolve " + module > + ": missing requirement " + req, module, req); > resultCache.put(module, ex); > m_logger.log(Logger.LOG_DEBUG, "No viable candidates", ex); > throw ex; > } > The exception which is built here is : > org.apache.felix.framework.resolver.ResolveException: Unable to resolve 89.0: missing requirement [89.0] package; (package=org.apache.juli.logging) > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 437 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.resolve(Resolver$ResolverState, Module) line: 78 > Felix$FelixResolver.resolve(Module) line: 4005 > Felix.resolveBundle(BundleImpl) line: 3414 > Felix.startBundle(BundleImpl, int) line: 1754 > BundleImpl.start(int) line: 905 > But this issue is ignored at the line 422 by the following code : > try > { > populateCandidates(state, candCap.getModule(), > candidateMap, resultCache); > } > catch (ResolveException ex) <--- silently catched > { > // Remove the candidate since we weren't able to > // populate its candidates. > itCandCap.remove(); > } > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 422 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.populateCandidates(Resolver$ResolverState, Module, Map, Map) line: 415 > ResolverImpl.resolve(Resolver$ResolverState, Module) line: 78 > Felix$FelixResolver.resolve(Module) line: 4005 > Felix.resolveBundle(BundleImpl) line: 3414 > Felix.startBundle(BundleImpl, int) line: 1754 > BundleImpl.start(int) line: 905 > Then I get an error by Felix but not the original root cause which is a problem for me > I get at these lines : > ex = org.apache.felix.framework.resolver.ResolveException: Unable to resolve 89.0: missing requirement [89.0] package; (&(package=org.apache.catalina.tribes.group.interceptors)(version>=7.0.0)) > catch (ResolveException ex) > { > if ((ex.getRequirement() != null) > && (ex.getRequirement() instanceof FragmentRequirement) > && (rootModule != > ((FragmentRequirement) ex.getRequirement()).getFragment())) > { > m_resolverState.detachFragment( > newRootModule, > ((FragmentRequirement) ex.getRequirement()).getFragment()); > repeat = true; > } > else > { > throw ex; > } > } > Felix$FelixResolver.resolve(Module) line: 4013 > Felix.resolveBundle(BundleImpl) line: 3414 > Felix.startBundle(BundleImpl, int) line: 1754 > BundleImpl.start(int) line: 905 > and this is the error which is reported to me, but this can't help me as the true missing package has been lost. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.