Message Boards
Changes to ServiceBuilder not visible after redeploy with Developer Studio
Changes to ServiceBuilder not visible after redeploy with Developer Studio
New Member Posts: 21 Join Date: 7/30/15 Recent PostsI'm developing with Dev Studio 3.9.4.
Localhost server is Liferay CE 7.4.2 GA3
- Start localhost server from Dev Studio
- Change the interface of my ServiceBuilder project (new method, method signature change etc.)
- Rebuild my service (BuildService Gradle task)
- Build is successful. Console shows "myservice stopped" "myservice started"
- In eclipse, intellisense detects with my new code (method or method signature)
- I get runtime errors (eg: nosuchmethod exceptions etc.)
- I have to restart my local server and then runtime errors are gone and everything is ok
Is there a way to avoid from restarting the server? I don't have this problem for other projects (eg: portlet). Changes for these projects are immediately available.
Am I missing something for ServiceBuilder?
Thanks in advance.
RE: Changes to ServiceBuilder not visible after redeploy with Developer Stu
Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent PostsDo 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.
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.
RE: Changes to ServiceBuilder not visible after redeploy with Developer Stu
New Member Posts: 21 Join Date: 7/30/15 Recent PostsHi Olaf. Thanks for your time.
I mainly do simple stuff like:
- Create a ResourceCommand class
- Declare @Reference to MyServiceBuilder in the resource command.
eg:
- @Reference
- private volatile MyLocalService myLocalService
- Call a method
- myLocalService.dosomething();
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:
- CustomClassDefinedInServiceBuilder something = myLocalService.doSomething();
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.
Anyway this is not a blocking problem. Just takes a takes a bit more time waiting for the server to restart.
Thanks again.
RE: RE: Changes to ServiceBuilder not visible after redeploy with Developer
Expert Posts: 326 Join Date: 12/20/10 Recent Postsin my experience
sometime, even you use @Reference, it won't update.
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)
i do believe it not good practice, but it work on me.