New Tomcat env working, but issues caching beans on client

Questions and answers on developing, deploying and using plugins and JavaBeans

New Tomcat env working, but issues caching beans on client

Postby erikvangeene » Thu May 20, 2021 11:25 am

Hi all,

I am very new to Tomcat/Java/Servoy as I started just 3 weeks ago for my new employer. My only experience with Java was compiling my sons "own minecraft server" years ago...
I am not a developer, I'm more the technical guy who needs to install the Tomcat environments and start them with the WAR-files in the right directory.

::Not all bean files are cached locally::
So I was confronted with my first task "Install and make our app work on a newer release of Tomcat 9"
There seems to be a hickup when getting higher than Tomcat 9.0.22 using Servoy 8.2.2 as environment.
I skipped a lot of versions (tested them, but all have problems) ending up with Tomcat 9.0.45 and 46 which I both have working with the app, but the catch is:

In the client cache directory .servoy, there are 20 bean-files missing compared to the same solution running on Tomcat 9.0.6
Just simply copying the missing bean-files from the old cache to the new makes the application run smoothly.

When deleting all java cache, deleting the .servoy client cache, deleting the application directories in webapps leaving the WAR-files for a fresh install on the Tomcat environment and restarting Tomcat, starting the application,...
Still the client cache ".servoy/libCache/XYZWhatever/Applicationname/beans" only gets 2 bean files downloaded from the original 22 in the 9.0.6 installation.

Why would it skip 20 of them?
It only caches jpedal-lgpl-4.70b22.jar and HTMLEditorEnterprise.jar.

There is a "main.jnlp" written in cache containing a resource overview of the lib, beans, lafs, plugins. And it is 3Kb less than the original environment as it only lists 2 beans instead of 22.
These beans "seem to be signed" (I have no knowledge about this) and the beans.properties file on the server in appname/beans seems to contain the same values before the colon. (E.g. HTMLEditorEnterprise.jar=1605814392837:18273 is also mentioned in main.jnlp)

So basically, only the Tomcat environment is updated. Why would it be not downloading all the beans?
Where do I need to look?
erikvangeene
 
Posts: 3
Joined: Thu May 20, 2021 10:49 am

Re: New Tomcat env working, but issues caching beans on clie

Postby swingman » Thu May 20, 2021 4:33 pm

Hi Erik,

I am assuming you are deploying Smart-Client.
When exporting the WAR file from Servoy, there is a number of screens where you specify what resources you are exporting in the .war, including a screen with a list of plugins and beans.
Servoy would normally pre-select what you need. Are you saying despite ticking the beans you need, they do not get exported in your .war file?

If so, that sounds like a bug, possibly in 8.2.2... I'd check the release notes for the 8.2.x series to see if there was a bug fix in the later versions.
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: New Tomcat env working, but issues caching beans on clie

Postby erikvangeene » Fri May 21, 2021 4:50 pm

I am still figuring out what kind of Client we use (I see Headless and Smart but I think both?), but for the picture:
We install Tomcat, do some config changes, and copy 2 WAR files in /webapps
Then we start Tomcat and it just extracts the apps and starts to run.
This is the way they do it here.
So now I just did this in a new Tomcat environment but there are many things I see in the logs which differ from the production version.
One of them is the .4jlog something which doesn't initialise properly, but that I will have to figure out later.
The main thing which makes the application giving problems are these 20 missing beans.
The WAR is the same in both environments.

Updating Servoy is something I think a bit of a problem for the development dept. They will not do that for this version. (They are already developing a new version of the app on a new Servoy env)
erikvangeene
 
Posts: 3
Joined: Thu May 20, 2021 10:49 am

Re: New Tomcat env working, but issues caching beans on clie

Postby erikvangeene » Wed May 26, 2021 7:19 pm

Fun fact: I've got our solution finally running on both 9.0.33 and 9.0.45

We had logfiles running big because there was an issue with caching memory size being insufficient.
So I altered the Context.xml:

<Resources cachingAllowed="true" cacheMaxSize="102400" />

As default is 10MB, we upped it to 100MB (actually 50MB was sufficient to get rid of that error)

But after a certain Tomcat version 9.0.x it seems to work a bit different.
JAR files and plugins are cached. But the beans? Just 2 were cached, missing 20 beans.

So we tried doing hilarious settings like cache for 2GB, still no go. (the normal size of cache on the client in production is under 200MB)

And then there was the option to turn off caching mode entirely...
Not something I thought would be helping, as we would love to cache if possible, maybe it speeds up things, that's what it's for.

So I tried:

Code: Select all
<Resources antiResourceLocking="false" cachingAllowed="false" />

Logs show that antiResourceLocking="false" is not being used anymore, so finally it came down to adding

Code: Select all
<Resources cachingAllowed="false" />


to the Context.xml and all beans are cached instead of just 2 of them.

Works!

The application seems to give errors in 9.0.46 in the UI like "cannot load form data" "relation or ID not found" and more. So I skipped that version.
That's probably something to do with development/coding and not some setting in Apache Tomcat.
Cache seems to be fine though.

So, missing beans in client cache on Tomcat 9.0.33 and higher?
Turning off cache works.
erikvangeene
 
Posts: 3
Joined: Thu May 20, 2021 10:49 am


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 11 guests

cron