Liferay’s OSGi Runtime framework sometimes throws an
IllegalContextNameException
. Often, this is because an OSGi bundle’s
Bundle-SymbolicName
manifest header has a space in it.
The Bundle-SymbolicName
uniquely identifies the bundle—along with the
Bundle-Version
manifest header—and cannot contain spaces. To follow naming
best practices, use a reverse-domain name in your Bundle-SymbolicName
. For
example, a module with the domain troubleshooting.liferay.com
would be
reversed to com.liferay.troubleshooting.
.
There are three ways to specify a bundle’s Bundle-SymbolicName
:
-
Bundle-SymbolicName
header in a bundle’sbnd.bnd
file. -
Bundle-SymbolicName
header in a plugin WAR’sliferay-plugin-package.properties
file. -
Plugin WAR file name, if the WAR’s
liferay-plugin-package.properties
has noBundle-SymbolicName
header.
For plugin WARs, specifying the Bundle-SymbolicName
in the
liferay-plugin-package.properties
file is preferred.
For example, if you deploy a plugin WAR that has no Bundle-SymbolicName
header
in its liferay-plugin-package.properties
, the WAB
Generator
uses the WAR’s name as the WAB’s Bundle-SymbolicName
. If the WAR’s name has a
space in it (e.g., space-program-theme v1.war
) an
IllegalContextNameException
occurs on deployment.
org.apache.catalina.core.ApplicationContext.log The context name 'space-program-theme v1' does not follow Bundle-SymbolicName syntax.
org.eclipse.equinox.http.servlet.internal.error.IllegalContextNameException: The context name 'space-program-theme v1' does not follow Bundle-SymbolicName syntax.
However you set your a Bundle-SymbolicName
, refrain from using spaces.