Adding dependency module for portlet deployed in Liferay Jboss

Liferay adds jboss-deployment descriptor, when we deploy a portlet on Liferay-Jboss container, which is used for controlling the class loading. And by default it excludes all the javaee dependencies from the class path.

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
	<deployment>
		<exclusions>
			<module name="javaee.api" />
			<module name="org.apache.log4j" />
		</exclusions>
		<dependencies>
			<module meta-inf="export" name="com.liferay.portal">
				<imports>
					<include path="META-INF" />
				</imports>
			</module>			
			<module name="javax.mail.api" />
			<module name="org.jboss.modules" />
		</dependencies>
	</deployment>
</jboss-deployment-structure>

In case, a specific javaee module is required by your portlet. we can add that specific module in jboss-deployment-structure file, to make that module available to your portlet.

e.g. in my case, portlet was using the JAX-WS APIs. And I have added the following configuration, to make this module available to my portlet

 <module name="javax.xml.ws.api" />
About these ads

One thought on “Adding dependency module for portlet deployed in Liferay Jboss

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s