<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Unresolved requirement: Import-Package</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118471183" />
  <subtitle>Unresolved requirement: Import-Package</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118471183</id>
  <updated>2026-04-04T22:54:02Z</updated>
  <dc:date>2026-04-04T22:54:02Z</dc:date>
  <entry>
    <title>RE: Unresolved requirement: Import-Package</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118471875" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118471875</id>
    <updated>2020-02-10T16:12:45Z</updated>
    <published>2020-02-10T16:12:45Z</published>
    <summary type="html">So first, strip out whatever you did in the guestbook-service/bnd.bnd file, you shouldn&amp;#39;t be exporting anything there.&lt;br /&gt;&lt;br /&gt;You should see, however, in the guestbook-api/bnd.bnd file that there is an &amp;#34;Export-Package:&amp;#34; declaration with one of the lines having the com.liferay.docs.guestbook.service package.&lt;br /&gt;&lt;br /&gt;Pay attention to spelling and package here, it should match the actual package where the service interfaces are.&lt;br /&gt;&lt;br /&gt;Also, note that two modules cannot export the same package, only one module should export a package. So, for example, if the service module had the same Export-Package declaration, it would conflict with the one from the api module. Your web module, it should not be exporting any packages either.&lt;br /&gt;&lt;br /&gt;Additionally, when changing imports and exports, I&amp;#39;ve sometimes encountered cases where the OSGi meta information gets a little messed up during development, especially when making and deploying changes on bnd.bnd files. If I see weird things like one module saying a package can&amp;#39;t be imported when I can see in the code that another module is exporting it, I&amp;#39;ll purge the osgi/state directory (while the app server is stopped) and let it rebuild during restart. Doesn&amp;#39;t fix everything, but sometimes it does help straighten out the meta conflicts.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2020-02-10T16:12:45Z</dc:date>
  </entry>
  <entry>
    <title>Unresolved requirement: Import-Package</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118471182" />
    <author>
      <name>Zaberca David</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118471182</id>
    <updated>2020-02-10T16:00:39Z</updated>
    <published>2020-02-10T16:00:39Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hello guys,&lt;br&gt;This is my 2th try following the first tutorial from the official documentation. The steps simply talk about creating a service-builder and a mvc portlet. I followed the instructions&amp;nbsp;and all works great, I'm able to insert the portlet into a page and change the view. Then I arrive to this wonderful step&amp;nbsp;&lt;a href="https://portal.liferay.dev/docs/7-2/tutorials/-/knowledge_base/t/integrating-the-back-end"&gt;https://portal.liferay.dev/docs/7-2/tutorials/-/knowledge_base/t/integrating-the-back-end&lt;/a&gt;&amp;nbsp;.&lt;br&gt;&lt;br&gt;As the tutorial states I insert this in my mvc portlet build.gradle:&lt;br&gt;compileOnly project(":modules:guestbook:guestbook-api")&lt;br&gt;compileOnly project(":modules:guestbook:guestbook-service")&lt;br&gt;&lt;br&gt;... and put this in my portlet class:&lt;br&gt;&lt;pre&gt;&lt;code&gt;@Reference
private GuestbookEntryLocalService _guestbookEntryLocalService;

@Reference
private GuestbookLocalService _guestbookLocalService;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;I save the files and gradle does his thing and tries&amp;nbsp;to rebuild something and I get this:Unresolved requirement: Import-Package: com.liferay.docs.guestbook.service&lt;br&gt;&lt;br&gt;I've tried setting the export packages on the service builder. I've switched&amp;nbsp;version. I've tried refreshing and refreshing gradle for everything. I even did this whole tutorial again. I even deleted all the modules, refreshed project and&amp;nbsp;refreshed gradle. All in hopes of starting the server again but it's dead, the exception above won't let me.Please don't send me to other threads,&amp;nbsp;they are not helpful.&amp;nbsp;&lt;br&gt;&lt;br&gt;David&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Zaberca David</dc:creator>
    <dc:date>2020-02-10T16:00:39Z</dc:date>
  </entry>
</feed>
