mina-ftpserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leo Bayer <lfba...@gmail.com>
Subject ftplet-api and OSGi
Date Fri, 29 Aug 2014 00:42:13 GMT
I'm deploying the ftpserver into an OSGi container and trying to implement
my own UserManager, but both the ftpserver-core and the ftplet-api jars
have the ftplet package and classes in them.

What this means is, since they are loaded with different classloaders, any
external bundle that references the ftplet classes can't use them together
with the core jar's classes. Two classes with the same name loaded with
different classloaders are not compatible.

So either the ftpserver-core jar needs to export its ftplet package and the
ftplet-api.jar should go away. Or the ftplet package should be removed from
ftpserver-core.jar and the manifest should instead import them from the
ftplet-api.jar.

Has anyone ever implemented their own UserManager in an OSGi environment
while uses the ftpserver jars as bundles?

The actual error I get is this:

Caused by: java.lang.LinkageError: loader constraint violation: when
resolving method
"org.apache.ftpserver.FtpServerFactory.setUserManager(Lorg/apache/ftpserver/ftplet/UserManager;)V"
the class loader (instance of
org/eclipse/osgi/internal/loader/EquinoxClassLoader) of the current class,
com/lbayer/ftpserver/FtpService, and the class loader (instance of
org/eclipse/osgi/internal/loader/EquinoxClassLoader) for the method's
defining class, org/apache/ftpserver/FtpServerFactory, have different Class
objects for the type org/apache/ftpserver/ftplet/UserManager used in the
signature

Thanks,
 - Leo

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message