Depending on the type of application, you might consider using the Eclipse platform (www.eclipse.org) which is designed for doing this kind of thing in a desktop app, or an "application server" (Tomcat, JBoss, etc.) Servlets and EJBs are really just another way to look at plug-ins.
For me the breakthrough to plugins was the "Dependency Inversion Principle". It means that the engine is calling the plugins, but the compile-time dependency is inverted - the plugins must reference the engine to compile.
So the engine package might have the Engine class and the IPlugin interface. You can compile this, bundle it up in a jar and sell it on EBay.
You build the plugin package later. Maybe folks who bought your jar on EBay build their own plugins to work with your Engine, kind of like people write plugins for Eclipse. Plugin packages have classes that implement the Plugin interface.
We glue them together with configuration and some form "Dependency Injection". The Engine winds up with code like:
The factory can return new plugins that the Engine authors never heard of. The factory might say
Does that sound fun? If so, Google for more good stuff on Dependency Inversion and Dependency Injection.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi