Reload One Copy XPage Design (SCXD) * Java * Application Development

I use Single Copy XPage Design, with all my business logic written as Java in files in WebContent \ WEB-INF.

If I need to make changes to XPage or Custom Control, I can update my template, update the design, and immediately receive the changes.

However, if I want to make changes to the Java code, everything seems to be cached, and the only method I found to pick up the changes is to restart the http task.

So far I have tried:

  • SCXD Database Design Update
  • replacement of SCXD database design
  • scxd database cleanup
  • editing faces-config (both in the template and in the SCXD database)
  • delete .class files for compiled Java code in the SCXD database and restore
  • issuing the command "report HTTP xsp refresh" to the server
  • replacing the SCXD database with a new copy
  • replacement of database design pointing to SCXD database

There seems to be nothing that could take web pages to modify Java code other than restarting the http task.

Is there something I missed?

+7
xpages
source share
1 answer

We registered this issue as SPR # LHEY9X5EBP .

I posted this question around the XPages team, and Mayr Kehoe provided the following information and a workaround to try.

Not a known issue. It looks like an error in NSFComponentModule.refresh () when there is a Module template, it never finds changes in files and never drops the Loader class.

Workaround: button to go to reset.

<?xml version="1.0" encoding="UTF-8"?> <xp:view xmlns:xp="http://www.ibm.com/xsp/core"> <xp:button value="Reset App ClassLoader" id="button1"> <xp:eventHandler event="onclick" submit="true" refreshMode="complete"> <xp:this.action><![CDATA[#{javascript:inapp.ResetUtil.reset()}]]></xp:this.action> </xp:eventHandler> </xp:button> 

Java Code:

 package inapp; import com.ibm.domino.xsp.module.nsf.ModuleClassLoader; public class ResetUtil { public static void reset(){ ClassLoader appClassLoader = Thread.currentThread().getContextClassLoader(); ((ModuleClassLoader)appClassLoader).resetDynamicClassLoader(); // That code will give: // Script interpreter error, line=1, col=17: Error calling method 'reset()' on java class 'inapp.ResetUtil' // Access denied (java.lang.RuntimePermission getClassLoader) // need to edit C:\Domino\jvm\lib\security\java.policy file to have: // grant codeBase "xspnsf://server:0/disc2.nsf/-"{ // nsf name here must be .toLowerCase of actual nsf name. // permission java.lang.RuntimePermission "getClassLoader"; //}; } } 

Permissions to run this Java code. In C: \ Domino \ jvm \ lib \ security \ java.policy add this line updated to your nsf name:

 grant codeBase "xspnsf://server:0/disc2.nsf/-"{ // nsf name here must be .toLowerCase of actual nsf name. permission java.lang.RuntimePermission "getClassLoader"; }; 
+2
source share

All Articles