Page 1 of 1

Building OWS from src

Posted: 10 May 2022, 15:46
by hilalkale
Hi all,

I wanted to build OWS from source code. I fetched the repo from github and made a successful maven build (OWS-1.6). But the question is how can I generate an installer? Or just replacing the openwebstart.jar under the installation directory is enough?

Re: Building OWS from src

Posted: 10 May 2022, 15:59
by Janak Mulani
Installer is not open source. It is built using Install4J. You may replace the jar in current install dir. OWS will work except that the Installer Update feature may still think it is an old version.

Re: Building OWS from src

Posted: 10 May 2022, 16:24
by hilalkale
Hi Janak,

Thanks for your reply. When I copy the generated jar file under the current installation directory, on stage-1 logs I still see the line stating that the OWS version is 1.5.2.

Re: Building OWS from src

Posted: 10 May 2022, 16:32
by hilalkale
I guess it takes version info from install4j config, right?

Re: Building OWS from src

Posted: 11 May 2022, 07:31
by Janak Mulani
yes. that is what I said, i4J still believes it is an old version.

Re: Building OWS from src

Posted: 11 May 2022, 07:32
by Janak Mulani
May I ask what change did you make? Would you like to provide a PR so that the change can be shared with the community?

Re: Building OWS from src

Posted: 11 May 2022, 11:57
by hilalkale
Hi Janak,

I haven't done any change yet, but I am planning to get the branch "1.8-linkageerror" from icedtea-web repo, where there is a classloader patch is applied and then I want to use that one in the ows. That's why I wanted to fetch and build both ows and icedtea-web. So may be it would be a solution to our problem I mentioned in the log4j thread.

Re: Building OWS from src

Posted: 12 May 2022, 07:54
by Janak Mulani
Do you want to apply the fix of https://github.com/AdoptOpenJDK/IcedTea-Web/pull/856 to OWS?

I checked that there is similar code in ITW-2.0.0-alphaX which is used by OWS..

> problem I mentioned in the log4j thread

Will it be possible for you to make a small example that reproduces the log4j issue? Then we can debug OWS and try to fix it.

Re: Building OWS from src

Posted: 12 May 2022, 09:37
by hilalkale
Hi Janak,

Yes I checked later and saw the same. To be honest, I want to share a simple example to reproduce to problem but i am not sure if I can prepare something in short time but as soon as I can, I am going to share it with you. In the meantime I tried building OWS master branch (1.6.0) using ITW3.0.0-alpha2, I made some little code changes to make it work as you may guess (Actually in this way I made something like OWS 3.0.0alpha2 version). And it works very well with log4j updates as we expected. And I know that you tried a new classloader on 3.0.0-alpha2. May I ask why you abandoned that branch?

Re: Building OWS from src

Posted: 12 May 2022, 10:11
by Janak Mulani
You can just take OWS-3.0.0-alpha2 and test the log4j issue. Let me know if it works out of the box.

We tried new class loader in OWS-3.0.0-alpha2 but it is not complete yet, it is missing the sandbox and some other features.

Re: Building OWS from src

Posted: 12 May 2022, 10:19
by hilalkale
Hi Janak,

As I stated in logj4 thread, OWS3.0.0-alpha2 version works very well with log4j update. Actually with OWS3.0.0-alpha2 I also don't face the PluginAliases problem too. For me it seems using OWS3.0.0-alpha2 would solve all problems, but I just can't say to the customers use this abandoned version instead of the official one.

Re: Building OWS from src

Posted: 16 May 2022, 06:13
by Janak Mulani
OWS 3.0.0-alpha2 is not complete. Features like Sandbox are missing. It does have an improved classloader. We gave it up for lack of resources. After all this is an opensource project and we have limited budgets.

Re: Building OWS from src

Posted: 18 May 2022, 09:42
by hilalkale
Hi Janak,

I realized that, if I change the order of the jar files inside the JNLP file, the class that is not found changes or sometimes it gives IllegalStateException. During the debug (on icedtea-web master branch) I noticed that, inside the loasClass(...), it searches and adds the class in the order: findLoadedClassAll, loadClassFromParentClassloader, loadClassExt, loadClassFromInternalManifestClasspath, loadFromJarIndexes. But the list entry is a functional interface. And before loading from parent ends, loading from ext, manifets and jar indexes resulted and thus giving the exception. Trying to load from parent takes longer than the others. And I assume the other three should start actually after finishing the parent check? In the attached screenshot you can see my debug prints. Can you please have a look and share your opinion?

Re: Building OWS from src

Posted: 18 May 2022, 19:45
by Janak Mulani
> I realized that, if I change the order of the jar files inside the JNLP file,

Yes, I too have noticed this.

> During the debug (on icedtea-web master branch) I noticed that, inside the loasClass(...),

Since it is not reproducible and since we are short of resources we did not get around to step through the code. Also we had to make a new release with the latest version of bundled JRE. Just yesterday we were looking at the JnlpClassloader again and started putting some log statements. Thanks for your hints. We will surely have a look and come back but allow me some time as all of us are busy with other projects.