Details
Description
I need to create an FTPServer with custom SslConfiguration and custom UserManager from my OSGI Bundle.
When i create MyUserManager i obtain the following runtime error:
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/baseadaptor/DefaultClassLoader) of the current class, com/sample/Activator, and the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) for resolved class, org/apache/ftpserver/FtpServerFactory, have different Class objects for the type rver.FtpServerFactory.setUserManager(Lorg/apache/ftpserver/ftplet/UserManager;)V used in the signature
This error is caused because FtpServer-core bundle has org.apache.ftpserver.ftplet package but this package is not exported by Manifest, and this mvn projects depends from ftplet-api bundle.
MyUserManager uses UserManager exported by ftplet-api.
There are 2 solutions for this:
- add import of org.apache.ftpserver.ftplet;version=1.0.6 and remove this package from bundle.
- export org.apache.ftpserver.ftplet and remove compile dependency from maven pom
Attachments
Issue Links
- blocks
-
FTPSERVER-425 Duplicate package org.apache.ftpserver.ftplet in ftpserver-core
- Closed