Liferay 7:尝试激活bundle portlet时出错

时间:2018-09-04 17:40:30

标签: liferay liferay-7

我正在尝试将捆绑包安装到Liferay 7中。当我将jar上载到App Manager时,仅安装了模块,然后在尝试激活时抛出异常:

2018-09-04 17:25:24.739 ERROR [http-nio-8080-exec-4][PortletServlet:112] javax.portlet.PortletException: org.osgi.framework.BundleException: Could not resolve module: com.ctliv.vportlet [998]_  Unresolved requirement: Import-Package: com.liferay.portal.kernel.exception; version="7.4.0"_ [Sanitized]
    javax.portlet.PortletException: org.osgi.framework.BundleException: Could not resolve module: com.ctliv.vportlet [998]_  Unresolved requirement: Import-Package: com.liferay.portal.kernel.exception; version="7.4.0"_ [Sanitized]
        at com.liferay.portal.kernel.portlet.LiferayPortlet.callActionMethod(LiferayPortlet.java:207)
        at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.callActionMethod(MVCPortlet.java:418)
        at com.liferay.portal.kernel.portlet.LiferayPortlet.processAction(LiferayPortlet.java:97)
        at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.processAction(MVCPortlet.java:260)
        at com.liferay.marketplace.app.manager.web.internal.portlet.MarketplaceAppManagerPortlet.processAction(MarketplaceAppManagerPortlet.java:216)
        at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:77)
        at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:50)
        at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:108)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
        at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
        at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
        at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:118)
        at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
        at com.liferay.portlet.internal.InvokerPortletImpl.invoke(InvokerPortletImpl.java:606)
        at com.liferay.portlet.internal.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:652)
        at com.liferay.portlet.internal.InvokerPortletImpl.processAction(InvokerPortletImpl.java:341)
        at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.processAction(MonitoringInvokerPortlet.java:208)
        at com.liferay.portlet.internal.PortletContainerImpl._processAction(PortletContainerImpl.java:485)
        at com.liferay.portlet.internal.PortletContainerImpl.lambda$processAction$0(PortletContainerImpl.java:144)
        at com.liferay.portlet.internal.PortletContainerImpl._preserveGroupIds(PortletContainerImpl.java:390)
        at com.liferay.portlet.internal.PortletContainerImpl.processAction(PortletContainerImpl.java:137)
 ...                

        Caused by: org.osgi.framework.BundleException: Could not resolve module: com.ctliv.vportlet [998]_  Unresolved requirement: Import-Package: com.liferay.portal.kernel.exception; version="7.4.0"_ [Sanitized]
        at org.eclipse.osgi.container.Module.start(Module.java:429)
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402)
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:421)
        at com.liferay.marketplace.app.manager.web.internal.portlet.MarketplaceAppManagerPortlet.activateBundles(MarketplaceAppManagerPortlet.java:127)
        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.kernel.portlet.LiferayPortlet.callActionMethod(LiferayPortlet.java:189)
        ... 150 more

我的pom.xml看起来像:

<import.package>
            !com.google.gwt.*,
            !elemental.events,
            !com.vaadin.client.*,
            com.vaadin*;resolution:=optional;version="[8.1,9)",
            org.osgi.framework;version="[1.8,2)",       
            com.liferay.counter.kernel.service;version="1.0.1",
            com.liferay.portal.kernel.exception;version="[7.0,8)",
            com.liferay.portal.kernel.log;version="7.0.0",
            com.liferay.portal.kernel.model;version="2.0.0",
            com.liferay.portal.kernel.portlet;version="8.0.0",
            com.liferay.portal.kernel.service;version="1.34.0",
            com.liferay.portal.kernel.util; version="8.4.0",
            javax.portlet*;version="[2.0,3)",
            javax.sql,
            javax.management,
            org.xml.sax,
        </import.package>
        <export.package>
            com.github.ctliv.vportlet.export;version="${project.version}",
            com.liferay.portal.kernel.exception;version="[7.0,8)"
        </export.package>
    </properties>

<plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>3.3.0</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <manifestLocation>META-INF</manifestLocation>
                        <Bundle-Name>${project.name}</Bundle-Name>
                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Version>${project.version}</Bundle-Version>
                        <Import-Package>${import.package}</Import-Package>
                        <Export-Package>${export.package}</Export-Package>
                        <Bundle-Activator>${bundle.activator}</Bundle-Activator>
                        <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
                        <Embed-Transitive>true</Embed-Transitive>
                        <Bundle-RequiredExecutionEnvironment>JavaSE-1.8</Bundle-RequiredExecutionEnvironment>
                    </instructions>
                </configuration>
            </plugin>

似乎我必须将com.liferay.portal.kernel依赖项包含到我的jar中? 我包含在“导出”程序包中,但是没有用

1 个答案:

答案 0 :(得分:0)

我认为您不需要在导入时包含内核包