Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359787

Summary: NullPointerException, seemingly related to proxy settings
Product: z_Archived Reporter: Francisco Camenforte Torres <fmcato>
Component: TychoAssignee: Jan Sievers <jan.sievers>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: brindy, fukanchik, jan.sievers, julien.henry, mechko, t-oberlies, thibaut.robert
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
maven log output none

Description Francisco Camenforte Torres CLA 2011-10-04 02:13:48 EDT
Hello,

we are facing a problem when building a plugin using Jenkins on a Linux server.

We are using maven 3.0.3 and tycho 0.13.0.

We have checked that the settings.xml is correct. Actually, the same
setup worked in another server.

This is the relevant section for proxies in settings.xml, with some
data obscured because of company privacy:

<proxy>
                       <id/>
                       <active>true</active>
                       <protocol>http</protocol>
                       <username>***</username>
                       <password>***</password>
                       <host>***</host>
                       <port>8080</port>
                       <nonProxyHosts>***|***</nonProxyHosts>
               </proxy>
The stack trace is below.

Thanks in advance.

Greets,
Francisco.


[WARNING] No explicit target runtime environment configuration. Build
is platform dependent.
java.lang.NullPointerException
       at org.eclipse.core.internal.net.StringUtil.split(StringUtil.java:33)
       at org.eclipse.core.internal.net.ProxyType.convertPropertyStringToHosts(ProxyType.java:102)
       at org.eclipse.core.internal.net.ProxyManager.getNonProxiedHosts(ProxyManager.java:118)
       at org.eclipse.core.internal.net.ProxyManager.doSetProxyData(ProxyManager.java:188)
       at org.eclipse.core.internal.net.ProxyManager.setProxyData(ProxyManager.java:183)
       at org.eclipse.tycho.p2.impl.proxy.ProxyServiceFacadeImpl.configureProxy(ProxyServiceFacadeImpl.java:44)
       at org.eclipse.tycho.p2.facade.internal.P2ProxyConfigurator.afterFrameworkStarted(P2ProxyConfigurator.java:53)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxEmbedder.doStart(DefaultEquinoxEmbedder.java:144)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxEmbedder.start(DefaultEquinoxEmbedder.java:55)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxEmbedder.getService(DefaultEquinoxEmbedder.java:189)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxEmbedder.getService(DefaultEquinoxEmbedder.java:184)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxServiceLocator.getService(DefaultEquinoxServiceLocator.java:23)
       at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.initialize(P2TargetPlatformResolver.java:440)
       at org.codehaus.plexus.PlexusLifecycleManager.initialize(PlexusLifecycleManager.java:285)
       at org.codehaus.plexus.PlexusLifecycleManager.manageLifecycle(PlexusLifecycleManager.java:247)
       at org.codehaus.plexus.PlexusLifecycleManager.manage(PlexusLifecycleManager.java:154)
       at org.sonatype.guice.plexus.binders.PlexusBeanBinder.afterInjection(PlexusBeanBinder.java:78)
       at com.google.inject.internal.MembersInjectorImpl.notifyListeners(MembersInjectorImpl.java:97)
       at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:95)
       at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
       at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
       at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1021)
       at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
       at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1003)
       at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:47)
       at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
       at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
       at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1014)
       at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
       at com.google.inject.Scopes$1$1.get(Scopes.java:59)
       at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:79)
       at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:53)
       at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:243)
       at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:235)
       at org.eclipse.tycho.core.resolver.DefaultTargetPlatformResolverFactory.lookupPlatformResolver(DefaultTargetPlatformResolverFactory.java:74)
       at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.setupProject(DefaultTychoDependencyResolver.java:71)
       at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:85)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:273)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
       at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
       at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
       at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
       at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
       at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[WARNING] Error initializing: class
org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver
java.lang.RuntimeException: java.lang.RuntimeException:
java.lang.NullPointerException
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxEmbedder.getService(DefaultEquinoxEmbedder.java:191)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxEmbedder.getService(DefaultEquinoxEmbedder.java:184)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxServiceLocator.getService(DefaultEquinoxServiceLocator.java:23)
       at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.initialize(P2TargetPlatformResolver.java:440)
       at org.codehaus.plexus.PlexusLifecycleManager.initialize(PlexusLifecycleManager.java:285)
       at org.codehaus.plexus.PlexusLifecycleManager.manageLifecycle(PlexusLifecycleManager.java:247)
       at org.codehaus.plexus.PlexusLifecycleManager.manage(PlexusLifecycleManager.java:154)
       at org.sonatype.guice.plexus.binders.PlexusBeanBinder.afterInjection(PlexusBeanBinder.java:78)
       at com.google.inject.internal.MembersInjectorImpl.notifyListeners(MembersInjectorImpl.java:97)
       at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:95)
       at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
       at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
       at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1021)
       at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
       at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1003)
       at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:47)
       at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
       at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
       at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1014)
       at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
       at com.google.inject.Scopes$1$1.get(Scopes.java:59)
       at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:79)
       at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:53)
       at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:243)
       at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:235)
       at org.eclipse.tycho.core.resolver.DefaultTargetPlatformResolverFactory.lookupPlatformResolver(DefaultTargetPlatformResolverFactory.java:74)
       at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.setupProject(DefaultTychoDependencyResolver.java:71)
       at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:85)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:273)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
       at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
       at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
       at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
       at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
       at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
       at org.eclipse.tycho.p2.impl.proxy.ProxyServiceFacadeImpl.configureProxy(ProxyServiceFacadeImpl.java:56)
       at org.eclipse.tycho.p2.facade.internal.P2ProxyConfigurator.afterFrameworkStarted(P2ProxyConfigurator.java:53)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxEmbedder.doStart(DefaultEquinoxEmbedder.java:144)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxEmbedder.start(DefaultEquinoxEmbedder.java:55)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxEmbedder.getService(DefaultEquinoxEmbedder.java:189)
       ... 40 more
Caused by: java.lang.NullPointerException
       at org.eclipse.core.internal.net.StringUtil.split(StringUtil.java:33)
       at org.eclipse.core.internal.net.ProxyType.convertPropertyStringToHosts(ProxyType.java:102)
       at org.eclipse.core.internal.net.ProxyManager.getNonProxiedHosts(ProxyManager.java:118)
       at org.eclipse.core.internal.net.ProxyManager.doSetProxyData(ProxyManager.java:188)
       at org.eclipse.core.internal.net.ProxyManager.setProxyData(ProxyManager.java:183)
       at org.eclipse.tycho.p2.impl.proxy.ProxyServiceFacadeImpl.configureProxy(ProxyServiceFacadeImpl.java:44)
       ... 44 more
Oct 3, 2011 2:34:11 PM org.sonatype.guice.bean.reflect.NamedClass
WARNING: Error injecting: org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver
com.google.inject.ProvisionException: Guice provision errors:

1) Error notifying InjectionListener
org.sonatype.guice.plexus.binders.PlexusBeanBinder@a34b91 of
org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.
 Reason: java.lang.RuntimeException: java.lang.RuntimeException:
java.lang.NullPointerException
 while locating org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver

1 error
       at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:977)
       at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1003)
       at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:47)
       at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
       at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
       at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1014)
       at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
       at com.google.inject.Scopes$1$1.get(Scopes.java:59)
       at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:79)
       at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:53)
       at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:243)
       at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:235)
       at org.eclipse.tycho.core.resolver.DefaultTargetPlatformResolverFactory.lookupPlatformResolver(DefaultTargetPlatformResolverFactory.java:74)
       at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.setupProject(DefaultTychoDependencyResolver.java:71)
       at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:85)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:273)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
       at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
       at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
       at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
       at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
       at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException:
java.lang.NullPointerException
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxEmbedder.getService(DefaultEquinoxEmbedder.java:191)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxEmbedder.getService(DefaultEquinoxEmbedder.java:184)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxServiceLocator.getService(DefaultEquinoxServiceLocator.java:23)
       at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.initialize(P2TargetPlatformResolver.java:440)
       at org.codehaus.plexus.PlexusLifecycleManager.initialize(PlexusLifecycleManager.java:285)
       at org.codehaus.plexus.PlexusLifecycleManager.manageLifecycle(PlexusLifecycleManager.java:247)
       at org.codehaus.plexus.PlexusLifecycleManager.manage(PlexusLifecycleManager.java:154)
       at org.sonatype.guice.plexus.binders.PlexusBeanBinder.afterInjection(PlexusBeanBinder.java:78)
       at com.google.inject.internal.MembersInjectorImpl.notifyListeners(MembersInjectorImpl.java:97)
       at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:95)
       at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
       at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
       at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1021)
       at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
       ... 27 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
       at org.eclipse.tycho.p2.impl.proxy.ProxyServiceFacadeImpl.configureProxy(ProxyServiceFacadeImpl.java:56)
       at org.eclipse.tycho.p2.facade.internal.P2ProxyConfigurator.afterFrameworkStarted(P2ProxyConfigurator.java:53)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxEmbedder.doStart(DefaultEquinoxEmbedder.java:144)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxEmbedder.start(DefaultEquinoxEmbedder.java:55)
       at org.eclipse.tycho.equinox.embedder.DefaultEquinoxEmbedder.getService(DefaultEquinoxEmbedder.java:189)
       ... 40 more
Caused by: java.lang.NullPointerException
       at org.eclipse.core.internal.net.StringUtil.split(StringUtil.java:33)
       at org.eclipse.core.internal.net.ProxyType.convertPropertyStringToHosts(ProxyType.java:102)
       at org.eclipse.core.internal.net.ProxyManager.getNonProxiedHosts(ProxyManager.java:118)
       at org.eclipse.core.internal.net.ProxyManager.doSetProxyData(ProxyManager.java:188)
       at org.eclipse.core.internal.net.ProxyManager.setProxyData(ProxyManager.java:183)
       at org.eclipse.tycho.p2.impl.proxy.ProxyServiceFacadeImpl.configureProxy(ProxyServiceFacadeImpl.java:44)
       ... 44 more
Comment 1 Julien HENRY CLA 2011-10-04 04:08:06 EDT
I confirm this NPE. I was using comma to separate nonProxyHosts but I switched to pipe and still I have the bug.
But it seems to be a random issue. On a tycho project, doing run as -> maven install can trigger the NPE while immediatly restarting it again will not.
Comment 2 Jan Sievers CLA 2011-10-04 08:18:39 EDT
(In reply to comment #1)
> I confirm this NPE. I was using comma to separate nonProxyHosts but I switched
> to pipe and still I have the bug.
> But it seems to be a random issue. On a tycho project, doing run as -> maven
> install can trigger the NPE while immediatly restarting it again will not.

looks like this can happen in ProxyManager when there were previously no non-proxy-hosts configured (null value in preference store) because before setting the new value it will check the old value and fire change events only for changed values.

If you can reproduce the issue, please attach maven debug log (mvn -X -e) and the file ~/.m2/repository/org/eclipse/tycho/tycho-p2-runtime/eclipse/configuration/settings/org.eclipse.core.net.prefs (both before the NPE happens and after)

Does this bug also happen with tycho 0.12.0 ?

note to self: the version of the org.eclipse.core.net bundle is unchanged in eclipse 3.7 vs 3.8M1: 1.2.100.I20110511-0800
Comment 3 Julien HENRY CLA 2011-10-04 08:52:37 EDT
First run of mvn clean OK:

Content of tycho-p2-runtime/**/org.eclipse.core.net.prefs:
#Tue Oct 04 14:29:25 CEST 2011
proxyData/HTTP/hasAuth=true
systemProxiesEnabled=false
proxyData/HTTP/host=proxy.mycompany.fr
eclipse.preferences.version=1
proxyData/HTTP/port=3128
nonProxiedHosts=localhost|*.mycompany.fr


Second run of mvn clean KO. File tycho-p2-runtime/**/org.eclipse.core.net.prefs is deleted.

Stack trace is the one provided by Francisco.
Comment 4 Francisco Camenforte Torres CLA 2011-10-04 09:03:20 EDT
Created attachment 204507 [details]
maven log output

I attach the output of the -X -e command.

Funnily enough, we can't find the .prefs file anywhere.
Comment 5 Francisco Camenforte Torres CLA 2011-10-04 10:53:55 EDT
(In reply to comment #4)
> Created attachment 204507 [details]
> maven log output
> 
> I attach the output of the -X -e command.
> 
> Funnily enough, we can't find the .prefs file anywhere.

Well, obviously we can't find that one *in the server*. This is the one for 0.13.0 on a workstation where it works (eclipse helios).
Path is:
C:\Documents and Settings\**********\.m2\repository\org\eclipse\tycho\tycho-p2-runtime\0.13.0\eclipse\configuration\.settings

==================================================
#Tue Oct 04 13:35:55 CEST 2011
proxyData/HTTP/hasAuth=true
systemProxiesEnabled=false
proxyData/HTTP/host=***********
eclipse.preferences.version=1
proxyData/HTTP/port=8080
nonProxiedHosts=***********|***********
==================================================

And for 0.12.0 in that same workstation (also working):
C:\Documents and Settings\**********\.m2\repository\org\eclipse\tycho\tycho-p2-runtime\0.12.0\eclipse\configuration\.settings

==================================================
#Tue Oct 04 14:51:28 CEST 2011
proxyData/HTTP/hasAuth=true
systemProxiesEnabled=false
proxyData/HTTP/host=***********
eclipse.preferences.version=1
proxyData/HTTP/port=8080
nonProxiedHosts=***********|***********
==================================================

We are going to check building on the server using 0.12.0.
Comment 6 Francisco Camenforte Torres CLA 2011-10-04 11:22:09 EDT
Rebuilding with 0.12.0 we get this error on the server, after the p2 dependencies have been downloaded:

[INFO] Adding repository http://m2eclipse.sonatype.org/sites/m2e
[INFO] Adding repository http://m2eclipse.sonatype.org/sites/m2e
[ERROR] Internal error: java.lang.NullPointerException -> [Help 1] org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by: java.lang.NullPointerException at org.eclipse.tycho.core.osgitools.EquinoxResolver.assertResolved(EquinoxResolver.java:222) at org.eclipse.tycho.core.osgitools.EquinoxResolver.newResolvedState(EquinoxResolver.java:65) at org.eclipse.tycho.core.osgitools.OsgiBundleProject.getResolverState(OsgiBundleProject.java:204) at org.eclipse.tycho.core.osgitools.OsgiBundleProject.resolve(OsgiBundleProject.java:150) at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolveProject(DefaultTychoDependencyResolver.java:101) at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:91) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:273) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) ... 11 more [ERROR] [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException
Comment 7 Francisco Camenforte Torres CLA 2011-10-05 07:09:09 EDT
FYI, my problem with 0.12.0 seems to be this solved bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=340852
Comment 8 Thibaut Robert CLA 2011-10-06 09:24:38 EDT
Hi,

I face the same problem. It is 100% reproducible here.
I tried to create the file org.eclipse.core.net.prefs by hand, but it get deleted each time (probably by the mvn clean)

Do you have any workaround ?

Regards,
Thibaut
Comment 9 Thibaut Robert CLA 2011-10-07 05:48:35 EDT
I did some investigation : The problem is linked to the ordering of the osgi bundles loading.

On my workstation (where the build works), org.eclipse.equinox.registry is started before org.eclipse.equinox.preferences.
On my linux server (where the build fails), it is in the reverse order.

When preferences is started first, the default settings for the network (including NonProxiedHosts) are not applied, because it needs the registry to be up. This is what is triggering the bug.

I tried to find a way to force the loading of registry bundle before the others, but did not succeed. The bundles order is actually defined by the order the os lists the file in the directory ~/.m2/repository/org/eclipse/tycho/tycho-p2-runtime/0.13.0/eclipse/plugins
(That explains why the bug randomly occurs on some machines)

Hope it helps,
Thibaut
Comment 10 Francisco Camenforte Torres CLA 2011-10-07 06:24:48 EDT
After reading the comment by Thibaut, I've checked the directory and found logs.

Here I've checked the last entry and there's a message which was generated when I used "-Dhttp.nonProxyHosts=****" parameter to try to solve the issue.

So it's clear it's trying to get it from preferences after discarding system settings:

!SESSION 2011-10-03 14:11:14.588 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_21
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments:  -eclipse.keyring /tmp/tycho2569122498273171185secure_storage
Command-line arguments:  -eclipse.keyring /tmp/tycho2569122498273171185secure_storage

!ENTRY org.eclipse.core.net 1 0 2011-10-03 14:11:14.588
!MESSAGE System property http.nonProxyHosts has been set to ******** by an external source. This value will be overwritten using the values from the preferences
Comment 11 Thibaut Robert CLA 2011-10-07 09:04:11 EDT
I finally found a workaround! Quite awful, but helpful until the bug is resolved:
In directory : ~/.m2/repository/org/eclipse/tycho/tycho-p2-runtime/0.13.0/eclipse/plugins

$ touch org.eclipse.equinox.preferences@5_x
$ touch org.eclipse.core.net@5_x

This will make these bundles to start after all others. Not sure about this has no other bad consequences, but it works for me !!
Comment 12 Francisco Camenforte Torres CLA 2011-10-10 05:06:17 EDT
(In reply to comment #11)
> I finally found a workaround! Quite awful, but helpful until the bug is
> resolved:
> In directory :
> ~/.m2/repository/org/eclipse/tycho/tycho-p2-runtime/0.13.0/eclipse/plugins
> 
> $ touch org.eclipse.equinox.preferences@5_x
> $ touch org.eclipse.core.net@5_x
> 
> This will make these bundles to start after all others. Not sure about this has
> no other bad consequences, but it works for me !!

I can confirm this works in our case.
Comment 13 Jan Sievers CLA 2011-10-10 12:11:18 EDT
(In reply to comment #9)
> I did some investigation : The problem is linked to the ordering of the osgi
> bundles loading.
> 
> On my workstation (where the build works), org.eclipse.equinox.registry is
> started before org.eclipse.equinox.preferences.
> On my linux server (where the build fails), it is in the reverse order.
> 
> When preferences is started first, the default settings for the network
> (including NonProxiedHosts) are not applied, because it needs the registry to
> be up. This is what is triggering the bug.

thanks a lot for your analysis. With your hint I was able to reproduce the problem by forcing the order of Bundle.start() invocations to 

1. org.eclipse.equinox.preferences
2. org.eclipse.core.net
3. org.eclipse.equinox.registry
4. rest of the bundles

in the bundle loop in [1].
the dependency of the prefs bundle to the registry bundle is optional only

Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.2.0,4.0.
 0)",org.eclipse.equinox.registry;bundle-version="[3.2.0,4.0.0)";resol
 ution:=optional

and it seems the way we start bundles (in arbitrary order) in the embedded equinox does not take optional dependencies into account even if they are present.

I will investigate further.

[1] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-equinox/src/main/java/org/eclipse/tycho/equinox/embedder/DefaultEquinoxEmbedder.java#n135
Comment 14 Thibaut Robert CLA 2011-10-10 12:39:18 EDT
(In reply to comment #13)
> it seems the way we start bundles (in arbitrary order) in the embedded
> equinox does not take optional dependencies into account even if they are
> present.
> 
> I will investigate further.
> 
> [1]
> http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-equinox/src/main/java/org/eclipse/tycho/equinox/embedder/DefaultEquinoxEmbedder.java#n135

There is probably an issue with the management of optional dependencies in tycho/equinox (my OSGI knowledge is too limited to judge).

However, I am wondering whether it the org.eclipse.core.net should be corrected to handle this null case (After all, the regisitry dependency is optional, it should work without it...)
Comment 15 Tobias Oberlies CLA 2011-10-13 03:50:58 EDT
I have implemented a fix based on the analysis of Jan and others: Tycho now starts only a few bundles (those which need to be started, e.g. because they don't use declarative service like core.net), but this in an order that is working. In particular, the org.eclipse.equinox.registry bundle is started before org.eclipse.core.net, so that when the latter activates org.eclipse.equinox.preferences, o.e.e.registry is already running. This fix is integrated in 0.14.0-SNAPSHOT as commit e4a8835. [1]

This should fix/work around the NPE problem. I do agree that org.eclipse.core.net/org.ecipse.equinox.registry should not depend on the bundle activation order, but IMHO this should be a separate bug report.


[1] Unfortunately, the new CI build at eclipse.org doen't deploy anywhere. In order to try out 0.14.0-SNAPSHOT, you'd need to build Tycho locally. The good news: Tycho builds with a single mvn clean install since recently (see http://wiki.eclipse.org/Developing_Tycho for more details).
Comment 16 Christopher Brind CLA 2011-10-14 09:07:30 EDT
Couldn't this fix be put in a 0.13.1 release?  When is the planned release date of 0.14? Thanks in advance.
Comment 17 Tobias Oberlies CLA 2011-10-17 08:23:49 EDT
The sources just moved over to eclipse.org and release infrastructure is currently an open question (see bug 360628). This is what is currently blocking the 0.14.0 release. Help is appreciated.
Comment 18 Sergey Fukanchik CLA 2015-10-17 14:19:51 EDT
Has the fix been accepted into eclipse codebase? I get similar NPE in MARS 1:
java.lang.NullPointerException
        at org.eclipse.core.internal.net.StringUtil.split(StringUtil.java:33)
        at org.eclipse.core.internal.net.ProxyType.convertPropertyStringToHosts(ProxyType.java:102)
        at org.eclipse.core.internal.net.ProxyManager.getNonProxiedHosts(ProxyManager.java:118)
        at org.eclipse.core.internal.net.ProxySelector.getBypassHosts(ProxySelector.java:130)
        at org.eclipse.ui.internal.net.NonProxyHostsComposite.getProxyBypassData(NonProxyHostsComposite.java:344)
        at org.eclipse.ui.internal.net.NonProxyHostsComposite.initializeValues(NonProxyHostsComposite.java:283)
        at org.eclipse.ui.internal.net.NonProxyHostsComposite.createWidgets(NonProxyHostsComposite.java:133)
        at org.eclipse.ui.internal.net.NonProxyHostsComposite.<init>(NonProxyHostsComposite.java:66)
        at org.eclipse.ui.internal.net.ProxyPreferencePage.createNonProxiedHostsComposite(ProxyPreferencePage.java:89)
        at org.eclipse.ui.internal.net.ProxyPreferencePage.createContents(ProxyPreferencePage.java:55)
        at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:241)
        at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1450)
        at org.eclipse.jface.preference.PreferenceDialog$13.run(PreferenceDialog.java:1217)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
        at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
        at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1209)
        at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:608)
        at org.eclipse.jface.preference.PreferenceDialog$9$1.run(PreferenceDialog.java:675)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
        at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:670)
        at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:877)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
        at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
        at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:874)
        at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1243)
        at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1269)
        at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:265)
        at org.eclipse.jface.util.OpenStrategy.access$5(OpenStrategy.java:259)
        at org.eclipse.jface.util.OpenStrategy$1$2.run(OpenStrategy.java:440)
        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
        at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3794)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3433)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:827)
        at org.eclipse.jface.window.Window.open(Window.java:803)
        at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPreferenceDialog.java:211)
        at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:63)
        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$5.handleEvent(ActionContributionItem.java:420)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4481)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1329)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3819)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3430)
        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:654)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
        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:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        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)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Comment 19 Jan Sievers CLA 2015-10-19 03:32:03 EDT
(In reply to Sergey Fukanchik from comment #18)
> Has the fix been accepted into eclipse codebase? 

yes, as per resolution status and target milestone of this bug. If you see a problem with Tycho 0.23.1, open a new bug and attach your settings.xml and steps to reproduce