This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 149024 - [eRCP] Certify which Execution Environments ECF can be run on
Summary: [eRCP] Certify which Execution Environments ECF can be run on
Status: CLOSED FIXED
Alias: None
Product: ECF
Classification: RT
Component: ecf.core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: ecf.core-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-06-28 11:47 EDT by Chris Aniszczyk CLA
Modified: 2008-05-18 14:44 EDT (History)
2 users (show)

See Also:


Attachments
Patch to remove Callback import. (894 bytes, patch)
2006-10-15 20:27 EDT, Remy Suen CLA
no flags Details | Diff
Patch to finish the last leg of F1.0 migration. (10.52 KB, patch)
2006-11-13 02:38 EST, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Aniszczyk CLA 2006-06-28 11:47:05 EDT
This is important when we try to get ECF working on embedded devices which have whacky EE's ;)
Comment 1 Chris Aniszczyk CLA 2006-07-16 15:56:23 EDT
btw, will be working on this as I'm trying to get ECF working on some eRCP devices which run Foundation 1.1
Comment 2 Remy Suen CLA 2006-10-08 06:38:13 EDT
For some odd reason, the IBM J9 VM for F1.1 isn't working right for me, but using a F1.0 VM with the F1.1 class libraries showed that the javax.security.auth.callback.Callback interface is the only problem (that being that it doesn't exist) for org.eclipse.ecf (I didn't check any other plug-ins since that's irrelevant unless the core plug-in is fixed).

Over seventy errors were detected when using F1.0 class libraries, the ones I spotted seemed to be caused by the lack of public constructors/methods in Exception and RuntimeException.
Comment 3 Scott Lewis CLA 2006-10-10 12:07:58 EDT
(In reply to comment #2)
> For some odd reason, the IBM J9 VM for F1.1 isn't working right for me, but
> using a F1.0 VM with the F1.1 class libraries showed that the
> javax.security.auth.callback.Callback interface is the only problem (that being
> that it doesn't exist) for org.eclipse.ecf (I didn't check any other plug-ins
> since that's irrelevant unless the core plug-in is fixed).

I could introduce a new interfaces:  CallbackHandler, Callback, and new exception class UnsupportedCallbackException in org.eclipse.ecf.security to replace the ones in javax.security.auth.

Then no missing dependencies would exist for 1.1, right?  Also...what's the status of 1.1 availability/adoption relative to 1.0?  i.e. when was 1.1 introduced?  Are most/all folks using 1.1 now?

This creates some issues with ultimately using jaas, however.  

> 
> Over seventy errors were detected when using F1.0 class libraries, the ones I
> spotted seemed to be caused by the lack of public constructors/methods in
> Exception and RuntimeException.
> 

OK.  Obviously these could be fixed as well...but I guess what I'm getting at above is:  do we think it's necessary?
Comment 4 Scott Lewis CLA 2006-10-10 12:08:28 EDT
changing back to open. accidently marked as fixed
Comment 5 Scott Lewis CLA 2006-10-10 17:27:38 EDT
So I think we need to tease out:

1) Which JRE (1.4 or 1.5)
2) Which EE (CDC or OSGi)
3) Which runtime version (1.0 or 1.1)

And decide for each of these which ECF needs to support...and for how long

(In reply to comment #4)
> changing back to open. accidently marked as fixed
> 

Comment 6 Chris Aniszczyk CLA 2006-10-10 17:53:33 EDT
I would like to see ECF run on devices so F1.1 would be great. I would also like to see some of the providers to stride for running on devices if possible.

Also, ECF is nice in terms of OSGi because currently OSGi runs on a single VM and communicating, say amongst services residing in other VM's isn't easy.
Comment 7 Remy Suen CLA 2006-10-10 21:08:10 EDT
(In reply to comment #3)
> Then no missing dependencies would exist for 1.1, right?

Just tried this for myself, Callback, CallbackHandler, NameCallback, and UnsupportedCallbackException would need to be created.

> Also...what's the status of 1.1 availability/adoption relative to 1.0?  i.e.
> when was 1.1 introduced?  Are most/all folks using 1.1 now?

Chris, can you comment on this? But from your comment #6, I guess most are on 1.1?

> This creates some issues with ultimately using jaas, however.

True, per section 2.6 in JSR-219 (http://www.jcp.org/en/jsr/detail?id=219&showPrint), JAAS is one of the three optional packages for F1.1. So I guess the question is how common is the inclusion of the optional JAAS package in an embedded device nowadays?

(In reply to comment #5)
> 1) Which JRE (1.4 or 1.5)
> 2) Which EE (CDC or OSGi)
> 3) Which runtime version (1.0 or 1.1)

For those that are unfamiliar with the EEs, you can refer to Appendix 1 at http://www.eclipse.org/eclipse/development/readme_eclipse_3.2.1.html. So if we're going JRE 1.5, most embedded devices won't be able to run ECF. The Nokia 770 would be such an exception (I think?).
Comment 8 Remy Suen CLA 2006-10-11 22:15:34 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > Over seventy errors were detected when using F1.0 class libraries, the ones I
> > spotted seemed to be caused by the lack of public constructors/methods in
> > Exception and RuntimeException.
> > 
> 
> OK.  Obviously these could be fixed as well...but I guess what I'm getting at
> above is:  do we think it's necessary?

I forgot to mention that java.net.URI is another cause of problem in F1.0. I think that the Throwable-related issues can probably be taken care of via using extending from CoreException, but I'm not so sure about this lil' bugger.

Filtered error output from F1.0 (barring deletion errors whilst copying/pasting from Eclipse):
Callback cannot be resolved to a type
CallbackHandler cannot be resolved to a type
The constructor Exception(String, Throwable) is undefined
The constructor Exception(Throwable) is undefined
The constructor FileOutputStream(File, boolean) is undefined
The constructor RuntimeException(InstantiationException) is undefined
The import java.net.URI cannot be resolved
The import java.net.URISyntaxException cannot be resolved
The import javax.security cannot be resolved
The method getAlgorithms(String) is undefined for the type Security
The method getCallbackHandler() is undefined for the type IConnectContext
The method getStackTrace() is undefined for the type Exception
The method getStackTrace() is undefined for the type Throwable
The method toURI() is undefined for the type BaseID
URI cannot be resolved to a type
URISyntaxException cannot be resolved to a type
Comment 9 Scott Lewis CLA 2006-10-14 19:13:19 EDT
As of 10.14.2006 4:10 PST I've added the new interfaces 

org.eclipse.ecf.core.security.Callback;
org.eclipse.ecf.core.security.CallbackHandler;
org.eclipse.ecf.core.security.NameCallback;
org.eclipse.ecf.core.security.UnsupportedCallbackExceptionor

to replace

javax.security.auth.callback.Callback;
javax.security.auth.callback.CallbackHandler;
javax.security.auth.callback.NameCallback;
javax.security.auth.callback.UnsupportedCallbackException;

See comment #7

If you can Remy, please try these out with F1.1.

As for problems with URI for F1.0...I don't think it's possible for us to do without the URI class.  So I think that F1.0 is going to be out of the question.  Anyone know how much of an imposition is this likely to be?
Comment 10 Remy Suen CLA 2006-10-15 20:27:26 EDT
Created attachment 52006 [details]
Patch to remove Callback import.

(In reply to comment #9)
> If you can Remy, please try these out with F1.1.

Close, patch attached mops things up for org.eclipse.ecf.

I don't exactly have the whole world checked out, but for the record...
org.eclipse.ecf.discovery
org.eclipse.ecf.fileshare
org.eclipse.ecf.provider.irc
...are all go. org.eclipse.ecf.provider uses XML parsers in org.eclipse.ecf.provider.app.ServerConfigParser, and poses a problem.
Comment 11 Scott Lewis CLA 2006-10-15 20:48:29 EDT
Patch applied and checked in.  Import removed in 0.9.3 (stable release due ~10/21).

Thanks Remy.

(In reply to comment #10)
> Created an attachment (id=52006) [edit]
> Patch to remove Callback import.
> 
> (In reply to comment #9)
> > If you can Remy, please try these out with F1.1.
> 
> Close, patch attached mops things up for org.eclipse.ecf.
> 
> I don't exactly have the whole world checked out, but for the record...
> org.eclipse.ecf.discovery
> org.eclipse.ecf.fileshare
> org.eclipse.ecf.provider.irc
> ...are all go. org.eclipse.ecf.provider uses XML parsers in
> org.eclipse.ecf.provider.app.ServerConfigParser, and poses a problem.
> 

Comment 12 Remy Suen CLA 2006-10-28 10:05:12 EDT
(In reply to comment #10)
> org.eclipse.ecf.provider uses XML parsers in
> org.eclipse.ecf.provider.app.ServerConfigParser, and poses a problem.

Actually, I've come to realize that this shouldn't be a problem. In eRCP, XML APIs and an implementation are automatically included as a dependency when your plug-in requires org.eclipse.osgi (which basically means all plug-ins). So org.eclipse.ecf.provider will build cleanly on a F1.1 workspace/project JRE setting as long as it's setup correctly (by setting the PDE target platform to eRCP).
Comment 13 Remy Suen CLA 2006-11-10 09:26:13 EST
Despite the recent changes to org.eclipse.ecf.core.ID, some work is still needed to bring all the core API plug-ins up to specifications of being capable of running on a CDC-1.0/Foundation-1.0 runtime.

Comment #8 outlines most of the problems, which may either require/cause massive API breakage of subclasses of ECFException or ECFException needs to be updated to handle all those super(?) calls accordingly by passing them to CoreException (that being ECFException should now subclass CoreException instead of Exception and passing on IStatuses upwards wrapping around the String message or Throwable cause).

Of course, the best way to visualize all the errors is to just install a F1.0 runtime on one's machine, I have outlined the necessary steps to do so for Windows/Linux operating systems at [1] which describes the setting up of an F1.1 environment, but there is really essentially no difference between the two.

[1] - http://wiki.eclipse.org/index.php/ECF_Development_Guidelines
Comment 14 Scott Lewis CLA 2006-11-10 12:41:23 EST
Hi Remy,

Thanks, I'm thinking of changing ECFException to be the following:

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.ecf.internal.core.identity.Activator;

public class ECFException extends CoreException {
	private static final long serialVersionUID = 3256440309134406707L;

	public ECFException() {
		this(null,null);
	}

	/**
	 * @param message message associated with exception
	 */
	public ECFException(String message) {
		this(message,null);
	}

	/**
	 * @param cause the cause of the new exception
	 */
	public ECFException(Throwable cause) {
		this(null,cause);
	}

	/**
	 * @param message
	 * @param cause
	 */
	public ECFException(String message, Throwable cause) {
		this(new Status(IStatus.ERROR,Activator.PLUGIN_ID,0,message,cause));
	}
	
	/**
	 * @param status
	 */
	public ECFException(IStatus status) {
		super(status);
	}
}

This should allow existing ECFException-using code to remain the same, and allow CDC 1.0/Foundation 1.0 compatibility as it doesn't use Exception(Throwable) or Exception(String,Throwable).  Seem reasonable?

(In reply to comment #13)
> Despite the recent changes to org.eclipse.cf.core.ID, some work is still
> needed to bring all the core API plug-ins up to specifications of being capable
> of running on a CDC-1.0/Foundation-1.0 runtime.
> 
> Comment #8 outlines most of the problems, which may either require/cause
> massive API breakage of subclasses of ECFException or ECFException needs to be
> updated to handle all those super(?) calls accordingly by passing them to
> CoreException (that being ECFException should now subclass CoreException
> instead of Exception and passing on IStatuses upwards wrapping around the
> String message or Throwable cause).
> 
> Of course, the best way to visualize all the errors is to just install a F1.0
> runtime on one's machine, I have outlined the necessary steps to do so for
> Windows/Linux operating systems at [1] which describes the setting up of an
> F1.1 environment, but there is really essentially no difference between the
> two.
> 
> [1] - http://wiki.eclipse.org/index.php/ECF_Development_Guidelines
> 

Comment 15 Remy Suen CLA 2006-11-11 09:08:28 EST
(In reply to comment #14)
> Thanks, I'm thinking of changing ECFException to be the following:
I think this is a workable solution for the time being. All the other subclasses can be refactored to create proper IStatuses without breaking API later.
Comment 16 Remy Suen CLA 2006-11-12 20:31:57 EST
There are still pending issues that needs to be resolved. IServiceInfo/ServiceInfo in discovery uses URI. The static getAlgorithms(String) method in java.security.Security doesn't exist in F1.0 in GUID's initializeRandom(String, String) method.

In other parts of the ECF core code there are some exception chaining that needs to be altered. For an example of what I mean, I'm talking about something like ContainerTypeDescription's constructor that wraps an InstantiationException in a RuntimeException.
Comment 17 Scott Lewis CLA 2006-11-12 23:24:40 EST
> There are still pending issues that needs to be resolved.
> IServiceInfo/ServiceInfo in discovery uses URI. The static

I removed the references to URI in discovery (and the org.eclipse.ecf.provider.jmdns implementation).

I removed references to RuntimeException/Exception(String,Throwable) (now throws NullPointerException instead).

(In reply to comment #16)
> getAlgorithms(String) method in java.security.Security doesn't exist in F1.0 in
> GUID's initializeRandom(String, String) method.

I put a try/catch (Exception) around this getAlgorithms(String) method, and now on F1.0 it will always default to using "SHA1PRNG" if getAlgorigthms isn't available.

> 
> In other parts of the ECF core code there are some exception chaining that
> needs to be altered. For an example of what I mean, I'm talking about something
> like ContainerTypeDescription's constructor that wraps an
> InstantiationException in a RuntimeException.

I modified these to throw NullPointerException rather than use Exception(Throwable) or Exception(String,Throwable).  If there are others please let me know.  I don't see any others from above list.

From the initial list above this looks like all of them, but I do want to test with the F1.0 EE environment with some small app.  Note that the org.eclipse.ecf.provider bundle probably won't work on F1.0.


Comment 18 Remy Suen CLA 2006-11-13 02:38:48 EST
Created attachment 53730 [details]
Patch to finish the last leg of F1.0 migration.

This patch fixes up the remaining exception problems, updates .classpath to use an F1.0 JRE, and also changes all the MANIFEST.MF files to be F1.0/J2SE-1.3.

Also, in the 0.9.3 N&N draft, org.eclipse.ecf.presence should be added to the F1.0-compatible section.
Comment 19 Scott Lewis CLA 2006-11-13 12:39:50 EST
(In reply to comment #18)
> Created an attachment (id=53730) [edit]
> Patch to finish the last leg of F1.0 migration.
> 
> This patch fixes up the remaining exception problems, updates .classpath to use
> an F1.0 JRE, and also changes all the MANIFEST.MF files to be F1.0/J2SE-1.3.

Thanks.  Applied this patch.  Also applied the J2SE-1.3 to org.eclipse.ecf and org.eclipse.ecf.remoteservice.

> 
> Also, in the 0.9.3 N&N draft, org.eclipse.ecf.presence should be added to the
> F1.0-compatible section.

Done.

I'm resolving this bug fixed...if additional F1.0 problems are found then we can reopen or file new bug.

Thanks Remy for all the help with this.

Comment 20 Scott Lewis CLA 2006-11-16 13:54:00 EST
closing and adding to ip log for patch