掲示板

JSF portlet + Service BUilder - Liferay 7 - Deployment problems

7年前 に Nuno Fontes によって更新されました。

JSF portlet + Service BUilder - Liferay 7 - Deployment problems

New Member 投稿: 4 参加年月日: 16/01/05 最新の投稿
Hi,

I am developing a JSF portlet and call a service builder on it. I read the documentation and follow its instructions. You can see it in the code below


@RequestScoped
@ManagedBean(name = "changePin")
public class ChangePin {

	//-Properties
	private static Logger logger = Logger.getLogger(ChangePin.class);

	private Integer newPin;
	private Integer newPinConfirmation;
	private ChangePinLocalServiceTracker changePinLocalServiceTracker;

	@PostConstruct
	public void postConstruct() {
	    Bundle bundle = FrameworkUtil.getBundle(this.getClass());
	    BundleContext bundleContext = bundle.getBundleContext();
	    changePinLocalServiceTracker = new ChangePinLocalServiceTracker(bundleContext);
	    changePinLocalServiceTracker.open();
	}
	
	@PreDestroy
	public void preDestroy() {
		changePinLocalServiceTracker.close();
	}
	
	//-Actions
	public String submit() {

		System.out.println("################# submit method ###############+++++++++++");

		HBPinManagement_1_0LocalService changePinLocalService = changePinLocalServiceTracker.getService();
		
		changePinLocalService.changePin(1234567, 666666);
		
		return "view";
	}

	//-Getters/Setters

}



public class ChangePinLocalServiceTracker extends ServiceTracker<hbpinmanagement_1_0localservice, hbpinmanagement_1_0localservice> {
	
	public ChangePinLocalServiceTracker(BundleContext bundleContext) {
        super(bundleContext, HBPinManagement_1_0LocalService.class, null);
    }
	
}
</hbpinmanagement_1_0localservice,>



<dependencies>
		<dependency>
			<groupid>commons-fileupload</groupid>
			<artifactid>commons-fileupload</artifactid>
			<version>1.3.1</version>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupid>commons-io</groupid>
			<artifactid>commons-io</artifactid>
			<version>2.4</version>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupid>javax.faces</groupid>
			<artifactid>javax.faces-api</artifactid>
			<version>${faces.api.version}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupid>org.glassfish</groupid>
			<artifactid>javax.faces</artifactid>
			<version>${mojarra.version}</version>
			<scope>runtime</scope>
		</dependency>

		<dependency>
			<groupid>com.liferay.faces</groupid>
			<artifactid>com.liferay.faces.bridge.ext</artifactid>
			<version>${liferay.faces.bridge.ext.version}</version>
		</dependency>

		<dependency>
			<groupid>com.liferay.faces</groupid>
			<artifactid>com.liferay.faces.bridge.impl</artifactid>
			<version>${liferay.faces.bridge.version}</version>
		</dependency>

		<dependency>
			<groupid>log4j</groupid>
			<artifactid>log4j</artifactid>
			<version>1.2.14</version>
		</dependency>

		<dependency>
	                <groupid>org.osgi</groupid>
	               <artifactid>org.osgi.service.component.annotations</artifactid>
	              <version>${org.osgi.service.component.annotations.version}</version>
	    </dependency>

		<dependency>
			<groupid>com.liferay.portal</groupid>
			<artifactid>com.liferay.portal.kernel</artifactid>
			<version>${com.liferay.portal.kernel.version}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
		    <groupid>org.osgi</groupid>
		    <artifactid>org.osgi.util.tracker</artifactid>
		    <version>${org.osgi.util.tracker.version}</version>
		    <scope>provided</scope>
		</dependency>

		<dependency>
		    <groupid>org.osgi</groupid>
		    <artifactid>org.osgi.core</artifactid>
		    <version>${org.osgi.core.version}</version>
		    <scope>provided</scope>
		</dependency>
<dependencies>
</dependencies></dependencies>


LiferayPortal 7 GA3/liferay-ce-portal-7.0-ga3/osgi/war][com_liferay_portal_osgi_web_wab_extender:97] Catastrophic initialization failure! Shutting down changePin-100 WAB due to: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
at com.liferay.portal.osgi.web.wab.extender.internal.adapter.ServletContextListenerExceptionAdapter.contextInitialized(ServletContextListenerExceptionAdapter.java:51)
at sun.reflect.GeneratedMethodAccessor467.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.http.servlet.internal.registration.ListenerRegistration$EventListenerInvocationHandler.invoke(ListenerRegistration.java:132)
at com.sun.proxy.$Proxy479.contextInitialized(Unknown Source)
at org.eclipse.equinox.http.servlet.internal.context.ContextController.doAddListenerRegistration(ContextController.java:359)
at org.eclipse.equinox.http.servlet.internal.context.ContextController.addListenerRegistration(ContextController.java:312)
at org.eclipse.equinox.http.servlet.internal.customizer.ContextListenerTrackerCustomizer.addingService(ContextListenerTrackerCustomizer.java:67)
at org.eclipse.equinox.http.servlet.internal.customizer.ContextListenerTrackerCustomizer.addingService(ContextListenerTrackerCustomizer.java:1)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:917)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:482)
at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:1001)
at com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.initListeners(WabBundleProcessor.java:526)
at com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.init(WabBundleProcessor.java:152)
at com.liferay.portal.osgi.web.wab.extender.internal.WebBundleDeployer._initWabBundle(WebBundleDeployer.java:186)
at com.liferay.portal.osgi.web.wab.extender.internal.WebBundleDeployer.doStart(WebBundleDeployer.java:106)
at com.liferay.portal.osgi.web.wab.extender.internal.WabFactory$WABExtension.start(WabFactory.java:162)
at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)
at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:1)
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)
at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)
at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:905)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)
at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)
at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)
at org.eclipse.osgi.container.Module.publishEvent(Module.java:461)
at org.eclipse.osgi.container.Module.start(Module.java:452)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1252)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1224)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:313)
Caused by: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:764)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:353)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:227)
... 52 more
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:751)
... 54 more
Caused by: java.lang.NullPointerException
at com.liferay.faces.bridge.ext.mojarra.spi.internal.ConfigurationResourceProviderBase.getResourcesPattern(ConfigurationResourceProviderBase.java:51)
at com.liferay.faces.bridge.ext.mojarra.spi.internal.FacesConfigResourceProviderLiferayImpl.getResources(FacesConfigResourceProviderLiferayImpl.java:39)
at com.sun.faces.config.ConfigManager$URITask.call(ConfigManager.java:1362)
at com.sun.faces.config.ConfigManager$URITask.call(ConfigManager.java:1331)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:742)
... 54 more
16:54:37,263 INFO [fileinstall-C:/XPANDIT/CFG LiferayPortal 7 GA3/liferay-ce-portal-7.0-ga3/osgi/war][PortletHotDeployListener:364] Unregistering portlets for changePin-100
16:54:37,274 WARN [BridgeImpl:72]
16:54:37,278 INFO [fileinstall-C:/XPANDIT/CFG LiferayPortal 7 GA3/liferay-ce-portal-7.0-ga3/osgi/war][PortletHotDeployListener:394] 1 portlet for changePin-100 was unregistered
05-Jan-2017 16:54:37.280 INFO [fileinstall-C:/XPANDIT/CFG LiferayPortal 7 GA3/liferay-ce-portal-7.0-ga3/osgi/war] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext

And this is the exception that I got.

Does anyone know what may be causing the problem?

Thanks
7年前 に Nuno Fontes によって更新されました。

RE: JSF portlet + Service BUilder - Liferay 7 - Deployment problems

New Member 投稿: 4 参加年月日: 16/01/05 最新の投稿
Has anyone successfully tracked or called a *LocalService on a JSF portlet?

Thanks
thumbnail
7年前 に Vernon Singleton によって更新されました。

RE: JSF portlet + Service BUilder - Liferay 7 - Deployment problems

Expert 投稿: 315 参加年月日: 13/01/14 最新の投稿
Hi Nuno,

Nuno Fontes:
Has anyone successfully tracked or called a *LocalService on a JSF portlet?

The primefaces-user-portlet demo does exactly that. Take a look at this code the code here to see for yourself.

Nuno Fontes:
I am developing a JSF portlet and call a service builder on it. I read the documentation and follow its instructions. You can see it in the code below

For the error(s) you noted, could you provide a short, self-contained, example that we could use to re-produce the errors? If you can do that, I would be happy to help you get your issue fixed.

By the way, did you start with one of our archetypes to make your project? It is a quick way to create a new working portlet, and it will help you get the versions correct for many of the basic jars you will need.

Hope that helps,
Vernon
7年前 に Nuno Fontes によって更新されました。

RE: JSF portlet + Service BUilder - Liferay 7 - Deployment problems

New Member 投稿: 4 参加年月日: 16/01/05 最新の投稿
Hi Vernon,

Thank your for your reply.

I am using this one: 25: remote -> com.liferay.faces.archetype:com.liferay.faces.archetype.jsf.portlet (Maven archetype for a Liferay JSF portlet)
thumbnail
7年前 に Vernon Singleton によって更新されました。

RE: JSF portlet + Service BUilder - Liferay 7 - Deployment problems

Expert 投稿: 315 参加年月日: 13/01/14 最新の投稿
Hi Nuno,

Nuno Fontes:
I am using this one: 25: remote -> com.liferay.faces.archetype:com.liferay.faces.archetype.jsf.portlet (Maven archetype for a Liferay JSF portlet)

That looks like a good archetype to use, as long as it is the one for Liferay 7 in your case.

Did you get a chance to try the primefaces user portlet, and take a look at its example source that shows how to use a local service?

- Vernon
7年前 に Nuno Fontes によって更新されました。

RE: JSF portlet + Service BUilder - Liferay 7 - Deployment problems

New Member 投稿: 1 参加年月日: 17/01/11 最新の投稿
Thanks Vernon,

Problem solved!

Thank you!
thumbnail
7年前 に Vernon Singleton によって更新されました。

RE: JSF portlet + Service BUilder - Liferay 7 - Deployment problems

Expert 投稿: 315 参加年月日: 13/01/14 最新の投稿
Hi Nuno,

Nuno Fontes:
Problem solved!

Thank you!

Glad you were able to get it working.
Enjoy.
thumbnail
6年前 に Antonio Musarra によって更新されました。

RE: JSF portlet + Service BUilder - Liferay 7 - Deployment problems

Junior Member 投稿: 66 参加年月日: 11/08/09 最新の投稿
Hi Nuno.
How to you resolved?
I followed the guide and I get the error.

Thanks,
Antonio
thumbnail
6年前 に Kyle Joseph Stiemann によって更新されました。

RE: JSF portlet + Service BUilder - Liferay 7 - Deployment problems

Liferay Master 投稿: 760 参加年月日: 13/01/14 最新の投稿
Please don't revive dead threads. Instead, create a new post and quote or link to the relevant details in the dead thread. This thread is now locked.

- Kyle