Bug 189640 - Importing javax.servlet plug-in as source gives compile errors
Summary: Importing javax.servlet plug-in as source gives compile errors
Status: RESOLVED FIXED
Alias: None
Product: Orbit
Classification: Tools
Component: bundles (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Orbit Bundles CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-29 07:02 EDT by Markus Keller CLA
Modified: 2007-05-30 12:20 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-05-29 07:02:28 EDT
I20070529-0010

Importing the javax.servlet plug-in as source gives compile errors.

.classpath must be changed to something like this for successful compilation:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry excluding="src/share/|examples/WEB-INF/classes/|examples/WEB-INF/classes/" kind="src" path="src"/>
	<classpathentry kind="src" path="src/src/share"/>
	<classpathentry kind="src" path="src/examples/WEB-INF/classes"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="output" path="bin"/>
</classpath>
Comment 1 Markus Keller CLA 2007-05-29 07:09:42 EDT
There are more compiler problems when importing orbit plug-ins as source. I wonder if it's a good idea to import orbit plug-ins as source at all. It would maybe be easier if they would just be imported as binary (as it e.g. used to be the case for org.junit).

Further problems:
- source plug-ins must set the singleton directive in the Manifest.mf
- org.apache.commons.logging does not compile since not all required libraries are available in the SDK
- org.apache.jasper does not compile because of unresolved references in JDTCompiler
(- not orbit problems: apt does not compile, see bug 188105)
Comment 2 Pascal Rapicault CLA 2007-05-29 08:11:54 EDT
>source plug-ins must set the singleton directive in the Manifest.mf
  This is something that we decided to do explicitly because if they were marked singleton then at runtime the bundles for which multiple version exist would not get resolved and therefore source would be missing.
Comment 3 Markus Keller CLA 2007-05-29 09:11:39 EDT
> >source plug-ins must set the singleton directive in the Manifest.mf
>   This is something that we decided to do explicitly because if they were
> marked singleton then at runtime the bundles for which multiple version exist
> would not get resolved and therefore source would be missing.

Does that mean that the compile error "Plug-ins declaring extensions or extension points must set the singleton directive to true" in MANIFEST.MF is wrong and that the extension to ext.pt. org.eclipse.pde.core.source works?
Comment 4 Jeff McAffer CLA 2007-05-29 09:16:09 EDT
There is no sense in which the source for Orbit bundles will be able to be imported and compiled correctly.  Almost by definition Orbit bundle content comes to us as binary.  Any source we may happen to be able to get may require all manner of other environment settings and context to be compiled.  The source is there for browsing and debugging purposes.  Treat these like elements of the JRE. 
Comment 5 Jeff McAffer CLA 2007-05-29 09:22:19 EDT
re comment 3.  Yes and no.  There are certain cases in which non-singletons can contribute extensions to the registry.  I'm not sure that these code paths have been verified (since we have always assumed singleton ness).  The singleton-ness was put in place to maintain the integrity of the extension registry namespace which, for better or worse, was originally based on plugin ids (bundle symbolic names now).  For anonymous extensions (ones without an id) it seems that this namespace issue is, well, not an issue.  Similarly, as of 3.2 we are able to contribute extensions in namespaces other than that of the supplying bundle.  

Having said all that, there is an underlying notion of "contributor" that we use to map between extensions and their supplying bundle (the contributor).  This may not be setup to handle multiple versions.

In any event, for 3.3 nothing in the space can be done.  Comment 1 is the most apt.  It does not make sense to import orbit bundles as source.
Comment 6 Simon Kaegi CLA 2007-05-29 10:44:46 EDT
We'll still have problems if there is any expectation of being able to recompile especially for bundles like commons logging where the build-time dependencies might be different from what we want to support at runtime. 

I'll reshape the src.zip for the javax.servlet so that at least the classpath issues are gone. I think if there's more to discuss on the larger source-bundle issues the dev-list is the place or if we can pin down problems in a separate bug. If there are similar class-path problems with other bundles they should be logged.
Comment 7 Simon Kaegi CLA 2007-05-29 10:57:51 EDT
Fixed in HEAD
Comment 8 Markus Keller CLA 2007-05-30 12:20:53 EDT
I've filed bug 189972 for the rest.