Uploaded image for project: 'FtpServer'
  1. FtpServer
  2. FTPSERVER-441

Impossibile to create Custom UserManager in OSGI container

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.0.6
    • None
    • Core
    • Karaf OSGI platform, with FtpServer-core bundle Ver 1.06 + My bundle that create new FtpServer

    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

          Activity

            People

              Unassigned Unassigned
              gigiofreestyle Marco Bianicni
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 12h
                  12h
                  Remaining:
                  Remaining Estimate - 12h
                  12h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified