Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » File does not contain a valid product
File does not contain a valid product [message #1779029] Fri, 29 December 2017 09:52 Go to next message
Tony Hedoux is currently offline Tony HedouxFriend
Messages: 15
Registered: March 2014
Junior Member
Hello everyone :)

I am trying to load a product setup file with the OOMPH installer, and the error I obtain is : "File .... does not contain a valid product", without any details.

I have try to load this file with OOMPH setup editor directly, and the editor does not provide any errors or warning about its format.

I can not share the product file, because there is a lot of internal repository identified in it.

My question is : how I can obtain more details about Why it is a seen as an invalid product by the OOMPH installer?

Thx for your help!

Tony
  • Attachment: Error.png
    (Size: 10.58KB, Downloaded 22 times)


ALL4TEC
Re: File does not contain a valid product [message #1779030 is a reply to message #1779029] Fri, 29 December 2017 10:35 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29550
Registered: July 2009
Senior Member
The code that's doing the processing of the URIs looks like this:
    protected boolean processResources()
    {
      List<Product> validProducts = new ArrayList<Product>();
      List<Product> invalidProducts = new ArrayList<Product>();
      List<URI> invalidURIs = new ArrayList<URI>();
      ResourceSet resourceSet = editingDomain.getResourceSet();
      for (URI uri : getURIs())
      {
        BaseResource resource = BaseUtil.loadResourceSafely(resourceSet, uri);
        Product product = (Product)EcoreUtil.getObjectByType(resource.getContents(), SetupPackage.Literals.PRODUCT);
        if (product == null)
        {
          invalidURIs.add(uri);
        }
        else if (product.eContainer() != null)
        {
          invalidProducts.add(product);
        }
        else
        {
          validProducts.add(product);
        }
      }
Given the message you show, it's hitting "product == null" case so the file does not contain a Product. Perhaps it contains a Project? Or something else? What is the first element you see in the XML representation? It should look similar to this:
<setup:Product
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
    xmlns:setup.p2="http://www.eclipse.org/oomph/setup/p2/1.0"
    name="my.product"
    label="My Product">
Re: File does not contain a valid product [message #1779031 is a reply to message #1779030] Fri, 29 December 2017 11:33 Go to previous message
Tony Hedoux is currently offline Tony HedouxFriend
Messages: 15
Registered: March 2014
Junior Member
You are right, the XML file is starting with a Project.

I will dig a bit to find why it is the case and which difference it implies to use it.

Thanks for the quick and accurate (as always... :p ) answer Ed :)

Tony


ALL4TEC
Previous Topic:Running an arbitraty project.setup
Next Topic:Hybrid .target + targlet project
Goto Forum:
  


Current Time: Mon Sep 24 18:08:28 GMT 2018

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

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

Back to the top