|
Re: [Oomph] Preferences not copied and NPE on init [message #1300205 is a reply to message #1297285] |
Thu, 17 April 2014 12:03 |
Ed Merks Messages: 33252 Registered: July 2009 |
Senior Member |
|
|
Abel,
Eike has been heads-down working on the new version that will be its own
project...
On 15/04/2014 5:01 PM, Abel Hegedus wrote:
> Hi,
>
> I have tried the newest version of the Oomph installer, as it looks
> like a very useful tool for us as well. I tried to set it up for
> Authoring based on this: https://wiki.eclipse.org/Eclipse_Oomph_Authoring
>
> However, at the end of the Installing Development Environment step, it
> says it cannot copy a non-existent settings file ...net.prefs from the
> .metadata folder of the installer.
Yes, there's code that copied network preferences... If one needs to
set a proxy server to access outside a firewall, that needs to be done
already in the installer and the installed IDE will need those same
settings. The code should be more careful to check that the folder
really exists. I assume it's this code here:
PreferenceNode configurationPreferences =
PreferencesUtil.getRootPreferenceNode().getNode("configuration");
if (configurationPreferences != null)
{
PreferenceNode networkPreferences =
configurationPreferences.getNode("org.eclipse.core.net");
if (networkPreferences != null)
{
ResourceCopyTask resourceCopyTask =
SetupFactory.eINSTANCE.createResourceCopyTask();
URI sourceLocation =
URI.createFileURI(networkPreferences.getLocation());
resourceCopyTask.setSourceURL(sourceLocation.toString());
int segmentCount = sourceLocation.segmentCount();
URI targetURI = URI.createFileURI(new File(getEclipseDir(),
"configuration").toString()).appendSegment(sourceLocation.segment(segmentCount
- 2))
.appendSegment(sourceLocation.segment(segmentCount - 1));
resourceCopyTask.setTargetURL(targetURI.toString());
if (resourceCopyTask.isNeeded(this))
{
resourceCopyTask.perform(this);
}
}
>
> When the new IDE starts, it also throws an NPE when it cannot load
> preferences. As a result, it cannot perform the setup steps.
>
> I know that the project is in the proposal phase, but maybe you have
> some suggestions for a workaround (e.g. manually creating the prefs
> file)? I can also create a BugZilla if that's better.
>
> !ENTRY org.eclipse.emf.cdo.releng.setup 4 0 2014-04-15 14:24:56.333
> !MESSAGE java.lang.NullPointerException
> !STACK 0 java.lang.NullPointerException at
> org.eclipse.emf.cdo.releng.internal.setup.SetupTaskPerformer.resolveSettings(SetupTaskPerformer.java:631)
> at
> org.eclipse.emf.cdo.releng.internal.setup.SetupTaskPerformer.initNeededSetupTasks(SetupTaskPerformer.java:311)
> at
> org.eclipse.emf.cdo.releng.internal.setup.SetupTaskPerformer.performTriggeredSetupTasks(SetupTaskPerformer.java:817)
> at
> org.eclipse.emf.cdo.releng.internal.setup.SetupTaskPerformer.perform(SetupTaskPerformer.java:751)
> at
> org.eclipse.emf.cdo.releng.internal.setup.Activator$1.run(Activator.java:127)
It sounds like something is wrong with the preference file that it fails
to load properly. Perhaps try deleting
<user.home>\.eclipse\org.eclipse.emf.cdo.releng.setup\setup-eclipse.xmi
and letting the installer create a new one...
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: [Oomph] Preferences not copied and NPE on init [message #1300338 is a reply to message #1300205] |
Thu, 17 April 2014 14:00 |
Abel Hegedus Messages: 197 Registered: September 2015 |
Senior Member |
|
|
Ed Merks wrote on Thu, 17 April 2014 08:03
The code should be more careful to check that the folder
really exists.
Yes, after creating an empty file with the correct name, the installer copies it happily.
Ed Merks wrote on Thu, 17 April 2014 08:03
It sounds like something is wrong with the preference file that it fails
to load properly. Perhaps try deleting
<user.home>\.eclipse\org.eclipse.emf.cdo.releng.setup\setup-eclipse.xmi
and letting the installer create a new one...
If I get this right, this is unrelated to the failed copy of the other file. The preferences field is filled from the "originalSetup" in AbstractSetupTaskContext.initilaize(), and I guess that original is supposed to be the file you mentioned. I tried deleting it, but it still fails.
The contents of the above file is:
<?xml version="1.0" encoding="ASCII"?>
<setup:Preferences setup:toolVersion="8" xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:setup="http://www.eclipse.org/CDO/releng/setup/1.0" installFolder="[...]\Oomph"/>
Unfortunately, I use Windows 8 and my user directory has accents (which I cannot change), could this be the problem? Is there a way to copy this file somewhere else and have it load from there?
|
|
|
Re: [Oomph] Preferences not copied and NPE on init [message #1300394 is a reply to message #1300338] |
Thu, 17 April 2014 14:43 |
Ed Merks Messages: 33252 Registered: July 2009 |
Senior Member |
|
|
Abel,
Accents! I see that the resource factory doesn't set set UTF-8 as the
default encoding so ASCII is used. It really should default to UTF-8.
Does the file contain non-ASCII characters? If you change it manually,
I think that setting should be respected from then on, but we write
other resources too, and any one of them could have this problem. In
particular the setup.xmi has a reference to the preferences, so you'd
have to change that manually too and start the IDE again.
Please open a bugzilla. Eike could fix that in the old code and
definitely it needs to be fixed in the new code...
On 17/04/2014 4:00 PM, Abel Hegedus wrote:
> Ed Merks wrote on Thu, 17 April 2014 08:03
>> The code should be more careful to check that the folder really exists.
>
>
> Yes, after creating an empty file with the correct name, the installer
> copies it happily.
>
> Ed Merks wrote on Thu, 17 April 2014 08:03
>> It sounds like something is wrong with the preference file that it
>> fails to load properly. Perhaps try deleting
>> <user.home>\.eclipse\org.eclipse.emf.cdo.releng.setup\setup-eclipse.xmi
>> and letting the installer create a new one...
>
>
> If I get this right, this is unrelated to the failed copy of the other
> file. The preferences field is filled from the "originalSetup" in
> AbstractSetupTaskContext.initilaize(), and I guess that original is
> supposed to be the file you mentioned. I tried deleting it, but it
> still fails.
>
> The contents of the above file is:
>
> <?xml version="1.0" encoding="ASCII"?>
> <setup:Preferences setup:toolVersion="8" xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:setup="http://www.eclipse.org/CDO/releng/setup/1.0"
> installFolder="[...]\Oomph"/>
>
>
> Unfortunately, I use Windows 8 and my user directory has accents
> (which I cannot change), could this be the problem? Is there a way to
> copy this file somewhere else and have it load from there?
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03952 seconds