Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Oomph] Preferences not copied and NPE on init
[Oomph] Preferences not copied and NPE on init [message #1297285] Tue, 15 April 2014 15:01 Go to next message
Abel Hegedus is currently offline Abel HegedusFriend
Messages: 197
Registered: September 2015
Senior Member
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.

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)
Re: [Oomph] Preferences not copied and NPE on init [message #1300205 is a reply to message #1297285] Thu, 17 April 2014 12:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
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 Go to previous messageGo to next message
Abel Hegedus is currently offline Abel HegedusFriend
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 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
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/
Re: [Oomph] Preferences not copied and NPE on init [message #1300441 is a reply to message #1300394] Thu, 17 April 2014 15:23 Go to previous message
Abel Hegedus is currently offline Abel HegedusFriend
Messages: 197
Registered: September 2015
Senior Member
Thanks for your help, Ed!

I created a bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=433018

I'm happy to provide more details or testing if you need it.
Previous Topic:too big for int
Next Topic:[CDO 4.1] Not active: CDOTransactionImpl
Goto Forum:
  


Current Time: Tue Apr 16 14:34:51 GMT 2024

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

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

Back to the top