Liferay升级7.2以向osgi注册SpringBean

Liferay升级7.2以向osgi注册SpringBean,osgi,portlet,osgi-bundle,liferay-7,spring-portlet-mvc,Osgi,Portlet,Osgi Bundle,Liferay 7,Spring Portlet Mvc,当我试图用bean配置SpringMVCPortlet并在我的服务器上启动已部署的war时,我发现以下错误 为了解决NameSpaceHandler问题,我尝试了所有与spring相关的内容,但仍然遇到了与portlet.xml相关的错误,即使用容器注册bean 我正在使用Spring4.2.5-RELEASE和XMLSchema-all-I为XSD使用3.0版本,以使其与WebApp3.0XSD兼容,只是为了安全 日志如下所述 org.springframework.beans.factory

当我试图用bean配置SpringMVCPortlet并在我的服务器上启动已部署的war时,我发现以下错误

为了解决NameSpaceHandler问题,我尝试了所有与spring相关的内容,但仍然遇到了与portlet.xml相关的错误,即使用容器注册bean 我正在使用Spring4.2.5-RELEASE和XMLSchema-all-I为XSD使用3.0版本,以使其与WebApp3.0XSD兼容,只是为了安全

日志如下所述

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]_Offending resource: ServletContext resource [/WEB-INF/spring-context/portlet-application-context.xml]_ [Sanitized]
    at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:118)
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:110)
2020-05-18 08:16:53.947 ERROR [fileinstall-/project_war_Path/][HotDeployImpl:232] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering servlet context listeners for project-spring-portlet-1.0.0
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering servlet context listeners for project-spring-portlet-1.0.0
    at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:38)
    at com.liferay.portal.deploy.hot.ServletContextListenerHotDeployListener.invokeDeploy(ServletContextListenerHotDeployListener.java:40)
    at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:229)
    at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
Caused by: java.lang.reflect.InvocationTargetException
    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.deploy.hot.ServletContextListenerHotDeployListener.doInvokeDeploy(ServletContextListenerHotDeployListener.java:73)
    at com.liferay.portal.deploy.hot.ServletContextListenerHotDeployListener.invokeDeploy(ServletContextListenerHotDeployListener.java:37)
    ... 63 more
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]_Offending resource: ServletContext resource [/WEB-INF/spring-context/portlet-application-context.xml]_ [Sanitized]
    at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:118)
2020-05-18 08:16:53.957 WARN  [fileinstall-/project_war_Path/][PortletLocalServiceImpl:881] Portlet with the name apiusersspring_WAR_apiusersspringportlet100 is described in portlet.xml but does not have a matching entry in liferay-portlet.xml
2020-05-18 08:16:53.958 WARN  [fileinstall-/project_war_Path/][PortletLocalServiceImpl:893] Portlet with the name apiusersspringportlet_WAR_apiusersspringportlet100 is described in liferay-portlet.xml but does not have a matching entry in portlet.xml
2020-05-18 08:16:53.958 ERROR [fileinstall-/project_war_Path/][PortletBagFactory:288] java.lang.ClassNotFoundException: org.springframework.web.portlet.DispatcherPortlet cannot be found by project-spring-portlet-1.0.0_1.0.0
java.lang.ClassNotFoundException: org.springframework.web.portlet.DispatcherPortlet cannot be found by project-spring-portlet-1.0.0_1.0.0
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:508)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
2020-05-18 08:16:53.963 ERROR [fileinstall-/project_war_Path/][PortletBagFactory:214] javax.portlet.PortletException: java.lang.NullPointerException
javax.portlet.PortletException: java.lang.NullPointerException
    at com.liferay.portlet.internal.InvokerPortletFactoryImpl.create(InvokerPortletFactoryImpl.java:111)
    at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortletFactoryImpl.create(MonitoringInvokerPortletFactoryImpl.java:115)
    at com.liferay.portlet.internal.PortletInstanceFactoryImpl.init(PortletInstanceFactoryImpl.java:275)
    at com.liferay.portlet.internal.PortletInstanceFactoryImpl.create(PortletInstanceFactoryImpl.java:181)
Caused by: java.lang.NullPointerException
    at com.liferay.portlet.internal.InvokerPortletImpl.<init>(InvokerPortletImpl.java:122)
    at com.liferay.portlet.internal.InvokerPortletFactoryImpl.create(InvokerPortletFactoryImpl.java:107)
    ... 80 more
2020-05-18 08:16:53.966 ERROR [fileinstall-/project_war_Path/][HotDeployImpl:232] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for project-spring-portlet-1.0.0
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for project-spring-portlet-1.0.0
    at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:38)
    at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:99)
    at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:229)
    at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
    at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27)
    at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:189)

org.springframework.beans.factory.parsing.Bean定义ParsingException:配置问题:找不到XML架构命名空间的Spring NamespaceHandler[http://www.springframework.org/schema/context]_有问题的资源:ServletContext资源[/WEB-INF/spring context/portlet应用程序context.xml]([Sanitized]
位于org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
位于org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:118)
位于org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:110)
2020-05-18 08:16:53.947错误[fileinstall-/project_war_Path/][HotDeployImpl:232]com.liferay.portal.kernel.deploy.hot.HotDeployException:为project-spring-portlet-1.0.0注册servlet上下文侦听器时出错
com.liferay.portal.kernel.deploy.hot.HotDeployException:为project-spring-portlet-1.0.0注册servlet上下文侦听器时出错
位于com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:38)
位于com.liferay.portal.deploy.hot.ServletContextListenerHotDeployListener.invokeDeploy(ServletContextListenerHotDeployListener.java:40)
位于com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:229)
位于com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
原因:java.lang.reflect.InvocationTargetException
在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处
位于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.deploy.hot.ServletContextListenerHotDeployListener.doInvokeDeploy(ServletContextListenerHotDeployListener.java:73)
位于com.liferay.portal.deploy.hot.ServletContextListenerHotDeployListener.invokeDeploy(ServletContextListenerHotDeployListener.java:37)
... 63多
原因:org.springframework.beans.factory.parsing.Bean定义ParsingException:配置问题:找不到XML架构命名空间的Spring NamespaceHandler[http://www.springframework.org/schema/context]_有问题的资源:ServletContext资源[/WEB-INF/spring context/portlet应用程序context.xml]([Sanitized]
位于org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
位于org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:118)
2020-05-18 08:16:53.957警告[fileinstall-/project\u war\u Path/][PortletLocalServiceImpl:881]名为apiusersspring\u war\u apiusersspringportlet100的Portlet在Portlet.xml中有描述,但在liferay-Portlet.xml中没有匹配的条目
2020-05-18 08:16:53.958警告[fileinstall-/project\u war\u Path/][PortletLocalServiceImpl:893]名为apiusersspringportlet\u war\u apiusersspringportlet100的Portlet在liferay-Portlet.xml中有描述,但在Portlet.xml中没有匹配的条目
2020-05-18 08:16:53.958错误[fileinstall-/project\u war\u Path/][PortletBagFactory:288]java.lang.ClassNotFoundException:org.springframework.web.portlet.DispatcherPortlet无法通过project-spring-portlet-1.0.0\u 1.0.0找到
java.lang.ClassNotFoundException:org.springframework.web.portlet.DispatcherPortlet无法通过project-spring-portlet-1.0.0_1.0.0找到
位于org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:508)
位于org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
位于org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
2020-05-18 08:16:53.963错误[fileinstall-/project\u war\u Path/][PortletBagFactory:214]javax.portlet.PortletException:java.lang.NullPointerException
javax.portlet.PortleteException:java.lang.NullPointerException
位于com.liferay.portlet.internal.InvokerPortletFactoryImpl.create(InvokerPortletFactoryImpl.java:111)
位于com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortletFactoryImpl.create(MonitoringInvokerPortletFactoryImpl.java:115)
位于com.liferay.portlet.internal.PortletInstanceFactoryImpl.init(PortletInstanceFactoryImpl.java:275)
位于com.liferay.portlet.internal.PortletInstanceFactoryImpl.create(PortletInstanceFactoryImpl.java:181)
原因:java.lang.NullPointerException
位于com.liferay.portlet.internal.InvokerPortletImpl.(InvokerPortletImpl.java:122)
位于com.liferay.portlet.internal.InvokerPortletFactoryImpl.create(InvokerPortletFactoryImpl.java:107)
... 80多
2020-05-18 08:16:53.966错误[fileinstall-/project_war_Path/][HotDeployImpl:232]com.liferay.portal.kernel.deploy.hot.HotDeployException:为project-spring-portlet-1.0.0注册portlet时出错
com.liferay.portal.kernel.deploy.hot.HotDeployException:为project-spring-portlet-1.0.0注册portlet时出错
位于com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:38)
位于com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:99)
位于com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:229)
位于com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
位于com.liferay.portal.kernel.deploy.hot.HotDep