5 Replies Latest reply: Nov 15, 2011 10:40 AM by Markus Staab RSS

Portletbridge not usable on a per portlet base

Markus Staab Newbie

Hi,

 

today I updated our portlets from PortletBridge 1.0 to 2.2.0-FINAL.

 

In the past we were used to bundle the PortletBridge into each WAR-Archive (so we release the portlets with their corresponding portlet bridge).

When rendering a Portal-Page with the new PortletBridge 2.2.0-FINAL, the bridge was unable to find a BridgeStrategy

( in my case org.jboss.portletbridge.richfaces.RichFacesStrategy). This leads to an BridgeException.

 

I downloaded the source of the Bridge and started the debugger. The Bridge uses the ClassLoader of the Portal to find the RichFacesStrategy and since our portal doesn't provide the bridge-impl/api he is not able to find the class.

 

Is the classloading modified in this way by design?

Why does the classloader not use the loader of the portlet's webapp?

Is the new PortletBridge not meant to be shipped with a Portlet in a WAR-File?

 

I found the following comment in the BridgeStrategy.class:



// use contextClassLoader to load strategies, because when bridge-impl.jar is


// shared classes visible by application would be different.


ClassLoader loader = Thread.currentThread().getContextClassLoader();

 

 

Java 1.6

Liferay 5.2.3

 

Regards,

Markus