Fórum

Liferay 7 (DXP) Spring MVC accessing service builder generated services

thumbnail
Ankit Pancholi, modificado 7 Anos atrás.

Liferay 7 (DXP) Spring MVC accessing service builder generated services

Junior Member Postagens: 78 Data de Entrada: 07/01/10 Postagens Recentes
Hello,

I am facing following issue while accessing services (generated through service builder) from Spring MVC, I read through forums link and tried to use Service Tracker to access service in my Controller.

here's my SpringTestPortletViewController.java


@Controller
@RequestMapping("VIEW")
public class SpringTestPortletViewController {
	
	private FooServiceTracker fooServiceTracker;
	@PostConstruct 
	public void init(){
		 fooServiceTracker=new FooServiceTracker(this); 
		 fooServiceTracker.open(); 
	}
	@PreDestroy public void destroy(){ 
		 fooServiceTracker.close(); 
	}

	@RenderMapping
	public String question(Model model) {
		try {
			if(!fooServiceTracker.isEmpty()){
				FooLocalService fooLocalService=fooServiceTracker.getService();
				fooLocalService.saveFoo(); 
				System.out.println("----" + FooLocalServiceUtil.getFoosCount());
			}
        } catch (Exception e) {
			e.printStackTrace();
		}
		return "SpringTest/view";
	}
}


FooServiceTracker.java
public class FooServiceTracker extends ServiceTracker<foolocalservice,foolocalservice>{

	public FooServiceTracker(Object host){
		super(FrameworkUtil.getBundle(host.getClass()).getBundleContext(), FooLocalService.class, null);
	}
}</foolocalservice,foolocalservice>


Facing below issue, during deployment of Spring MVC Portlet. It is unable to get bundle i.e.
FrameworkUtil.getBundle(SpringTestPortletViewController.getClass())
is coming null

11:49:48,432 INFO  [Refresh Thread: Equinox Container: 6095db50-baf9-0016-1a03-97f126c9b821][PortletHotDeployListener:202] Registering portlets for SpringTest-portlet
11:49:48,649 ERROR [Refresh Thread: Equinox Container: 6095db50-baf9-0016-1a03-97f126c9b821][DispatcherPortlet:279] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springTestPortletViewController': Invocation of init method failed; nested exception is java.lang.NullPointerException
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
	at org.springframework.web.portlet.FrameworkPortlet.createPortletApplicationContext(FrameworkPortlet.java:368)
	at org.springframework.web.portlet.FrameworkPortlet.initPortletApplicationContext(FrameworkPortlet.java:297)
	at org.springframework.web.portlet.FrameworkPortlet.initPortletBean(FrameworkPortlet.java:271)
	at org.springframework.web.portlet.GenericPortletBean.init(GenericPortletBean.java:124)
	at javax.portlet.GenericPortlet.init(GenericPortlet.java:136)
	at com.liferay.portlet.InvokerPortletImpl.init(InvokerPortletImpl.java:296)
	at com.liferay.portlet.PortletInstanceFactoryImpl.init(PortletInstanceFactoryImpl.java:294)
	at com.liferay.portlet.PortletInstanceFactoryImpl.create(PortletInstanceFactoryImpl.java:193)
	at com.liferay.portal.kernel.portlet.PortletInstanceFactoryUtil.create(PortletInstanceFactoryUtil.java:49)
	at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:217)
	at com.liferay.portal.service.impl.PortletLocalServiceImpl.initWAR(PortletLocalServiceImpl.java:858)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:153)
	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:174)
	at com.sun.proxy.$Proxy123.initWAR(Unknown Source)
	at com.liferay.portal.kernel.service.PortletLocalServiceUtil.initWAR(PortletLocalServiceUtil.java:327)
	at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:210)
	at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:95)
	at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:237)
	at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:104)
	at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:28)
	at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:164)
	at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:154)
	at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:44)
	at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:74)
	at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:58)
	at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:54)
	at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:116)
	at com.liferay.portal.kernel.servlet.SecurePluginContextListener.contextInitialized(SecurePluginContextListener.java:151)
	at com.liferay.portal.osgi.web.wab.extender.internal.adapter.ServletContextListenerExceptionAdapter.contextInitialized(ServletContextListenerExceptionAdapter.java:51)
	at sun.reflect.GeneratedMethodAccessor487.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.$Proxy491.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:153)
	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:163)
	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.framework.util.SecureAction.start(SecureAction.java:454)
	at org.eclipse.osgi.container.ModuleContainer.applyDelta(ModuleContainer.java:717)
	at org.eclipse.osgi.container.ModuleContainer.resolveAndApply(ModuleContainer.java:491)
	at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:437)
	at org.eclipse.osgi.container.ModuleContainer.refresh(ModuleContainer.java:955)
	at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1336)
	at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.lang.NullPointerException
	at com.service.tracker.FooServiceTracker.<init>(FooServiceTracker.java:11)
	at SpringTest.SpringTestPortletViewController.init(SpringTestPortletViewController.java:43)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:354)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:305)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
	... 98 more</init>



Any help here is appreciated,

Thanks
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: Liferay 7 (DXP) Spring MVC accessing service builder generated services

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Have you tried using the Util classes?

Yes, I know the note says they should be avoided, but you have to understand the context.

If the service implementation has not been deployed, yes that is a problem, but really not much different than the problem you'd face w/ a bunch of NPEs on the service anyway.

And no, it doesn't handle the dynamic nature of OSGi very well, but ask yourself if it really needs to. OSGi handles things such as if you have a Shape interface and you're adding and removing components of different shapes. When your component set is expected to change at runtime, you need the dynamic support built into OSGi to deal correctly with changes in the set.

But we're talking a service builder implementation here. You're not going to have a bunch of these different implementations deployed, you're not going to be swapping them at runtime, it should be a very stable environment for the Util classes to operate in.

From an OSGi implementation perspective, it may not be considered the "pure path", but I tend to care less about pure solutions as much as I care about working solutions.

Now the NPE happening in the init method? Likely OSGi cannot find the bundle bound to the current class that is part of the war even though it is converted to a wab during deployment.
thumbnail
Ankit Pancholi, modificado 7 Anos atrás.

RE: Liferay 7 (DXP) Spring MVC accessing service builder generated services

Junior Member Postagens: 78 Data de Entrada: 07/01/10 Postagens Recentes
Hi David,

Yes I figured the class is part of the war and the OSGi is unable to get the bundle context for the same during deployment, could not find what is the fix here ?

Service builder module is already deployed, Issues is while accessing it from Spring MVC Portlet. I tried giving the api jar in lib folder of Spring MVC portlet, I am not sure what is the best way to give dependency for modules in Spring MVC portlet ?

Yes agree with Liferay service builder implementation, it would be more stable and we might not require to use dynamic behavior of OSGi runtime. So accessing with Util should also be fine as far as the solution is working .

I had tried accessing it through Util class as well, it throws below exception of class loader in the Util class (generated through service-builder module)

FooLocalServiceUtil.java
public static FooLocalService getService() {
	return _serviceTracker.getService();
}

private static ServiceTracker<foolocalservice, foolocalservice> _serviceTracker =
	ServiceTrackerFactory.open(FooLocalService.class);</foolocalservice,>


Error log:


06:37:07,696 ERROR [http-nio-8080-exec-9][PortletServlet:109] javax.portlet.PortletException: Error occured during request processing: loader constrai
nt violation: when resolving method "com.liferay.osgi.util.ServiceTrackerFactory.open(Ljava/lang/Class;)Lorg/osgi/util/tracker/ServiceTracker;" the cl
ass loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) of the current class, com/foo/service/FooLocalServiceUtil, and the class
loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) for the method's defining class, com/liferay/osgi/util/ServiceTrackerFactory,
 have different Class objects for the type org/osgi/util/tracker/ServiceTracker used in the signature
javax.portlet.PortletException: Error occured during request processing: loader constraint violation: when resolving method "com.liferay.osgi.util.Ser
viceTrackerFactory.open(Ljava/lang/Class;)Lorg/osgi/util/tracker/ServiceTracker;" the class loader (instance of org/eclipse/osgi/internal/loader/Equin
oxClassLoader) of the current class, com/foo/service/FooLocalServiceUtil, and the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxCl
assLoader) for the method's defining class, com/liferay/osgi/util/ServiceTrackerFactory, have different Class objects for the type org/osgi/util/track
er/ServiceTracker used in the signature
        at org.springframework.web.portlet.DispatcherPortlet.doRenderService(DispatcherPortlet.java:805)
        at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:537)
        at org.springframework.web.portlet.FrameworkPortlet.doDispatch(FrameworkPortlet.java:483)
        at javax.portlet.GenericPortlet.render(GenericPortlet.java:262)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
        at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:105)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at com.liferay.portal.osgi.web.wab.extender.internal.adapter.ServletExceptionAdapter.service(ServletExceptionAdapter.java:68)
        at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
        at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:50)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:99)
        at com.liferay.portal.osgi.web.wab.extender.internal.adapter.FilterExceptionAdapter.doFilter(FilterExceptionAdapter.java:46)
        at org.eclipse.equinox.http.servlet.internal.registration.FilterRegistration.doFilter(FilterRegistration.java:121)
        at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:45)
        at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:70)
        at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:117)
        at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
        at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:530)
        at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:605)
        at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:391)
        at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1539)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:99)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:523)
        at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:67)
        at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
        at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
        at com.liferay.portlet.PortletContainerImpl._render(PortletContainerImpl.java:671)
        at com.liferay.portlet.PortletContainerImpl.render(PortletContainerImpl.java:145)
        at com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrapper.java:126)
        at com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrapper.java:126)
        at com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:155)
        at com.liferay.portal.layoutconfiguration.util.PortletRenderer._render(PortletRenderer.java:126)
        at com.liferay.portal.layoutconfiguration.util.PortletRenderer.render(PortletRenderer.java:73)
        at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doProcessTemplate(RuntimePageImpl.java:444)
        at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doDispatch(RuntimePageImpl.java:286)
        at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.processTemplate(RuntimePageImpl.java:113)
        at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.processTemplate(RuntimePageImpl.java:125)
        at com.liferay.portal.kernel.layoutconfiguration.util.RuntimePageUtil.processTemplate(RuntimePageUtil.java:70)
        at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portlet_jsp.java:747)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:99)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:523)
        at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:67)
        at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
        at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
        at com.liferay.portal.model.impl.LayoutTypeControllerImpl.includeLayoutContent(LayoutTypeControllerImpl.java:168)
        at com.liferay.portal.model.impl.LayoutImpl.includeLayoutContent(LayoutImpl.java:875)
        at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:339)
        at com.liferay.portal.action.LayoutAction.doExecute(LayoutAction.java:178)
        at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:75)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
        at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:170)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
        at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:603)
        at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:580)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.monitoring.internal.servlet.filter.MonitoringFilter.processFilter(MonitoringFilter.java:180)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.servlet.filters.uploadservletrequest.UploadServletRequestFilter.processFilter(UploadServletRequestFilter.java:93)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:310)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:99)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:466)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318)
        at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:169)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.monitoring.internal.servlet.filter.MonitoringFilter.processFilter(MonitoringFilter.java:180)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.servlet.filters.uploadservletrequest.UploadServletRequestFilter.processFilter(UploadServletRequestFilter.java:93)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:338)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:125)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:310)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:338)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:86)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:268)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:88)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:257)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
        at com.liferay.portal.servlet.filters.urlrewrite.UrlRewriteFilter.processFilter(UrlRewriteFilter.java:65)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:99)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "com.liferay.osgi.util.ServiceTrackerFactory.open(Ljava/lang/Cla
ss;)Lorg/osgi/util/tracker/ServiceTracker;" the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) of the current class, c
om/foo/service/FooLocalServiceUtil, and the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) for the method's defining c
lass, com/liferay/osgi/util/ServiceTrackerFactory, have different Class objects for the type org/osgi/util/tracker/ServiceTracker used in the signatur
e
        at com.foo.service.FooLocalServiceUtil.<clinit>(FooLocalServiceUtil.java:313)
        at SpringTest.SpringTestPortletViewController.question(SpringTestPortletViewController.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:178)
        at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:369)
        at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.doHandle(AnnotationMethodHandlerAdapter.java:356)
        at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.handleRender(AnnotationMethodHandlerAdapter.java:296)
        at org.springframework.web.portlet.DispatcherPortlet.doRenderService(DispatcherPortlet.java:764)
        ... 232 more
06:37:07,857 ERROR [http-nio-8080-exec-9][render_portlet_jsp:131] null
java.lang.LinkageError: loader constraint violation: when resolving method "com.liferay.osgi.util.ServiceTrackerFactory.open(Ljava/lang/Class;)Lorg/os
gi/util/tracker/ServiceTracker;" the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) of the current class, com/foo/serv
ice/FooLocalServiceUtil, and the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) for the method's defining class, com/l
iferay/osgi/util/ServiceTrackerFactory, have different Class objects for the type org/osgi/util/tracker/ServiceTracker used in the signature
        at com.foo.service.FooLocalServiceUtil.<clinit>(FooLocalServiceUtil.java:313)
        at SpringTest.SpringTestPortletViewController.question(SpringTestPortletViewController.java:60)
        at javax.portlet.GenericPortlet.render(GenericPortlet.java:262)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
        at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:105)</clinit></clinit>
thumbnail
Ankit Pancholi, modificado 7 Anos atrás.

RE: Liferay 7 (DXP) Spring MVC accessing service builder generated services

Junior Member Postagens: 78 Data de Entrada: 07/01/10 Postagens Recentes
I copied the service builder module api jar in tomcat/lib/ext restarted the server and then accessed the Util class in Spring MVC portlet it worked.
But need some direction here for the best practices, to handle such dependencies of service builder module jars in Spring MVC portlet ?
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: Liferay 7 (DXP) Spring MVC accessing service builder generated services

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
There's no way this worked.

There are property keys in place that mask most classes/packages in the global class loader out of the OSGi runtime.

Putting those two jars in global class loader, there's zero chance that the modules would be loaded and available to OSGi.
thumbnail
Ankit Pancholi, modificado 7 Anos atrás.

RE: Liferay 7 (DXP) Spring MVC accessing service builder generated services (Resposta)

Junior Member Postagens: 78 Data de Entrada: 07/01/10 Postagens Recentes
David H Nebinger:
There's no way this worked.

There are property keys in place that mask most classes/packages in the global class loader out of the OSGi runtime.

Putting those two jars in global class loader, there's zero chance that the modules would be loaded and available to OSGi.


Hello David, to clarify better I meant to say I copied api jar in tomcat lib/ext/ folder, in order to access Util class in Spring MVC portlet.
Service Builder module projects i.e api and service jars are already deployed and available as OSGi module as first place.

I am still seeking answer for recommended way to give service builder module dependency in Spring MVC portlet ?
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: Liferay 7 (DXP) Spring MVC accessing service builder generated services

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Waheed Khan, modificado 6 Anos atrás.

RE: Liferay 7 (DXP) Spring MVC accessing service builder generated services

New Member Postagens: 6 Data de Entrada: 08/04/16 Postagens Recentes
Hi David,
I am new to Liferay DXP , can you please guide me to create Spring MVC module?
Any hint will be appreciated.

Thanks a ton in advance.
Venkat Keesara, modificado 6 Anos atrás.

RE: Liferay 7 (DXP) Spring MVC accessing service builder generated services

New Member Postagens: 4 Data de Entrada: 08/08/17 Postagens Recentes
Please follow one of these for spring mvc project samples

http://www.opensource-techblog.com/2012/09/spring-mvc-portlet-in-liferay.html
https://github.com/psvehla/liferay-spring-mvc-portlet