When coding on any platform, you can sometimes run into issues that have no clear resolution. This can be particularly frustrating. If you have issues building, deploying, or running modules, you want to resolve them fast. These tutorials help you to troubleshoot problems that arise based on the underlying OSGi platform, and then correct them.

Resolving Bundle Requirements

If one of your bundles imports a package that no other bundle in the Liferay OSGi runtime exports, you get a bundle exception. Here’s an example exception: ! could not resolve the bundles:...

Read More

Resolving Bundle-SymbolicName Syntax Issues

An OSGi bundle’s Bundle-SymbolicName and Bundle-Version manifest headers uniquely identify it. You can specify a bundle’s Bundle-SymbolicName in these ways: Bundle-SymbolicName header in a bundle’s...

Read More

Why Aren’t my Module’s JavaScript and CSS Changes Showing?

To determine why JavaScript and CSS updates to your module aren’t having an effect in your browser, perform these checks: If you’re developing a portlet module, check that your portlet class has...

Read More

Resolving ClassNotFoundException and NoClassDefFoundError in OSGi Bundles

Understanding a ClassNotFoundException or NoClassDefFoundError in non-OSGi environments is straightforward. ClassNotFoundException: thrown when looking up a class that isn’t on the classpath or...

Read More

Why Aren’t JSP overrides I Made Using Fragments Showing?

The fragment module must specify the exact version of the host module. A Liferay Portal upgrade might have changed some JSPs in the host module, prompting a version update. If this occurs, check...

Read More

Connecting to Data Sources Using JNDI

Your application server’s Java Naming and Directory Interface (JNDI) implementation lets you access data outside Liferay Portal’s default data source. Liferay Portal CE 7.0’s OSGi runtime requires...

Read More

Detecting Unresolved OSGi Components

Liferay Portal includes Gogo shell commands that come in handy when trying to diagnose a problem due to an unresolved OSGi component. The specific tools to use depend on the component framework of...

Read More

Adjusting Module Logging

Liferay Portal uses Log4j logging services. You can configure logs for any module. Here’s how: Create the folder [Liferay_Home]/osgi/log4j if it’s not there. In the log4j folder, create a...

Read More

Implementing Logging

Liferay Portal CE 7.0 uses the Log4j logging framework, but a different one may eventually replace it. It’s a best practice to use Simple Logging Facade for Java (SLF4J) to log messages in your...

Read More

Using OSGi Services from EXT Plugins

Using OSGi services from an Ext plugin is done the same way that Liferay Portal’s core uses OSGi services: via the com.liferay.registry API provided by the registry-api bundle. All usages of this...

Read More

Calling Non-OSGi Code that Uses OSGi Services

Liferay Portal’s static utility functions (e.g., UserServiceUtil, CompanyServiceUtil, GroupServiceUtil, etc.) are examples of non-OSGi code that use OSGi services. Note that it’s safer to track and...

Read More

Identifying Liferay Artifact Versions for Dependencies

When you’re developing a Liferay Portal application, it’s often necessary to use various Liferay Portal APIs or tools. For example, you might want to create a Service Builder application or use...

Read More

Declaring Optional Import Package Requirements

When developing Liferay Portal modules, you can declare optional dependencies. An optional dependency is one your module can use if it’s available, but can still function without it. Important: Try...

Read More
0 (0 Votes)
Overriding Reluctant Service References Previous