Improve install-library Command validation rule in WebSphere Application Server Community Edition 3.0.0.3

Technote (troubleshooting)


Problem(Abstract)

The Command "install-library" is used to install a Java library file into to the server, the library file will be converted into an OSGi bundle by the server. But if you install a file named "mylib-1.jar", you will fail with an Error which show you should follow file name form <artifactId>-<version>.<type>, However, the name mylib-1.jar does follow that form.

Symptom

To reproduce the issue, you can follow the steps:
1. Start the server.
2. Run the command below under the directory <wasce-home>\bin.
deploy install-library --groupId test.sample E:\mylib-1.jar

Meet the error below.

2013-06-04 16:47:50,700 ERROR [DeployTool] Error:
org.apache.geronimo.common.DeploymentException: Unable to install library E:\mylib-1.jar
at org.apache.geronimo.deployment.cli.CommandInstallLibrary.execute(CommandInstallLibrary.java:59)
at org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java:171)
at org.apache.geronimo.system.main.MainBridge.execute(MainBridge.java:64)
at org.apache.geronimo.main.Bootstrapper.execute(Bootstrapper.java:68)
at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:65)
at org.apache.geronimo.cli.deployer.DeployerCLI.main(DeployerCLI.java:32)
Caused by: java.lang.IllegalArgumentException: Can not calculate Artifact string, file should be:
(1) an OSGi bundle, then the artifactId is its Bundle-SymbolicName and the version is its Bundle-Version;
(2) or a file with filename in the form <artifactId>-<version>.<type>, for e.g. mylib-1.0.jar
at org.apache.geronimo.system.plugin.PluginInstallerGBean.installLibrary(PluginInstallerGBean.java:1140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131)
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:883)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245)
at org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:344)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131)
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:883)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245)
at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(MBeanGBeanBridge.java:172)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:447)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)
at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
at java.security.AccessController.doPrivileged(AccessController.java:284)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1367)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:310)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(AccessController.java:284)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:736)

The root cause is the version parsing logic does not comply with the Maven or OSGi version rule, so it can not extract the version correct from the file name like mylib-1.jar.


Resolving the problem

To fix the issue, please refer the instruction below:

1. Download the patch file:InstallLibraryImprovement.zipInstallLibraryImprovement.zip

2. Unzip the attached file into the WebSphere Application Server Community Edition installation directory, and ensure the files listed in the zip file to replace the ones in the server installation.

3. Start the server with the cache cleaned, for example,
<WAS_CE_HOME>\bin\startup -c
<WAS_CE_HOME>/bin/startup.sh -c

Please pay attention whether the library file follows the standard Maven and OSGi version rule when you install it to server.

Maven version rule:
<major>.<minor>.<revision>([-<qualififer>]|[-<build>])
major ::= number
minor ::= number
micro ::= number
qualifier ::= (alphanum)+
build ::= [1-9]?[0-9]*

OSGi bundle version rule:
version ::= major(','minor('.'micro('.'('.'qualifier)?)?)?
major ::= number
minor ::= number
micro ::= number
qualifier ::= (alphanum|'_')+
A version must not contain any white space.

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

WebSphere Application Server Community Edition

Software version:

3.0.0.3

Operating system(s):

AIX, Linux, Solaris, Windows

Reference #:

1639446

Modified date:

2014-05-19

Translate my page

Machine Translation

Content navigation