【发布时间】:2020-06-09 10:24:38
【问题描述】:
我实现了一个 Liferay 7.2 portletmvc4spring 模块,我遵循了本教程https://github.com/liferay/portletmvc4spring/blob/master/README.md,但是在将此 portlet 部署到 Lr7.2 实例时遇到了问题(我在 google 中搜索但没有找到具体的解决方案)也许有人过去有同样的问题,也许可以帮助......
问题如下:
2020-01-06 20:36:43.468 错误 [fileinstall-/usr/share/porttail/liferay-portal-7.2.0-ga1/osgi/war][WebXMLDefinitionLoader:1130] baseLr7Portlet_1.0.0 [1148] una java.lang.ClassCastException:类 com.liferay.portletmvc4spring.ViewRendererServlet
java.lang.ClassCastException: com.liferay.portletmvc4spring.DispatcherPortlet 无法转换为 javax.portlet.Portlet
完整的跟踪如下:
2020-01-06 20:36:13.337 信息 [fileinstall-/usr/share/porttail/liferay-portal-7.2.0-ga1/osgi/war][BaseAutoDeployListener:43] 复制 /usr/share/peLr7Portlet.war 的 portlet 2020-01-06 20:36:13.378 信息 [fileinstall-/usr/share/porttail/liferay-portal-7.2.0-ga1/osgi/war][BaseDeployer:877] 部署 baseLr7Portlet.war 警告:META-INF/MANIFEST.MF 已修改 将来。警告: META-INF/maven/com.company.porttail/baseLr7Portlet/pom.properties 将来修改。警告: META-INF/maven/com.company.porttail/baseLr7Portlet/pom.xml 中修改 未来。警告:WEB-INF/classes/ValidationMessages.properties 将来修改。警告: WEB-INF/classes/com/company/porttail/demo/applicant/ApplicantPortlet.class 将来修改。警告: WEB-INF/classes/com/company/porttail/demo/configuration/ContactConfiguration.class 将来修改。警告: WEB-INF/classes/com/company/porttail/demo/configuration/ContactLanguage.class 将来修改。警告: WEB-INF/classes/com/company/porttail/demo/controller/DemandeContactController.class 将来修改。警告: WEB-INF/classes/content/language.properties 日后修改。
警告:WEB-INF/classes/log4j.properties 将来会被修改。
警告:WEB-INF/lib/Pportlet-api-3.0.0.jar 以后会修改。
警告:WEB-INF/lib/api-model-3.6.4.jar 以后会修改。
警告:WEB-INF/lib/cdi-api-1.2.jar 以后会修改。
警告:WEB-INF/lib/com.liferay.portletmvc4spring.framework-5.2.0.jar 将来修改。警告: WEB-INF/lib/com.liferay.portletmvc4spring.security-5.2.0.jar 修改 将来。警告:WEB-INF/lib/javax.el-api-3.0.0.jar 已修改 将来。警告:WEB-INF/lib/javax.interceptor-api-1.2.jar 将来修改。警告: WEB-INF/lib/porttail-common-3.6.4.jar 以后修改。
警告:WEB-INF/lib/portlet-servlet-adapter-3.1.0.jar 在 未来。警告:WEB-INF/liferay-plugin-package.properties 已修改 将来。警告: WEB-INF/spring-context/portlet-application-context.xml中修改 未来。警告:WEB-INF/spring-context/portlet/portlet1-context.xml 将来修改。警告:WEB-INF/classes/com 在 未来。警告:WEB-INF/classes/com/company 在 未来。警告: WEB-INF/classes/com/company/porttail/demo/配置中修改 未来。警告:WEB-INF/spring-context 将来会被修改。 警告:将来会修改图像。 2020-01-06 20:36:14.440 信息 [fileinstall-/usr/share/porttail/liferay-portal-7.2.0-ga1/osgi/war][BaseAutoDeployListener:50] /usr/share/porttail/llet.war 的 Portlet 已成功复制 2020-01-06 20:36:43.468 错误 [fileinstall-/usr/share/porttail/liferay-portal-7.2.0-ga1/osgi/war][WebXMLDefinitionLoader:1130] baseLr7Portlet_1.0.0 [1148] una java.lang.ClassCastException:类 com.liferay.portletmvc4spring.ViewRendererServlet 在 java.lang.Class.asSubclass(Class.java:3404) 在 com.liferay.portal.osgi.web.servlet.context.helper.internal.definition.WebXMLDefinitionLoader._getServletInstance(WebXMLDefinitionLoader.java:1124 在 com.liferay.portal.osgi.web.servlet.context.helper.internal.definition.WebXMLDefinitionLoader._setServlet(WebXMLDefinitionLoader.java:1164) 在 com.liferay.portal.osgi.web.servlet.context.helper.internal.definition.WebXMLDefinitionLoader.endElement(WebXMLDefinitionLoader.java:353) 在 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609) 在 com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782) 在 com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2967) 在 com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) 在 com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) 在 com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841) 在 com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770) 在 com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) 在 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) 在 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643) 在 com.liferay.portal.osgi.web.servlet.context.helper.internal.definition.WebXMLDefinitionLoader.loadWebXMLDefinition(WebXMLDefinitionLoader.java:520 在 com.liferay.portal.osgi.web.servlet.context.helper.internal.definition.WebXMLDefinitionLoader.loadWebXML(WebXMLDefinitionLoader.java:456) 在 com.liferay.portal.osgi.web.servlet.context.helper.internal.ServletContextHelperRegistrationImpl.(ServletContextHelperRegistrationImpl.java: 在 com.liferay.portal.osgi.web.servlet.context.helper.internal.ServletContextHelperRegistrationServiceFactory.getService(ServletContextHelperRegistra 在 com.liferay.portal.osgi.web.servlet.context.helper.internal.ServletContextHelperRegistrationServiceFactory.getService(ServletContextHelperRegistra 在 org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212) 在 java.security.AccessController.doPrivileged(本机方法) 在 org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210) 在 org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) 在 org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) 在 org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:524) 在 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:464) 在 org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:624) 在 com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.initContext(WabBundleProcessor.java:456) 在 com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.init(WabBundleProcessor.java:136) 在 com.liferay.portal.osgi.web.wab.extender.internal.WebBundleDeployer._initWabBundle(WebBundleDeployer.java:179) 在 com.liferay.portal.osgi.web.wab.extender.internal.WebBundleDeployer.doStart(WebBundleDeployer.java:101) 在 com.liferay.portal.osgi.web.wab.extender.internal.WabFactory$WABExtension.start(WabFactory.java:114) 在 com.liferay.portal.osgi.web.wab.extender.internal.WabFactory.addingBundle(WabFactory.java:67) 在 com.liferay.portal.osgi.web.wab.extender.internal.WabFactory.addingBundle(WabFactory.java:49) 在 org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:475) 在 org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:1) 在 org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) 在 org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) 在 org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:450) 在 org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908) 在 org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) 在 org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) 在 org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:230) 在 org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:137) 在 org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:129) 在 org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:191) 在 org.eclipse.osgi.container.Module.publishEvent(Module.java:476) 在 org.eclipse.osgi.container.Module.doStart(Module.java:578) 在 org.eclipse.osgi.container.Module.start(Module.java:449) 在 org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1264) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1237) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) 2020-01-06 20:43:26.926 错误 [fileinstall-/usr/share/porttail/liferay-portal-7.2.0-ga1/osgi/war][PortletLocalServiceImpl:2567] 过滤器名称 SpringSecurityPortletFilter 引用的过滤器映射 未知的 portlet 名称 baseLr7Portlet 2020-01-06 20:43:26.946 WARN [fileinstall-/usr/share/porttail/liferay-portal-7.2.0-ga1/osgi/war][PortletLocalServiceImpl:876] 描述了名为 springDisptachar_WAR_baseLr7Portlet 的 Portlet 在 portlet.xml 中但没有匹配的条目 liferay-portlet.xml 2020-01-06 20:43:26.946 警告 [fileinstall-/usr/share/porttail/liferay-portal-7.2.0-ga1/osgi/war][PortletLocalServiceImpl:888] 描述了名为 baseLr7Portlet_WAR_baseLr7Portlet 的 Portlet 在 liferay-portlet.xml 但没有匹配的条目 portlet.xml 2020-01-06 20:43:26.954 错误 [fileinstall-/usr/share/porttail/liferay-portal-7.2.0-ga1/osgi/war][PortletLocalServiceImpl:930] java.lang.ClassCastException: com.liferay.portletmvc4spring.DispatcherPortlet 不能强制转换为 javax.portlet.Portlet java.lang.ClassCastException: com.liferay.portletmvc4spring.DispatcherPortlet 不能强制转换为 javax.portlet.Portlet 在 com.liferay.portlet.PortletBagFactory._getPortletInstance(PortletBagFactory.java:295) 在 com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:106) 在 com.liferay.portal.service.impl.PortletLocalServiceImpl.initWAR(PortletLocalServiceImpl.java:918) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:498) 在 com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50) 在 com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49) 在 com.sun.proxy.$Proxy138.initWAR(未知来源) 在 com.liferay.portal.kernel.service.PortletLocalServiceUtil.initWAR(PortletLocalServiceUtil.java:457) 在 com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:228) 在 com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:96) 在 com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:232) 在 com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:97) 在 com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27) 在 com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:189) 在 com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:179) 在 com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:44) 在 com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:75) 在 com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:57) 在 com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:54) 在 com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:141) 在 com.liferay.portal.kernel.servlet.SecurePluginContextListener.contextInitialized(SecurePluginContextListener.java:152) 在 com.liferay.portal.osgi.web.wab.extender.internal.adapter.ServletContextListenerExceptionAdapter._initializeContext(ServletContextListenerExceptionAdapter.java:119) 在 com.liferay.portal.osgi.web.wab.extender.internal.adapter.ServletContextListenerExceptionAdapter.contextInitialized(ServletContextListenerExceptionAdapter.java:99) 在 sun.reflect.GeneratedMethodAccessor186.invoke(未知来源) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:498) 在 org.eclipse.equinox.http.servlet.internal.registration.ListenerRegistration$EventListenerInvocationHandler.invoke(ListenerRegistration.java:143) 在 com.sun.proxy.$Proxy932.contextInitialized(未知来源) 在 org.eclipse.equinox.http.servlet.internal.context.ContextController.doAddListenerRegistration(ContextController.java:350) 在 org.eclipse.equinox.http.servlet.internal.context.ContextController.addListenerRegistration(ContextController.java:303) 在 org.eclipse.equinox.http.servlet.internal.customizer.ContextListenerTrackerCustomizer.addingService(ContextListenerTrackerCustomizer.java:67) 在 org.eclipse.equinox.http.servlet.internal.customizer.ContextListenerTrackerCustomizer.addingService(ContextListenerTrackerCustomizer.java:1) 在 org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:943) 在 org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1) 在 org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) 在 org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) 在 org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:903) 在 org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) 在 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:891) 在 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:804) 在 org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127) 在 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:228) 在 org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:469) 在 org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:487) 在 org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:1004) 在 com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.initListeners(WabBundleProcessor.java:623) 在 com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.init(WabBundleProcessor.java:216) 在 com.liferay.portal.osgi.web.wab.extender.internal.WebBundleDeployer._initWabBundle(WebBundleDeployer.java:179) 在 com.liferay.portal.osgi.web.wab.extender.internal.WebBundleDeployer.doStart(WebBundleDeployer.java:101) 在 com.liferay.portal.osgi.web.wab.extender.internal.WabFactory$WABExtension.start(WabFactory.java:114) 在 com.liferay.portal.osgi.web.wab.extender.internal.WabFactory.addingBundle(WabFactory.java:67) 在 com.liferay.portal.osgi.web.wab.extender.internal.WabFactory.addingBundle(WabFactory.java:49) 在 org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:475) 在 org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:1) 在 org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) 在 org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) 在 org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:450) 在 org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908) 在 org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) 在 org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) 在 org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:230) 在 org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:137) 在 org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:129) 在 org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:191) 在 org.eclipse.osgi.container.Module.publishEvent(Module.java:476) 在 org.eclipse.osgi.container.Module.doStart(Module.java:578) 在 org.eclipse.osgi.container.Module.start(Module.java:449) 在 org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1264) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1237) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) 2020-01-06 20:43:27.023 信息 [fileinstall-/usr/share/porttail/liferay-portal-7.2.0-ga1/osgi/war][PortletHotDeployListener:310] baseLr7Portlet 的 0 个 portlet 可供使用 2020-01-06 20:43:27.512 错误 [fileinstall-/usr/share/porttail/liferay-portal-7.2.0-ga1/osgi/war][WabBundleProcessor:229] 灾难性初始化失败!关闭 baseLr7Portlet WAB 由于:null java.lang.reflect.UndeclaredThrowableException 在 com.sun.proxy.$Proxy935.registerServlets(未知来源) 在 com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.init(WabBundleProcessor.java:222) 在 com.liferay.portal.osgi.web.wab.extender.internal.WebBundleDeployer._initWabBundle(WebBundleDeployer.java:179) 在 com.liferay.portal.osgi.web.wab.extender.internal.WebBundleDeployer.doStart(WebBundleDeployer.java:101) 在 com.liferay.portal.osgi.web.wab.extender.internal.WabFactory$WABExtension.start(WabFactory.java:114) 在 com.liferay.portal.osgi.web.wab.extender.internal.WabFactory.addingBundle(WabFactory.java:67) 在 com.liferay.portal.osgi.web.wab.extender.internal.WabFactory.addingBundle(WabFactory.java:49) 在 org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:475) 在 org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:1) 在 org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) 在 org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) 在 org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:450) 在 org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908) 在 org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) 在 org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) 在 org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:230) 在 org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:137) 在 org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:129) 在 org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:191) 在 org.eclipse.osgi.container.Module.publishEvent(Module.java:476) 在 org.eclipse.osgi.container.Module.doStart(Module.java:578) 在 org.eclipse.osgi.container.Module.start(Module.java:449) 在 org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1264) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1237) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) 在 org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) 引起:java.lang.reflect.InvocationTargetException 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:498) 在 com.liferay.portal.osgi.web.wab.extender.internal.adapter.ModifiableServletContextAdapter.invoke(ModifiableServletContextAdapter.java:447) ... 28 更多原因:java.lang.NullPointerException 在 com.liferay.portal.osgi.web.wab.extender.internal.adapter.ModifiableServletContextAdapter.addServlet(ModifiableServletContextAdapter.java:233) 在 com.liferay.portal.osgi.web.wab.extender.internal.adapter.ModifiableServletContextAdapter.registerServlets(ModifiableServletContextAdapter.java:582) ... 33 更多 2020-01-06 20:43:27.549 信息 [fileinstall-/usr/share/porttail/liferay-portal-7.2.0-ga1/osgi/war][PortletHotDeployListener:408] baseLr7Portlet 的 0 个 portlet 未注册 2020-01-06 20:43:27.788 信息 [fileinstall-/usr/share/porttail/liferay-portal-7.2.0-ga1/osgi/war][BundleStartStopLogger:39] 已启动 baseLr7Portlet_1.0.0 [1148]
这是我的 Portlet.xml 文件:
<?xml version="1.0"?>
<portlet-app xmlns="http://xmlns.jcp.org/xml/ns/portlet"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/portlet http://xmlns.jcp.org/xml/ns/portlet/portlet-app_3_0.xsd"
version="3.0">
<portlet>
<portlet-name>springDisptachar</portlet-name>
<portlet-class>com.liferay.portletmvc4spring.DispatcherPortlet</portlet-class>
<init-param>
<name>contextConfigLocation</name>
<value>/WEB-INF/spring-context/portlet/portlet1-context.xml</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</portlet-mode>
</supports>
<resource-bundle>content.language</resource-bundle>
<portlet-preferences>
<preference>
<name>datePattern</name>
<value>MM/dd/yyyy</value>
</preference>
<preference>
<name>recipientEmailAddress</name>
<value>email@test.fr</value>
</preference>
</portlet-preferences>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
<filter>
<filter-name>SpringSecurityPortletFilter</filter-name>
<filter-class>com.liferay.portletmvc4spring.security.SpringSecurityPortletFilter</filter-class>
<lifecycle>ACTION_PHASE</lifecycle>
<lifecycle>RENDER_PHASE</lifecycle>
<lifecycle>RESOURCE_PHASE</lifecycle>
</filter>
<filter-mapping>
<filter-name>SpringSecurityPortletFilter</filter-name>
<portlet-name>baseLr7Portlet</portlet-name>
</filter-mapping>
</portlet-app>
感谢任何建议。非常感谢 ... 问候
【问题讨论】:
标签: spring liferay liferay-7 spring-portlet-mvc