glassfish
  1. glassfish
  2. GLASSFISH-16915

provide interface to install libraries e.g. JDBC driver

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1
    • Fix Version/s: None
    • Component/s: deployment
    • Labels:
      None

      Description

      GF no longer provides support for adding libraries to classpath. As a result of this design decision GF can no longer be configured remotly. With GFv2 it was possible to configure JDBC conn-pool with asadmin remote cmd and also add the driver jar (if available on disk) to the classpath with asadmin remote cmd. With GFv3 we have to ssh into the remote machine copy jar to */lib, then use asadmin remote cmd to configure the rest. In environments where security policies restict ssh usage GF can no longer be configured.

      In order to provide full remote configuration support GFv3 need some admin commands to install 3rd party libs.
      The best thing would be to extend common classloader with classpath support (can configure native libs with native-lib-path, but classpath-prefix/suffix has been dropped ??? )
      Second best alternative is to provide a well defined interface to install libs (it is not acceptable to force users to manipulate configuration on disk, well defined interafeces should be provided)

      Such an interface could look like this:
      supported interfaces: admainGUI, asadmin, REST
      commands:
      list-lib -target [domain|config-name]
      delete-lib -lib-name <lib-name> --target [domain|config-name]
      install-lib -source [server|local] -source-path <path> --target [domain|config-name]
      (to deploy an app with REST id-field accepts path on server or POST upload, this should be the same here)

        Issue Links

          Activity

          Hide
          Tom Mueller added a comment -

          This request is also recorded in BugDB issue 12696007

          Show
          Tom Mueller added a comment - This request is also recorded in BugDB issue 12696007
          Hide
          Tom Mueller added a comment -

          The classpath-prefix and classpath-suffix fields are displayed as unsupported in the console, but they can still be set with the set command, and the server does use the values. For example,

          asadmin set configs.config.server-config.java-config.classpath-suffix=example.jar
          asadmin restart-domain

          results in a classpath argument as follows when the domain is restarted:

          -cp /scratch/trm/test/glassfish3/glassfish/modules/glassfish.jar:/scratch/trm/test/glassfish3/glassfish/domains/domain1/config/example.jar

          For practical use of this, the JAR file specification should be an absolute path or a relative path outside of the config directory.

          Is there a reason why this doesn't work?

          Also, it may be possible to deploy libraries using a RAR file along with the use of the --libraries option of the deploy command for applications.

          Show
          Tom Mueller added a comment - The classpath-prefix and classpath-suffix fields are displayed as unsupported in the console, but they can still be set with the set command, and the server does use the values. For example, asadmin set configs.config.server-config.java-config.classpath-suffix=example.jar asadmin restart-domain results in a classpath argument as follows when the domain is restarted: -cp /scratch/trm/test/glassfish3/glassfish/modules/glassfish.jar:/scratch/trm/test/glassfish3/glassfish/domains/domain1/config/example.jar For practical use of this, the JAR file specification should be an absolute path or a relative path outside of the config directory. Is there a reason why this doesn't work? Also, it may be possible to deploy libraries using a RAR file along with the use of the --libraries option of the deploy command for applications.
          Hide
          Anissa Lam added a comment -

          "The classpath-prefix and classpath-suffix fields are displayed as unsupported in the console, but they can still be set with the set command, and the server does use the values."

          Are you sure the server really uses the values ?
          These 2 values are not supported in v3 due to architectural change.
          Please refer to http://java.net/jira/browse/GLASSFISH-10967 on discussion about these 2 attributes.

          Show
          Anissa Lam added a comment - "The classpath-prefix and classpath-suffix fields are displayed as unsupported in the console, but they can still be set with the set command, and the server does use the values." Are you sure the server really uses the values ? These 2 values are not supported in v3 due to architectural change. Please refer to http://java.net/jira/browse/GLASSFISH-10967 on discussion about these 2 attributes.
          Hide
          Tom Mueller added a comment -

          Anissa's comment is correct. Even though the JAR files show up in the classpath, the classes in them will not be available to the applications. So ignore my previous comment.

          Show
          Tom Mueller added a comment - Anissa's comment is correct. Even though the JAR files show up in the classpath, the classes in them will not be available to the applications. So ignore my previous comment.
          Hide
          Andreas Rieck added a comment - - edited

          This enhancement request is NOT a request to get legacy classpath-prefix and classpath-suffix back to GFv3 family.
          classpath-prefix and suffix will not work since implementing OSGi with Glassfish v3 and might never come back to Glassfish.

          It is a request to have a new interface developed from Glassfish administration point of view (asadmin, gui and rest).
          This interface should handle the "file copy" recommendations "Circumventing Class Loader Isolation" described at this doc
          http://download.oracle.com/docs/cd/E18930_01/html/821-2418/beadh.html
          It is just the question to have a "asadmin/gui" feature implemented which will handle these "manual file copies" for
          the various lib directories described on this page.

          The szenario is a admin access to DAS gui, but no unix commandline permissions to ssh login for manual file copies (eg. jdbc drivers).

          A second alternative option is maybe a new environment variable called "common-class-loader-path". (or similar)
          If such environment variable can be implemented, then the common class loader might be able to load libraries,
          classes, jar's, zip's from the standard default ./lib path (as described in docs) and then from another manual
          configured path on second step.

          Show
          Andreas Rieck added a comment - - edited This enhancement request is NOT a request to get legacy classpath-prefix and classpath-suffix back to GFv3 family. classpath-prefix and suffix will not work since implementing OSGi with Glassfish v3 and might never come back to Glassfish. It is a request to have a new interface developed from Glassfish administration point of view (asadmin, gui and rest). This interface should handle the "file copy" recommendations "Circumventing Class Loader Isolation" described at this doc http://download.oracle.com/docs/cd/E18930_01/html/821-2418/beadh.html It is just the question to have a "asadmin/gui" feature implemented which will handle these "manual file copies" for the various lib directories described on this page. The szenario is a admin access to DAS gui, but no unix commandline permissions to ssh login for manual file copies (eg. jdbc drivers). A second alternative option is maybe a new environment variable called "common-class-loader-path". (or similar) If such environment variable can be implemented, then the common class loader might be able to load libraries, classes, jar's, zip's from the standard default ./lib path (as described in docs) and then from another manual configured path on second step.
          Hide
          Tom Mueller added a comment -

          Hong, I think this is a duplicate of something that you are already working on.

          Show
          Tom Mueller added a comment - Hong, I think this is a duplicate of something that you are already working on.
          Hide
          Hong Zhang added a comment -

          After various discussions, the plan is to limit the scope of this feature in this release to this set of commands:

          asadmin add-library (to install libraries)
          asadmin remove-library (to remove libraries)
          asadmin list-libraries (to list libraries)

          there will be no target support available for this release. And the instances will need to be restarted to synch over the libraries. Further enhancements will be made in the later releases.

          Show
          Hong Zhang added a comment - After various discussions, the plan is to limit the scope of this feature in this release to this set of commands: asadmin add-library (to install libraries) asadmin remove-library (to remove libraries) asadmin list-libraries (to list libraries) there will be no target support available for this release. And the instances will need to be restarted to synch over the libraries. Further enhancements will be made in the later releases.

            People

            • Assignee:
              Hong Zhang
              Reporter:
              schaarsc
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: