0

I can install the javaMail-1.5 feature fine using the following command "installUtility install javaMail-1.5" on my running liberty server and following the prompts.

However according to the liberty documentation I should be able to install it by adding the following to my server.xml config in the featureManager tag: javaMail-1.5

This doesn't work and I see the following error in the server startup logs: [11/30/16 1:22:43:342 UTC] 00000021 id= com.ibm.ws.kernel.feature.internal.FeatureManager E CWWKF0042E: A feature definition cannot be found for the javamail-1.5 feature. Try running the command, bin/installUtility install javamail-1.5, to install the feature. Alternatively, you can run the command, bin/installUtility install authentication, to install all features that are referenced by this configuration.

My server details are as below:

product = WebSphere Application Server 16.0.0.3 (wlp-1.0.14.cl160320160831-1555)

java.version = 1.8.0 java.runtime = Java(TM) SE Runtime Environment (pxa6480sr3fp20-20161019_02 (SR3 FP20))

Does anyone have any idea why this doesn't work?

Adam
  • 59
  • 1
  • 6
  • I think you are confusing "installing a feature" and "enabling a feature". Running `installUtility` will install the feature on your system. Putting `javaMail-1.5` inside your `` tags enables the feature for the server. A feature must be installed before it can be enabled on any server. The error you are seeing is basically saying "you are trying to enable this feature, but we can't because you haven't installed the feature yet". – Andy Guibert Dec 03 '16 at 19:31

2 Answers2

1

If the feature hasn't been installed, you will need to use installUtility to install it as you mentioned.

The error is an indication that the feature -- think binaries -- is not on the system i.e. hasn't been installed.

Specifying it in your server.xml will configure the runtime to use it. But, it will not install the feature automatically for you. The server.xml is a server runtime configuration.

Now, what you can do is to try installUtility install <yourServer> or installUtility install <pathToServerXml>, which will have installUtility inspect your server or server.xml and install any features that aren't already installed on the system.

ykchang
  • 256
  • 1
  • 5
  • Thanks for your response, I'm running Liberty in a docker contain which is why I'm trying to install it as part of the startup, however I was able to modify my scripts to install the feature ahead of time. I'm now hitting an issue where the feature manager doesn't finishes installing the features after the server has already attempted load my osgi application which is also defined in the server.xml as: Is there a way to order the commands in the server.xml so that the feature manager finishes before the call to start the app? – Adam Nov 30 '16 at 15:35
  • can you update your original question with the script you are trying to use? The installUtility command won't return until the feature installation has completed. If you are putting the commands sequentially in a script, it should work. – Andy Guibert Dec 03 '16 at 19:37
0

I think you may be confusing the documentation for the featureManager command which has been superseded by the installUtility command. Adding a feature to the featureManager element of your server.xml doesn't install the feature, it enables it. In order to enable a feature in server.xml, you must first install it using one of the methods described here.

F Rowe
  • 2,042
  • 1
  • 11
  • 12
  • Thanks for your response, I'm running Liberty in a docker contain which is why I'm trying to install it as part of the startup, however I was able to modify my scripts to install the feature ahead of time. I'm now hitting an issue where the feature manager doesn't finishes installing the features after the server has already attempted load my osgi application which is also defined in the server.xml as: Is there a way to order the commands in the server.xml so that the feature manager finishes before the call to start the app? – Adam Nov 30 '16 at 15:32
  • That shouldn't be possible. If that happens you should raise a PMR. – Alasdair Nov 30 '16 at 15:37
  • As Alasdair stated, the situation you describe shouldn't be possible. The declarative services componentry of Liberty should always make all features required by your apps available before starting your app. But you said "the feature manager doesn't finishes installing the features after the server has already attempted load..." Remember, the feature manager doesn't install features, it enables them, and as you said, you must install the feature before starting the server in which you've configured featureManager to use it. Can you post some logs showing why you think this is occurring? – F Rowe Nov 30 '16 at 17:54