Changes to ServiceBuilder not visible after redeploy with Developer StudioChanges to ServiceBuilder not visible after redeploy with Developer Studiohttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1211383032024-03-29T15:10:22Z2024-03-29T15:10:22ZRE: RE: Changes to ServiceBuilder not visible after redeploy with DeveloperScarletake Bwihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1213064682021-12-23T07:20:15Z2021-12-23T07:20:14Z<p>in my experience</p>
<p>sometime, even you use @Reference, it won't update.</p>
<p>i will delete all in temp of tomcat, and delete all module of osgi,
and restart with clean(if you use studio to start server)</p>
<p>i do believe it not good practice, but it work on me.</p>Scarletake Bwi2021-12-23T07:20:14ZRE: Changes to ServiceBuilder not visible after redeploy with Developer StuMarc-Andre Gauthierhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1211383642021-09-10T13:33:32Z2021-09-10T13:33:31Z<p>Hi Olaf. Thanks for your time.</p>
<p>I mainly do simple stuff like: </p>
<ol>
<li>Create a ResourceCommand class</li>
<li>Declare @Reference to MyServiceBuilder in the resource command.
eg: <ol>
<li>@Reference</li>
<li>private volatile MyLocalService myLocalService</li></ol></li>
<li>Call a method <ol>
<li>myLocalService.dosomething();</li></ol></li></ol>
<p>Only thing out of the ordinary is that I have declared a class inside
the servicebuilder project that i use in the other projects. eg:</p>
<ol>
<li>CustomClassDefinedInServiceBuilder something = myLocalService.doSomething();</li></ol>
<p>Don't know if this could cause the problem. I also get errors for
things that are not related to that custom class. I also get a
nosuchmethod exception on myLocalService.doSomething() if I change the
signature of doSomething() for example. </p>
<p>Anyway this is not a blocking problem. Just takes a takes a bit more
time waiting for the server to restart. </p>
<p>Thanks again.</p>Marc-Andre Gauthier2021-09-10T13:33:31ZRE: Changes to ServiceBuilder not visible after redeploy with Developer StuOlaf Kockhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1211384482021-09-10T13:13:19Z2021-09-10T13:13:19Z<p>Do you store any of the services or objects outside of the service
projects? This way the classes couldn't be unloaded and you'd see
unexpected results with stale old class code in random locations.</p>
<p>If you stick with @Reference and forget about those objects after
you've used them in a request, nothing bad should happen. But if you
hold them any longer (including the model objects), you might see
weird behavior - especially if you're calling methods on them while
two of the class's definitions are around.</p>Olaf Kock2021-09-10T13:13:19ZChanges to ServiceBuilder not visible after redeploy with Developer StudioMarc-Andre Gauthierhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1211383022021-09-10T13:00:23Z2021-09-10T13:00:23Z<p>I'm developing with Dev Studio 3.9.4.</p>
<p>Localhost server is Liferay CE 7.4.2 GA3</p>
<ol>
<li>Start localhost server from Dev Studio</li>
<li>Change the interface of my ServiceBuilder project (new method,
method signature change etc.)</li>
<li>Rebuild my service (BuildService Gradle task)</li>
<li>Build is successful. Console shows "myservice stopped"
"myservice started"</li>
<li>In eclipse, intellisense detects with my new code (method or
method signature)</li>
<li>I get runtime errors (eg: nosuchmethod exceptions etc.)</li>
<li>I have to restart my local server and then runtime errors are gone
and everything is ok</li></ol>
<p>Is there a way to avoid from restarting the server? I don't have this
problem fo