Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » p2 throws a mysterious unexpected error while resolving an update operation
p2 throws a mysterious unexpected error while resolving an update operation [message #1689802] Tue, 24 March 2015 11:10 Go to next message
Thomas Elskens is currently offline Thomas ElskensFriend
Messages: 159
Registered: September 2014
Location: Brussels - Belgium
Senior Member
Hello,

When trying to implement a very basic update operation, resolving my update operation does not go well : the resulting IProvisioningPlan and ProvisioningJob are both null.

Now to find out what is happening is not that easy : when I call getResolutionDetails() on the resolved update operation, I get the following message :

Quote:

Your original request has been modified. Unexpected Error. Could not process the request. Check the error log for details.


But how to get a grip on this error log ? The only log appender I have in the application is set to the console, and there nothing appears.

Surrounding the resolve method with a try-catch catches nothing, and operation.getResolutionResult().getException() returns nothing either.

How can I figure out what is happening ?

Thomas Elskens
Re: p2 throws a mysterious unexpected error while resolving an update operation [message #1689849 is a reply to message #1689802] Tue, 24 March 2015 13:41 Go to previous messageGo to next message
Eclipse UserFriend
It's been a while since I last needed to dig into this, but if memory serves me correctly: p2 logs via the OSGi Logger, and the Equinox logger ignores all non-Eclipse messages effectively becoming a no-op logger. If you're integrating your own logging backend, then you'll need to add a LogReaderService to pump messages.

Brian.
Re: p2 throws a mysterious unexpected error while resolving an update operation [message #1690110 is a reply to message #1689849] Wed, 25 March 2015 10:41 Go to previous messageGo to next message
Thomas Elskens is currently offline Thomas ElskensFriend
Messages: 159
Registered: September 2014
Location: Brussels - Belgium
Senior Member
So I've registered a LogListener who redirects all OSGI log entry to my LOG4j logger, prefixed with "Eclipse message", as follows :

@Component(name="EquinoxLogListener", immediate=true)
public class EquinoxLogListenerImpl implements LogListener 
{
	private Logger logger ;

	@Override
	public void logged(LogEntry entry) 
	{
		
		if (entry.getException() != null)
		{
			logger.error(String.format("Eclipse ERROR : %s", entry.getMessage()), entry.getException());
		}
		else
		{
			logger.debug(String.format("Eclipse message : %s", entry.getMessage()));
		}
	}

       @Reference(cardinality=ReferenceCardinality.AT_LEAST_ONE, policy=ReferencePolicy.DYNAMIC)
	public void registerLogReader(LogReaderService logReader)
	{
		logReader.addLogListener(this);
	}
	
	public void unregisterLogReader(LogReaderService logReader) 
	{
		logReader.removeLogListener(this);
	}
//...
}


But the result is merely a long list of Bundle and Service events. The P2 message is not captured :
Quote:

...
DEBUG - Eclipse message : BundleEvent STARTED
DEBUG - Eclipse message : BundleEvent STARTED
DEBUG - Eclipse message : BundleEvent STARTED
DEBUG - Eclipse message : BundleEvent STARTED
DEBUG - Eclipse message : BundleEvent STARTED
DEBUG - updateOperation resolved with details : Your original request has been modified.
Unexpected Error. Could not process the request. Check the error log for details.
DEBUG - updateOperation resolved with status : Unexpected Error. Could not process the request. Check the error log for details.
DEBUG - Error (if any) :
ERROR - Provisioningplan null
INFO - Operation resolved with status : Your original request has been modified.
DEBUG - Eclipse message : ServiceEvent REGISTERED
DEBUG - Eclipse message : ServiceEvent REGISTERED
DEBUG - Eclipse message : BundleEvent STARTED
DEBUG - Eclipse message : BundleEvent STARTED
...


Something I missed ... ?

Thomas Elskens
Re: p2 throws a mysterious unexpected error while resolving an update operation [message #1690168 is a reply to message #1690110] Wed, 25 March 2015 14:36 Go to previous message
Eclipse UserFriend
Hmm, weird. It's likely easier to install the p2 SDK and poke around the source. I think most of the code funnels log messages down into a class called LogHelper. That particular error message, keyed as PlannerResolutionJob_NullProvisioningPlan, is used in a class called org.eclipse.equinox.internal.p2.operations.PlannerResolutionJob in org.eclipse.equinox.p2.operations. It looks to happen when a plan cannot be determined, though I don't see how the result is logged. Try poking around.

Brian.
Previous Topic:force update of existing feature when installing new feature
Next Topic:Buckminster for plug-in update sites
Goto Forum:
  


Current Time: Tue Mar 19 03:06:02 GMT 2024

Powered by FUDForum. Page generated in 0.02161 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top