Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » how to resolve "Import-Package: javax.servlet,, javax.servlet.http" in the PDE
how to resolve "Import-Package: javax.servlet,, javax.servlet.http" in the PDE [message #64575] Tue, 04 April 2006 20:02 Go to next message
Patrick Mueller is currently offline Patrick MuellerFriend
Messages: 15
Registered: July 2009
Junior Member
Using 3.2M5

So, we're playing with the servlet bridge stuff, but we don't want to
neccessarily tie ourselves to it, so are trying to make our bundles that
are referencing javax.servlet goop handle the dependency on java.servlet
goop via:

Import-Package: javax.servlet, javax.servlet.http

in the bundle manifest.

No problems at runtime with this (as near as we can tell) as long as
some bundle exports these.

The problem is with the development-time story with the PDE.

It turns out that if you don't do anything special, those import package
dependencies are resolving against the eclipse tomcat plugin. Two
problems with that:

- the javax.servlet.* packages are not 'public', so we get a half a
bazillion warnings about "Discouraged access" of the classes.

- it's version 2.3 of the servlet classes anyway, and we want 2.4

So, I tried this. Went into Preferences/Plug-in Development/Target
Platform/Plug-ins, and unchecked the tomcat plugin. I also added my own
plugin to the runtime plugins that explicitly exports the javax.servlet
packages. It sometimes will resolve against that, but not all the time.
Which seems odd in itself.

I would prefer to not even have to go this far. Shouldn't I be able to
resolve these imports against a bundle in my workspace? That's the way
Require-Bundle works, Import-Package should work the same way. Or at
least provide some way to make this work.

I think at this point I'm going to create a bundle for use in
development-time only (with dev-time-only or something in the actual
name), and have people do an optional Require-Bundle on it, so it will
resolve nicely in the PDE, and because it's optional, won't cause a
problem at runtime where it's not available.

Other hints, tips, tricks?

Or is this already covered by
https://bugs.eclipse.org/bugs/show_bug.cgi?id=134434

--
Patrick Mueller - pmuellr@yahoo.com

Oblique Strategies: Do something boring
Re: how to resolve "Import-Package: javax.servlet,, javax.servlet.http" in the P [message #64598 is a reply to message #64575] Tue, 04 April 2006 22:56 Go to previous message
Eclipse UserFriend
Originally posted by: neil.integility.com

Patrick,

For serious bundle development you should always work from a separate
Target Platform, ie don't use the default which is the installation
directory of the SDK. For one thing it lets you try out the latest
Milestone build of the SDK while letting your bundles depend on something
more stable like 3.1.2.

This would solve your problem, simply by not including the Tomcat plugin.
It's best to build up your Target Platform from the absolute minimum, so a
good starting point would be the RCP runtime download. Then add bundles to
it only as you need them.

On the project I work on, we keep out Target Platform checked into CVS.

Regards,
Neil
Previous Topic:Loading from 3rd party / user written jars, class not found exception
Next Topic:serverside OSGI build coming?
Goto Forum:
  


Current Time: Sat Apr 20 01:47:24 GMT 2024

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

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

Back to the top