1

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!

amicoderozer
  • 2,046
  • 6
  • 28
  • 44
  • Do you have other applications on the server that make use of the 'spring-data-jpa' library? – Haxiel Jul 27 '16 at 09:42
  • no it's the only one that uses that library – amicoderozer Jul 27 '16 at 09:59
  • What development environment are you using or is it standalone server? As you could try to change `updateTrigger` to pool instead of mbean, as maybe your dev environment is not correctly invoking update on Liberty. – Gas Jul 27 '16 at 13:07

1 Answers1

3

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.

wtlucy
  • 704
  • 3
  • 10
  • +1 for tracking down the specific bug. However, OP mentioned that the JSP changes are reflected if the 'spring-data-jpa' library is removed from the class path. Wouldn't that be inconsistent behaviour? – Haxiel Jul 27 '16 at 13:54
  • I solve the problem 20 minutes ago on my own but this is a great answer. Thank you! – amicoderozer Jul 27 '16 at 13:56
  • 1
    @XSurgent the spring-data-jpa contains cdi package that maybe is causing the issue. http://docs.spring.io/spring-data/jpa/docs/current/api/org/springframework/data/jpa/repository/cdi/package-summary.html – amicoderozer Jul 27 '16 at 14:05
  • 2
    @XSurgent as @amicoderozer referenced, it's likely that the application doesn't exercise the `cdi-1.2` feature without the spring-data-jpa project – wtlucy Jul 27 '16 at 14:14