Development Setup

Confluence User - 13 May, 2021

Hello Joget Community,

Trying to run Joget in Netbeans on Tomcat. The first deployment works and i run through the setup. The setup creates files in the wflow directory and the server starts successfully. The second time i redeploy the war the setup screen reappears with "Sorry, access is forbidden for security reasons.". Now i need to clean the wflow directory, reset the database etc. to make it work once again.

  • Is the server compatible with the JDK 11?
  • Is there a special development workflow/setup that i am missing here?
  • Is my MySQL configuration wrong?

The logs file does display this message: (edit: this seems unrelated)

*****************************************************
* Owasp.CsrfGuard Properties
*
* Logger: org.joget.commons.util.CsrfGuardLogger
* NewTokenLandingPage: null
* PRNG: SHA1PRNG
* SessionKey: OWASP_CSRFTOKEN
* TokenLength: 32
* TokenName: OWASP_CSRFTOKEN
* Ajax: true
* Rotate: false
* Javascript cache control: null
* Javascript domain strict: false
* Javascript inject attributes: false
* Javascript inject forms: false
* Javascript referer pattern: null
* Javascript referer match domain: false
* Javascript source file: null
* Javascript X requested with: null
* Protected methods: Empty HashSet
* Protected pages size: 0
* Unprotected methods: HashSet size: 1: [0]: GET

* Unprotected pages size: 3
* TokenPerPage: false
* Enabled: true
* ValidateWhenNoSessionExists: true
* Action: org.owasp.csrfguard.action.Log
*	Parameter: Message = potential cross-site request forgery (CSRF) attack thwarted (user:%user%, ip:%remote_ip%, method:%request_method%, uri:%request_uri%, error:%exception_message%)
* Action: org.owasp.csrfguard.action.Error
*	Parameter: Message = Security Violation.
*	Parameter: Code = 403
* Action: org.owasp.csrfguard.action.Rotate
*****************************************************

Best regards,
Sander Hahn

develop;security

2


13 May, 2021
confluenceUser
confluenceUser

Restart of Tomcat seem necessary to redeploy the war file. One of the log entries on a undeploy is:

13-May-2021 14:35:51.006 INFO [mysql-cj-abandoned-connection-cleanup] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
        java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
                at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1392)
                at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1045)
                at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.checkThreadContextClassLoader(AbandonedConnectionCleanupThread.java:117)
                at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:84)
                at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
                at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
                at java.base/java.lang.Thread.run(Thread.java:834)
Exception in thread "Thread-130" java.lang.IllegalStateException: The org.joget.cache.DATASOURCE_CACHE Cache is not alive (STATUS_SHUTDOWN)
        at net.sf.ehcache.Cache$CacheStatus.checkAlive(Cache.java:4267)
        at net.sf.ehcache.Cache.checkStatus(Cache.java:2701)
        at net.sf.ehcache.Cache.get(Cache.java:1576)
        at net.sf.ehcache.Cache.get(Cache.java:1557)
        at org.joget.commons.util.DynamicDataSourceManager.getCurrentProfile(DynamicDataSourceManager.java:168)
        at org.joget.web.presence.PresenceManager.loadPathMap(PresenceManager.java:165)
        at org.joget.web.presence.PresenceManager.getPaths(PresenceManager.java:202)
        at org.joget.web.presence.PresenceManager$2.run(PresenceManager.java:76)
        at java.base/java.lang.Thread.run(Thread.java:834)

Looks like the mysql connections are not properly cleaned up on undeploy. The Joget can't open a mysql connection and redirects to setup and this gives the error message. Restarting the Tomcat forcefully closes the connections and that fixes the situation.

So workaround seems to be to restart Tomcat...

17 May, 2021
confluenceUser
confluenceUser

Hi, I would suggest deploying the Joget WAR in a proper installation of Tomcat, or whichever deployment approach you are using like in Advanced Installation Guide.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print