You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by rwengr <rw...@bellsouth.net> on 2014/04/11 21:00:05 UTC

Cannot load package while installing plugin

Wasce (Ger 3.0.0) Maven 2.2.1 JDK 1.6.0_45

I am able to successfully compile and package a plugin with a module that
implements a Geronimo Bean.  I can create a CAR file with car-maven-plugin. 
The deployment plan and geronimo-plugin.xml look OK.

I try to install the plugin using Web Page administrator tools.  This plugin
is a very simple example.

In the server log, I see the following:

2014-04-10 21:13:12,332 ERROR [PluginInstallerGBean] Unable to load
configuration. 
org.apache.geronimo.kernel.config.LifecycleException: load of
com.packt.plugins/WorldClock/1.0.0/car failed
....
Caused by: org.osgi.framework.BundleException: The bundle
"com.packt.plugins.WorldClock_1.0.0 [585]" could not be resolved. Reason:
Missing Constraint: Import-Package: com.packt.plugins; version="0.0.0"

But, here is the top level of the CAR file:

FOLDER - META-INF
FOLDER - OSGI-INF
WorldClockModule-1.0.0.jar

The contents of the manifest:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Bundle-ManifestVersion: 2
Bundle-SymbolicName: com.packt.plugins.WorldClock
Bundle-Version: 1.0.0
Bundle-Activator: org.apache.geronimo.kernel.osgi.ConfigurationActivator
Import-Package: org.apache.geronimo.kernel.osgi,org.apache.geronimo.sy
 stem.serverinfo,org.osgi.framework,com.packt.plugins,org.apache.geron
 imo.gbean
DynamicImport-Package: *
Bundle-ClassPath: WorldClockModule-1.0.0.jar
Built-By: QEuser
Build-Jdk: 1.6.0_45

*Missing package com.packt.plugins is the jar file contained in the CAR
archive being provided to the plugin installer.  Why can't plugin installer
find it??*

I can make it work by installing the module bundle into Geronimo bundle
repository, but that means I have to update the bundle and the plugin every
time I deploy.

P.S. Tried command line deploy. Same results.





--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/Cannot-load-module-package-while-installing-plugin-tp3987865.html
Sent from the Development mailing list archive at Nabble.com.

Re: Cannot load package while installing plugin

Posted by rwengr <rw...@bellsouth.net>.
The solution to this problem lies in the configuration of the
car-maven-plugin.

When the console portlet deploys a plugin, it automatically deploys a
CONFIGURATION bundle to the bundle repository.  It will require any import
dependencies in the manifest.  Well, the package containing the module has
not yet been installed so there is no way the bundle manager can import it.

The solution is to look at the manifest the first time and then remove the
import of the module package.  In the configuration of the car-maven-plugin
you can customize the manifest and override the Import-Package statement
like this.

<archive>
   <manifestEntries>
        <Import-Package>
org.apache.geronimo.kernel.osgi,org.apache.geronimo.system.serverinfo,org.osgi.framework,org.apache.geronimo.gbean
       </Import-Package>
     </manifestEntries>
</archive>

Notice that the manifest will no longer import the package
(com.packt.plugins) that we have not yet installed.  It's possible adding an
Export-Package line would also work.



--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/Cannot-load-module-package-while-installing-plugin-tp3987865p3987866.html
Sent from the Development mailing list archive at Nabble.com.