ctron / package-drone

An OSGI first software artifact repository – Moved to the Eclipse Foundation
https://github.com/eclipse/packagedrone
Eclipse Public License 1.0
39 stars 13 forks source link

p2 repo: not found #72

Closed maggu2810 closed 9 years ago

maggu2810 commented 9 years ago

I created a channel and used maven to deployed artifacts to that channel. The p2 repository aspect (all available aspects) are added to that channel. Eclipse IDE and the maven Tycho plugin does not recognize the p2 repository.

The files of the p2 site (http://.../p2/C162AF34-2CCC-421F-96A9-AF527735DDBF/) are the normal ones:

content.xml (content.jar)
artifacts.xml (artifacts.jar)
p2.index
repo.zip

The package-drone OSGi console writes that log messages

11:31:33.518 [qtp1993650935-96] WARN  de.dentrassi.pm.p2.servlet.P2Servlet - Not found for: /C162AF34-2CCC-421F-96A9-AF527735DDBF/site.xml
11:31:33.531 [qtp1993650935-111] WARN  de.dentrassi.pm.p2.servlet.P2Servlet - Not found for: /C162AF34-2CCC-421F-96A9-AF527735DDBF/compositeContent.jar
11:31:33.543 [qtp1993650935-228] WARN  de.dentrassi.pm.p2.servlet.P2Servlet - Not found for: /C162AF34-2CCC-421F-96A9-AF527735DDBF/compositeContent.xml

What can I do for further inspection?

maggu2810 commented 9 years ago

I tested a new channel and uploaded bundles using the drag and drop feature. p2 still not working After removing some bundles / content, p2 is working now.

I exported the channel twice, so I have a zip that contains the state that p2 is not working and one that contains a state p2 is working.

Would this be helpful?

ctron commented 9 years ago

This seems strange. The files you mentioned are ok to be missing. P2 just checks a whole bunch if files, which might be there, or not. site.xml is a legacy file for example.

However the presence of p2.index should limit this requesting of non-existing files.

Definitely a channel export would be helpful! If you don't want to publish is here, you can upload it to some service like Wuala and send me a link directly.

maggu2810 commented 9 years ago

You could download the exported channels here: https://drive.google.com/file/d/0Bx99QXY8p6gvZ3JJX3lMdkxUd1k/view?usp=sharing

ctron commented 9 years ago

Ok, I can reproduce the issue here importing the channel. I do recognize an exception in Eclipse when accessing the repository:

java.lang.IllegalArgumentException: comma not allowed in id
    at org.eclipse.equinox.internal.p2.metadata.ArtifactKey.<init>(ArtifactKey.java:81)
    at org.eclipse.equinox.internal.p2.metadata.repository.io.MetadataParser$ArtifactHandler.<init>(MetadataParser.java:687)
    at org.eclipse.equinox.internal.p2.metadata.repository.io.MetadataParser$ArtifactsHandler.startElement(MetadataParser.java:672)
    at org.eclipse.equinox.internal.p2.persistence.XMLParser$AbstractHandler.startElement(XMLParser.java:167)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
    at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:356)
    at 
…

So it seems there is a comma hidden somewhere ...

ctron commented 9 years ago

Ok the troublemaker is org.hibernate.entitymanager,org.hibernate.entitymanager, I will check and see if I can find out more.

ctron commented 9 years ago

Ok, this seems to be a bug coming from hibernate: https://hibernate.atlassian.net/browse/HHH-8779

ctron commented 9 years ago

But is seems there is a fix in 4.2.9 of hibernate.

ctron commented 9 years ago

So the question is, what can Package Drone do in this case?

Since this breaks P2 and seems to be an invalid value, it should be rejected in some way rather than failing silently.

ctron commented 9 years ago

So I would say this also points to #20 and Package Drone needs a validation framework in one of the next versions.

maggu2810 commented 9 years ago

Think so, too. You are right, this is not a bug of package-drone, but a bug in the BSN of the hibernate bundle. I would also vote for some validation, it would be difficult to find such errors and a bundle should not be able to break the p2 repo artifact at all. So, this issue could be closed, right?

ctron commented 9 years ago

So I close this one in the favor of #20