Bug 487713 - FileNotFoundException: introData.xml
Summary: FileNotFoundException: introData.xml
Status: NEW
Alias: None
Product: EPP
Classification: Technology
Component: java-package (show other bugs)
Version: 4.5.2   Edit
Hardware: PC Mac OS X
: P3 minor (vote)
Target Milestone: later   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 479791 493117 (view as bug list)
Depends on:
Blocks: 522190
  Show dependency tree
 
Reported: 2016-02-12 04:52 EST by Andreas Sewe CLA
Modified: 2020-06-03 07:27 EDT (History)
12 users (show)

See Also:


Attachments
stack trace of the reproduced bug. (18.88 KB, text/plain)
2016-05-06 11:06 EDT, Patrik Suzzi CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Sewe CLA 2016-02-12 04:52:12 EST
To reproduce (using Mars.2 RC3):

- Start with a fresh workspace
- On the Welcome screen, click the "Customize page" icon.
- A FileNotFoundException is reported in the Error Log (and through AERI).
- AFAICT, page custumization works, however.

java.io.FileNotFoundException: /Volumes/ramdisk/Eclipse.app/Contents/MacOS/introData.xml (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:131)
	at java.io.FileInputStream.<init>(FileInputStream.java:87)
	at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
	at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:616)
	at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:189)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:812)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:348)
	at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:177)
	at org.eclipse.ui.internal.intro.universal.IntroData.parse(IntroData.java:159)
	at org.eclipse.ui.internal.intro.universal.IntroData.initialize(IntroData.java:63)
	at org.eclipse.ui.internal.intro.universal.IntroData.<init>(IntroData.java:47)
	at org.eclipse.ui.internal.intro.universal.CustomizationContentsArea.loadData(CustomizationContentsArea.java:630)
	at org.eclipse.ui.internal.intro.universal.CustomizationContentsArea.addPages(CustomizationContentsArea.java:495)
	at org.eclipse.ui.internal.intro.universal.CustomizationContentsArea.createContents(CustomizationContentsArea.java:459)
	at org.eclipse.ui.internal.intro.universal.CustomizationDialog.createDialogArea(CustomizationDialog.java:44)
	at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:768)
	at org.eclipse.jface.window.Window.create(Window.java:430)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1096)
	at org.eclipse.jface.window.Window.open(Window.java:792)
	at org.eclipse.ui.internal.intro.universal.CustomizeAction.run(CustomizeAction.java:35)
	at org.eclipse.ui.internal.intro.universal.CustomizeAction.run(CustomizeAction.java:29)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:462)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4230)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1491)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1514)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1499)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1299)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4072)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3698)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:694)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:606)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
Comment 1 Oliver Goetz CLA 2016-02-12 05:02:17 EST
I am not able to reproduce it using:

Eclipse for Testers
Version: Mars.2 Release (4.5.2RC3)
Build id: 20160210-2154
Windows 8.1
Comment 2 Andreas Sewe CLA 2016-02-12 05:06:35 EST
(In reply to Oliver Goetz from comment #1)
> I am not able to reproduce it using:
> 
> Eclipse for Testers
> Version: Mars.2 Release (4.5.2RC3)
> Build id: 20160210-2154
> Windows 8.1

Thanks, Oliver.

I suspect this is an OS X issue.

What does "find . -name introData.xml" (or the Windows equivalent) return for you?

On OS X it's

  ./Eclipse.app/Contents/Eclipse/plugins/org.eclipse.platform_4.5.2.v20160203-1000/introData.xml

which is not where the code is looking:

  ./Eclipse.app/Contents/MacOS/introData.xml
Comment 3 Markus Knauer CLA 2016-02-12 05:18:43 EST
I can reproduce it on Linux... and after digging a bit into it, I would say that this is a old error that affects nearly all packages.

The root cause is that there is a reference in the product's plugin_customization.ini file to a introData.xml file that isn't available in most packages. I'm going to copy a standard file to the packages where it is missing - should be fixable for RC4 next week.
Comment 4 Markus Knauer CLA 2016-02-17 11:35:35 EST
After looking into this issue it seems a bit more work than just adding the same file to the packages... and as far as I can see the problem itself is not harmful, and moreover, it has been like that all the time...

The location of the file is defined as

  org.eclipse.ui.intro.universal/INTRO_DATA = product:introData.xml

and with that it is supposed to be located in the branding plug-in directory of the product. Unfortunately not all of the packages include this file, in fact, most of them never did, so I don't think we can call this a regression.

The problem that I see in Mars.2 RC4 week is that every package needs to define and to assemble its own introData.xml file based on its content, and that it is really late for doing, coordinating, and testing such a change. And if it is not a file specific to the package, it doesn't really help. I would like to move this to the list of issues that needs to be fixed for Neon.
Comment 5 Andreas Sewe CLA 2016-02-17 11:38:26 EST
(In reply to Markus Knauer from comment #4)
> I
> would like to move this to the list of issues that needs to be fixed for
> Neon.

Fair enough. As I said, it didn't notice any buggy behavior (aside from the error messages), so this is not a big issue from the users' perspective.
Comment 6 Laurent Goubet CLA 2016-03-18 06:16:29 EDT
*** Bug 479791 has been marked as a duplicate of this bug. ***
Comment 7 Andreas Sewe CLA 2016-05-06 08:27:46 EDT
(In reply to Markus Knauer from comment #4)
> I
> would like to move this to the list of issues that needs to be fixed for
> Neon.

Markus, since Ed Merks just posted about this (and other issues) on cross-project-issues, I think we should revisit this.

As you did the initial analysis, can you maybe prepare a fix for one of the EPP packages and then the other packages' maintainers could use that as inspiration to do the fix for their package (as comment 4 suggests that the fix is package-specific)? I certainly would be willing to do the (follow-up) work for the Java package.
Comment 8 Ed Merks CLA 2016-05-06 10:47:41 EDT
We should also keep in mind that if this file should exist, then the p2 director (and hence Oomph) should create it, otherwise the installer will create installations with this error.
Comment 9 Patrik Suzzi CLA 2016-05-06 10:49:16 EDT
*** Bug 493117 has been marked as a duplicate of this bug. ***
Comment 10 Patrik Suzzi CLA 2016-05-06 11:06:40 EDT
Created attachment 261516 [details]
stack  trace of the reproduced bug.

Reproducible in Neon Milestone 7 (4.6.0M7)
Build id: 20160505-1310

Steps to reproduce: 
1. download eclipse for DSL from the link at [#1]
2. launch eclipse, show the "Error Log" View

Possible cause: new File(introData.xml) without a relative path defined would start the search from the base location of the Java executable. 

[#1] - https://www.eclipse.org/downloads/index-developer.php
Comment 11 Ed Merks CLA 2016-05-07 05:06:25 EDT
It seems pretty clear to me that this is a regression introduced by the changes for https://bugs.eclipse.org/bugs/show_bug.cgi?id=491556.

In particular, this method:

	private void loadData() {
		// load the active product's intro data first
		IProduct product = Platform.getProduct();
		if (product != null) {
			String dataFile = getVariable(VAR_INTRO_DATA);
			if (dataFile != null) {
				primaryIntroData = new IntroData(product.getId(), dataFile, true);
			}
		}

is guarded to check if dataFile != null) but the variable lookup/resolution mechanism ends up in 

	private String resolveFile(Bundle bundle, String path) {
		String prefixedPath = getThemePrefixedPath(path);
		try {
			URL url = null;
			if (prefixedPath != null) {
				url = bundle.getEntry(prefixedPath);
			}
			if (url == null) {
				url = bundle.getEntry(path);
			}
			if (url != null) {
				URL localURL = FileLocator.toFileURL(url);
				return localURL.toString();
			}
		} catch (IOException e) {
		}
		// just use the value as-is
		return path;
	}

which never returns null.  I believe this method should return null if the file/entry does not exist in the product bundle.

It's hard for me to test such a change, but stepping through a remote debug session I can see that this is exactly where this bogus relative path comes from.  

The previous revision has this method to resolve a variable. 

	private String resolveVariable(Bundle bundle, String value) {
		if (value != null) {
			String path = null;
			if (value.startsWith("intro:")) { //$NON-NLS-1$
				bundle = UniversalIntroPlugin.getDefault().getBundle();
				path = value.substring(6);
			} else if (value.startsWith("product:")) { //$NON-NLS-1$
				path = value.substring(8);
			} else
				return value;
			try {
				URL url = bundle.getEntry(path);
				if (url != null) {
					URL localURL = FileLocator.toFileURL(url);
					return localURL.toString();
				}
			} catch (IOException e) {
				// just use the value as-is
				return value;
			}
		}
		return null;
	}

Here we can see that if the bundle doesn't have an entry for the value, the final return null is reached.

I'm not sure how the problem was reproducible in Mars, except perhaps if the file locator threw an exception; I don't think that case should return null as well.
Comment 12 Brian de Alwis CLA 2016-05-07 22:50:09 EDT
(In reply to Ed Merks from comment #11)
> It seems pretty clear to me that this is a regression introduced by the
> changes for https://bugs.eclipse.org/bugs/show_bug.cgi?id=491556.
[…]
> which never returns null.  I believe this method should return null if the
> file/entry does not exist in the product bundle.

You're right.  I'll put the fix against bug 491556 as the bug is not actually the cause of the problem described in the particular bug.
Comment 13 Alexander Kurtakov CLA 2020-06-03 07:27:02 EDT
Still here on 2020-06