Search code examples
springjspwebspherespring-data-jpawebsphere-liberty

Websphere liberty profile jsp changes are not reflected using Spring data jpa library


Hi i have a really strange problem. I work on a project that uses Spring 4.2.4, Hibernate 5 and WebSphere Liberty Profile 8.5.5 as application server. When i change the content of jsp files, this changes are not reflected and i have to restart the server every time. Instead changes made to css or java files are reflected and i do not need to restart the server.

I created a little project with only one jsp and the spring libraries to isolate the problem and i noticed that if i remove the spring-data-jpa library from the classpath, the server reflects the jsp changes and everything works fine. Unfortunately i need that library.

I tried to upgrade the spring libraries to 4.3.1 version, and the spring-data-jpa to 1.10.2 version but nothing changes.

These are the spring libraries i use:

spring-aop-4.2.4.RELEASE.jar
spring-aspects-4.2.4.RELEASE.jar
spring-beans-4.2.4.RELEASE.jar
spring-context-4.2.4.RELEASE.jar
spring-context-support-4.2.4.RELEASE.jar
spring-core-4.2.4.RELEASE.jar
spring-data-commons-1.12.1.RELEASE.jar
spring-data-commons-core-1.4.1.RELEASE.jar
spring-data-jpa-1.10.1.RELEASE.jar
spring-data-oracle-1.2.1.RELEASE.jar
spring-expression-4.2.4.RELEASE.jar
spring-instrument-4.2.4.RELEASE.jar
spring-jdbc-4.2.4.RELEASE.jar
spring-orm-4.2.4.RELEASE.jar
spring-oxm-4.2.4.RELEASE.jar
spring-tx-4.2.4.RELEASE.jar
spring-web-4.2.4.RELEASE.jar
spring-webmvc-4.2.4.RELEASE.jar

and the properties in my server.xml

<featureManager>
    <feature>javaee-7.0</feature>
    <feature>localConnector-1.0</feature>
    <feature>distributedMap-1.0</feature>
    <feature>ejbRemote-3.2</feature>
</featureManager>

<applicationManager autoExpand="true"/>

<applicationMonitor updateTrigger="mbean"/>

I don't understand which is the correlation between Liberty and spring-data-jpa, why this library interferes with the server functionalities? Is there any parameter i have to set in the server.xml or in web.xml?

I also tried to add all the Liberty features (http://www.ibm.com/support/knowledgecenter/en/SS7K4U_liberty/com.ibm.websphere.wlp.zseries.doc/ae/rwlp_feat.html) to the server.xml but nothing changes.

Please help me, every server restart takes about 3 minutes.

Thanks in advance!


Solution

  • It's likely that the issue here is related to the one resolved in this APAR, which was included in WebSphere Liberty 16.0.0.2: PI58316: Changes to JSP in EAR or WAR not picked up if CDI-1.2 feature enabled

    That issue deals with JSP files not reloading correctly when the cdi-1.2 feature is enabled. In the case here, the javaee-7.0 feature enables cdi-1.2. If it's possible, upgrading the Liberty server to the 16.0.0.2 fixpack should resolve this issue. Alternatively, removing the javaee-7.0 feature and only enabling non cdi-1.2 features (eg. jsp-2.3) may also resolve the issue.