Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338633 - Cannot set the property eclipse.pdebuild.home error
Summary: Cannot set the property eclipse.pdebuild.home error
Status: RESOLVED WONTFIX
Alias: None
Product: PDE
Classification: Eclipse Project
Component: Build (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: pde-build-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-02 04:28 EST by Liangfei Su CLA
Modified: 2018-12-03 09:13 EST (History)
8 users (show)

See Also:


Attachments
eclipse.pdebuild.home empty (1.15 MB, image/png)
2011-05-20 02:33 EDT, wurenhai CLA
no flags Details
A possible patch to fix the issue (1.27 KB, patch)
2015-02-05 01:29 EST, Rob Stryker CLA
no flags Details | Diff
A fix for both files (2.42 KB, patch)
2015-02-05 01:40 EST, Rob Stryker CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Liangfei Su CLA 2011-03-02 04:28:48 EST
Build Identifier: Eclipse 3.6.1 M20100909-0800

With an installation of eclipse 3.6.1 plaform-runtime, PDE runtime, and JDT runtime.

1. New a simple ANT file in some java project. 
2. Try to "Run As"->"Ant Build"

There will be log entry in log view says that "Error: Cannot set the property eclipse.pdebuild.home. It looks like PDE Build has been altered. ".

Compare to the eclipse 3.6.1 SDK, i notice that pde build are in different format: In SDK, pdebuild is a directory while in runtime it's a jar. If i un-jar the pde.build jar as a folder under eclipse/plugin, the issue will disappear. Should this be a build problem.

Reproducible: Always

Steps to Reproduce:
1. New a simple ANT file in some java project. 
2. Try to "Run As"->"Ant Build"

There will be log entry in log view says that "Error: Cannot set the property eclipse.pdebuild.home. It looks like PDE Build has been altered. ".
Comment 1 Liangfei Su CLA 2011-05-09 02:31:01 EDT
Sounds quiet here. Is anybody here see this issue before? It looks like a common issue to run a ant file in eclipse. Do i make some wrong setting for this BZ?
Comment 2 wurenhai CLA 2011-05-20 02:27:00 EDT
!ENTRY org.eclipse.pde.build 4 25 2011-05-20 14:24:07.437
!MESSAGE Cannot set the property eclipse.pdebuild.home. It looks like PDE Build has been altered.

!ENTRY org.eclipse.ant.core 4 1 2011-05-20 14:24:07.671
!MESSAGE BUILD FAILED
!STACK 0
java.lang.NullPointerException
	at java.util.Hashtable.put(Hashtable.java:394)
	at org.apache.tools.ant.PropertyHelper.setUserProperty(PropertyHelper.java:377)
	at org.apache.tools.ant.Project.setUserProperty(Project.java:543)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.setProperties(InternalAntRunner.java:233)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:593)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:495)
	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.eclipse.ant.core.AntRunner.run(AntRunner.java:378)
	at org.eclipse.pde.internal.core.exports.FeatureExportOperation.runScript(FeatureExportOperation.java:424)
	at org.eclipse.pde.internal.core.exports.FeatureExportOperation.doExport(FeatureExportOperation.java:262)
	at org.eclipse.pde.internal.core.exports.FeatureBasedExportOperation.run(FeatureBasedExportOperation.java:50)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 3 wurenhai CLA 2011-05-20 02:33:04 EDT
Created attachment 196180 [details]
eclipse.pdebuild.home empty

eclipse.pdebuild.home is empty,but i can't change the value?

And what is the default value?


I don't know why it is empty.
Comment 4 wurenhai CLA 2011-05-20 04:02:36 EDT
Eclipse Release Build: 3.6.2

I install pde as a dropins, 

eclipse
|--dropins
|--|--pde
|--|--jdt
...

In this way, eclipse.pdebuild.home is empty.

otherwise, when i intall pde using help->install/update, it's doesn't have this problem.
Comment 5 Andrew Niefer CLA 2011-05-20 10:16:08 EDT
PDE/Build must be installed as a folder on the disk.  This happens when it is used as a jar.
Comment 6 Liangfei Su CLA 2011-05-20 23:36:10 EDT
(In reply to comment #5)
> PDE/Build must be installed as a folder on the disk.  This happens when it is
> used as a jar.

It's true, i think this is the cause. But the clean installation of PDE runtime suffers this issue. It's there any plan to fix it? PDE SDK it's ok as it's installed as a folder.
Comment 7 Rob Stryker CLA 2014-07-18 07:14:07 EDT
I also occasionally get this error when exporting a plugin-project:

java.lang.NullPointerException
	at java.util.Hashtable.put(Hashtable.java:514)
	at org.apache.tools.ant.PropertyHelper.setUserProperty(PropertyHelper.java:750)
	at org.apache.tools.ant.Project.setUserProperty(Project.java:563)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.setProperties(InternalAntRunner.java:267)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:632)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:525)
	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.ant.core.AntRunner.run(AntRunner.java:371)
	at org.eclipse.pde.internal.core.exports.FeatureExportOperation.runScript(FeatureExportOperation.java:423)
	at org.eclipse.pde.internal.core.exports.FeatureExportOperation.doExport(FeatureExportOperation.java:261)
	at org.eclipse.pde.internal.core.exports.FeatureBasedExportOperation.run(FeatureBasedExportOperation.java:50)
Comment 8 Rob Stryker CLA 2014-07-18 07:51:22 EDT
I experience this bug during the following situation:

1) Open luna
2) Create a plugin project, osgi, standard
3) Use hello-world template
4) Export it to a folder somewhere (everything goes ok)
5) Run runtime-workbench 
6) Create a plugin project, osgi, standard
7) Use hello-world template
8) Try to export project to a folder
9) FAIL, NPE as shown above.
Comment 9 Rob Stryker CLA 2015-02-05 00:52:49 EST
This problem is still replicatable in Mars.  Any idea what's going on here? I think the steps to reproduce are pretty easy to follow.
Comment 10 Rob Stryker CLA 2015-02-05 01:15:28 EST
Here is a new stacktrace for Mars:

java.lang.NullPointerException
	at java.util.Hashtable.put(Hashtable.java:459)
	at org.apache.tools.ant.PropertyHelper.setUserProperty(PropertyHelper.java:750)
	at org.apache.tools.ant.Project.setUserProperty(Project.java:563)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.setProperties(InternalAntRunner.java:267)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:632)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:525)
	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.ant.core.AntRunner.run(AntRunner.java:371)
	at org.eclipse.pde.internal.core.exports.FeatureExportOperation.runScript(FeatureExportOperation.java:423)
	at org.eclipse.pde.internal.core.exports.FeatureExportOperation.doExport(FeatureExportOperation.java:261)
	at org.eclipse.pde.internal.core.exports.FeatureBasedExportOperation.run(FeatureBasedExportOperation.java:50)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)




Looking at the code here:  http://git.eclipse.org/c/platform/eclipse.platform.git/tree/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/InternalAntRunner.java#n1035

We can see that the variable userProperties is a HashMap, which permits the use of a null value. This means the method setProperties() which has the following code may be passing in a null value:

	private void setProperties(Project project) {
		setBuiltInProperties(project);
		if (userProperties != null) {
			for (Entry<String, String> entry : userProperties.entrySet()) {
				project.setUserProperty(entry.getKey(), entry.getValue());
			}
		}
	}

Following the stack, however, wee see that the internal implementation for project.setUserProperty(k,v) leads to PropertyHelper, which uses a HashTable as an internal implementation, which does not allow null values. 

InternalAntRunner should make sure there are no null values being passed in here!
Comment 11 Rob Stryker CLA 2015-02-05 01:29:11 EST
Created attachment 250514 [details]
A possible patch to fix the issue

I'm attaching a patch to fix the issue. Unfortunately the affected class is in Ant and not PDE so I'm not sure if I should open a duplicate issue or not.
Comment 12 Rob Stryker CLA 2015-02-05 01:40:00 EST
Sorry, my link to the source code was to the wrong InternalAntRunner.   See http://git.eclipse.org/c/platform/eclipse.platform.git/tree/ant/org.eclipse.ant.core/src_ant/org/eclipse/ant/internal/core/ant/InternalAntRunner.java#n268  instead. 

I'll attach a new patch momentarily that updates both files.
Comment 13 Rob Stryker CLA 2015-02-05 01:40:26 EST
Created attachment 250515 [details]
A fix for both files
Comment 14 Rob Stryker CLA 2015-02-05 01:45:06 EST
I've opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=459188  in the ant component in case it gets more visibility there, since that's where the patch would be made anyway.
Comment 15 Vikas Chandra CLA 2015-02-05 01:54:48 EST
Sarika, there is a proposed fix in ant core. Do you have commit rights there?
Comment 16 Sarika Sinha CLA 2015-02-05 07:39:13 EST
(In reply to Vikas Chandra from comment #15)
> Sarika, there is a proposed fix in ant core. Do you have commit rights there?

I don't have commit rights. Mike can help. 

I could not reproduce the Error using Comment#9. Do I need to set some preference for PDE ?
But I wonder why do we get eclipse.pdebuild.home as null ? If it is not set, it can come as empty string.
Comment 17 Michael Rennie CLA 2015-02-05 10:06:41 EST
(In reply to Sarika Sinha from comment #16)
> (In reply to Vikas Chandra from comment #15)
> > Sarika, there is a proposed fix in ant core. Do you have commit rights there?
> 
> I don't have commit rights. Mike can help. 

I have pushed the fix in Ant core.
Comment 18 Lars Vogel CLA 2018-12-03 09:12:23 EST
Currently we are not actively enhancing PDE build anymore. Therefore, I close this bug as WONTFIX. 

Please reopen, if you plan to provide a fix.
Comment 19 Lars Vogel CLA 2018-12-03 09:13:05 EST
Currently we are not actively enhancing PDE build anymore. Therefore, I close this bug as WONTFIX. 

Please reopen, if you plan to provide a fix.