Problem with redeploy in web's module with JSF2 and Primefaces

Answered

Hello everybody,

I have a project with different modules. In fact, I have 4 modules:

  • presentation-jsf
  • repository-oracle
  • service
  • webapp

See the image below:

I am developing a library to use by another teams of the company I am working at. For that reason, we can not add the xhtml files in the webapp module. We decide that because as a library we want to keep in that way. We are using Primefaces 6.1 with the Barcelona theme. Also, I am using JSF2 with Tomcat.

The WebApp is totally empty because are the clients who will be using it in theirs webapps. For that reason, the module where I have the .xhtml files is presentation-jsf. Inside there, I have all the xhtml files:

The problem is that when I am executing the webapp itself, without any client, the application is working fine (I can access to the http://localhost/web/app/view.xhtml file). I don't need any of my client's project to use the library. I can use it directly as a webapp. But the main problem is that I can not do a hot redeploy. It means that all the files with xhtml format, is not working.

Of course, when I am using any of my clients, the application is not doing any hot redeploy because they are using it as a war file (library). For that reason, I suppouse that is not possible to do a hot deploy.

I am using Intellij. For that reason, maybe there is some way to copy the file in a hot. If I have to do any change, I have to do a restart of the server and sometimes, I have to do a maven clean install to clean it up.

I have to notice again that the modifications are in one module of the application. I am using that module as a library. Every change on the library, I have to stop and start again the server and it's very slow and very anoying way to develop. If I change some file and I reload the page, the changes are not applied. Once I have restarted the server and the library is created again (with the modifications), it works good. 

I have asked it in stackoverflow as well (https://stackoverflow.com/questions/45101417/hot-redeploy-files-in-web-fragment-project-in-intellij) and BalusC told me that is possible in Eclipse, but I am pretty sure that if it is possible in Eclipse, for sure it is in IntelliJ. I do not know the way.....any help on that?

Thank you in advance,

Ferran

 

 

0
3 comments

As I've replied on StackOverflow, it should already work by default when using the exploded war, make sure you have configured Update action as described at https://www.jetbrains.com/help/idea/2017.1/updating-applications-on-application-servers.html.

Caching may be performed by the application server or by the framework itself which would affect instant update of the resource files.

What application server do you use? Did you disable caching for JSF? See https://stackoverflow.com/a/7514528/104891.

0
Avatar
Permanently deleted user

Hello Serge,

Thank you for the reply. I have activated all the Update action as you sent me. I had it from long time ago.

Also, one things that I have tried is the link of stackoverflow that you indicated. And it is not working.

Maybe I am not explaining very good. The main issue is that that the construction of the project is not in a very good way (old partners did it and we can not change at this moment). The module webapp does not contain the xhtml, because this code is in presentation-jsf module:

The library that we are creating is put it into a jar. This jar is not exploded (I am pretty sure that the problem is coming from here..). And also, this jar can be found in the webapp target/lib:

In that case, we want to change something in the code of this library and automatically, use it without the necessity to reboot the server.

Also, notice that this library will be used in different webapp's. That is the reason we are not including these files into the webapp project.

Thank you in advance

 

 

 

 

 

 

 

 

0

Hot deployment is impossible when the files are in the jar, you will have to change the configuration somehow.

0

Please sign in to leave a comment.