<?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>Is deleting the osgi/state folder a bad practice?</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111430949" />
  <subtitle>Is deleting the osgi/state folder a bad practice?</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111430949</id>
  <updated>2026-04-04T04:00:55Z</updated>
  <dc:date>2026-04-04T04:00:55Z</dc:date>
  <entry>
    <title>RE: Is deleting the osgi/state folder a bad practice?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111824302" />
    <author>
      <name>Charalampos Chrysikopoulos</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111824302</id>
    <updated>2018-12-17T09:13:43Z</updated>
    <published>2018-12-17T09:13:43Z</published>
    <summary type="html">&lt;p&gt;Thanks a lot Tobias for the info!&lt;/p&gt;</summary>
    <dc:creator>Charalampos Chrysikopoulos</dc:creator>
    <dc:date>2018-12-17T09:13:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: Is deleting the osgi/state folder a bad practice?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111823286" />
    <author>
      <name>Tobias Liefke</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111823286</id>
    <updated>2018-12-17T09:04:58Z</updated>
    <published>2018-12-17T09:04:58Z</published>
    <summary type="html">&lt;p&gt;The second number is just the &amp;quot;version&amp;quot; of the bundle (the
  number starts by 0 and is increased every time the bundle is
  redeployed). This ensures that even open files of previous versions
  don't prevent deployment of a new version of a bundle.&lt;/p&gt;
&lt;p&gt;Most often you have only the last version of a bundle - and as most
  of the bundles are never redeployed, the usual number is &amp;quot;0&amp;quot;.&lt;/p&gt;
&lt;p&gt;But for those of your WAB bundles which contain further third
  party libraries, you will often find more than one version directory
  with all the previous versions containing all these libraries and a
  file &amp;quot;.delete&amp;quot; indicating that this directory may be deleted.&lt;/p&gt;</summary>
    <dc:creator>Tobias Liefke</dc:creator>
    <dc:date>2018-12-17T09:04:58Z</dc:date>
  </entry>
  <entry>
    <title>RE: Is deleting the osgi/state folder a bad practice?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111503321" />
    <author>
      <name>Charalampos Chrysikopoulos</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111503321</id>
    <updated>2018-11-09T14:55:14Z</updated>
    <published>2018-11-09T14:55:14Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;Hi Tobias,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;you are right. Only I wanted to know the following number (I didn't
  explained it well):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
  &lt;code&gt;/osgi/state/org.eclipse.osgi/[bundleId]/[unknownNumber]/bundleFile&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So, &lt;code&gt;unknownNumber&lt;/code&gt;&amp;nbsp;is the number I was asking about.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Checking it out, I saw the values 0 (moslty), but also 1,2,4 or 7.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Charalampos Chrysikopoulos</dc:creator>
    <dc:date>2018-11-09T14:55:14Z</dc:date>
  </entry>
  <entry>
    <title>RE: Is deleting the osgi/state folder a bad practice?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111456532" />
    <author>
      <name>Tobias Liefke</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111456532</id>
    <updated>2018-11-05T22:26:12Z</updated>
    <published>2018-11-05T22:26:12Z</published>
    <summary type="html">&lt;p&gt;The number is the numeric ID of the bundle. You can use it for
  example in the gogo shell, to reference a bundle with a short number
  instead of its long symbolic name.&lt;/p&gt;
&lt;p&gt;When you enter lb (list bundle) in the shell you can see the ID for
  each bundle.&lt;/p&gt;
&lt;p&gt;If you delete the state folder, each bundle will get a new ID - which
  is usually no problem, because the IDs are only used during runtime
  and inside the state folder.&lt;/p&gt;</summary>
    <dc:creator>Tobias Liefke</dc:creator>
    <dc:date>2018-11-05T22:26:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: Is deleting the osgi/state folder a bad practice?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111434964" />
    <author>
      <name>Charalampos Chrysikopoulos</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111434964</id>
    <updated>2018-11-02T13:29:12Z</updated>
    <published>2018-11-02T13:29:12Z</published>
    <summary type="html">Thanks David,&lt;br /&gt;&lt;br /&gt;so, there are cases as you noticed, where deleting the state folder makes sense. &lt;br /&gt;&lt;br /&gt;Looking into the &lt;em&gt;state&lt;/em&gt; folder, under the &lt;em&gt;org.eclipse.osgi&lt;/em&gt; subfolder, there are all bundle ids as folders and in those a subfolder with a number that contains mostly the jar in the form of a file named &lt;em&gt;bundleFile&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;Do you know what this number means? </summary>
    <dc:creator>Charalampos Chrysikopoulos</dc:creator>
    <dc:date>2018-11-02T13:29:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: Is deleting the osgi/state folder a bad practice?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111433958" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111433958</id>
    <updated>2018-11-02T13:10:50Z</updated>
    <published>2018-11-02T13:10:50Z</published>
    <summary type="html">The osgi/state directory contains all of the meta information OSGi needs to understand individual modules, including those in the .lpkg files, and the relations between the modules.&lt;br /&gt;&lt;br /&gt;If the directory doesn&amp;#39;t exist, OSGi will rebuild it all at restart.&lt;br /&gt;&lt;br /&gt;In general though you don&amp;#39;t want to delete it as it will affect your startup times.&lt;br /&gt;&lt;br /&gt;I typically will only delete it when something is not acting right.  This happens to me mostly when my bundle modifications change the meta information that OSGi has not updated osgi/state correctly.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2018-11-02T13:10:50Z</dc:date>
  </entry>
  <entry>
    <title>Is deleting the osgi/state folder a bad practice?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111430948" />
    <author>
      <name>Charalampos Chrysikopoulos</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111430948</id>
    <updated>2018-11-02T10:11:50Z</updated>
    <published>2018-11-02T10:11:50Z</published>
    <summary type="html">Hallo,&lt;br /&gt;&lt;br /&gt; there are times where while developing, the liferay server can come to a state, in which something is working wrong, but we don&amp;#39;t know whan it is. Restarting the server resolves the problem in many cases, but not always. In liferay 6.2 we stoped the server, deleted work and temp folders and then started the server again. Even more, we could delete our plugins from the webapps folder. This &amp;#34;clean&amp;#34; restart was more succesful. In liferay 7 (or 7.1) we can delete the same folders, but there is also the osgi/state folder. This folder contains all the modules/bundles that are deployed in the osgi container. &lt;br /&gt;&lt;br /&gt;If we install all our modules/bundles through the deploy folder as jars, is it a good practice the delete also the state fodler together with work and temp to accieve a clean restart? &lt;br /&gt;&lt;br /&gt;Thank you in advance,&lt;br /&gt;​​​​​​​Harry</summary>
    <dc:creator>Charalampos Chrysikopoulos</dc:creator>
    <dc:date>2018-11-02T10:11:50Z</dc:date>
  </entry>
</feed>
