Re: [basex-talk] Reloading jars on a running http server.

2021-04-21 Thread Christian Grün
Hi Reece,

If you install your Java code as JAR file in the repository [1], the
code will be loaded and unloaded every time when your query is
executed. If you get an error message…

  java.lang.reflect.InaccessibleObjectException: Unable to make field
private final jdk.internal.loader.URLClassPath
java.net.URLClassLoader.ucp accessible: module java.base does not
"opens java.net" to unnamed module @79e2c065

…unloading fails [2], as you’re probably using a more recent version
of the JDK, which restricts reflective access to internal variables.
You can get around this by adding Java flags at startup time:

 --add-opens java.base/java.net=ALL-UNNAMED
 --add-opens java.base/jdk.internal.loader=ALL-UNNAMED

Maybe there are better solutions to unload JAR files today.
Suggestions are welcome!

Hope this helps,
Christian

[1] https://docs.basex.org/wiki/Repository#Java
[2] 
https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/util/JarLoader.java#L34



On Tue, Apr 20, 2021 at 6:44 PM Reece Dunn  wrote:
>
> Hi all,
>
> I'm working on a Java class that I'm importing into an XQuery, so I can do 
> additional processing on the data that isn't easily expressible in XQuery (or 
> XSLT). In order to get BaseX to pick up a modified version of the jar file 
> I'm building, I'm restarting the BaseX http server.
>
> This makes it slower to turn around testing the changes. Is there a better 
> way of doing this?
>
> Kind regards,
> Reece


Re: [basex-talk] Using other Java runtimes?

2021-04-21 Thread Eric J. Schwarzenbach
I've also used Zulu with BaseX (Java 14 and 16) successfully. Note that 
Zulu is a /distribution/ of OpenJDK much the way Ubuntu is distribution 
of Linux. I've also used Adopt OpenJDK on some machines and have never 
had any problems with either. If you are working in a corporate setting, 
you may find the fact that you can buy support for these distributions 
may help with red tape issues.


Cheers,

Eric


On 4/17/21 4:28 PM, Omar Siam wrote:


Hi,

I switched to https://www.azul.com/downloads/zulu-community/ for 
Windows and Mac shortly after Oracle announced their license change. 
On Linux I use the built in JDK. Tried Zulu Community on Linux as 
container for some legacy Java that had to be run or built with some 
of the older versions 8 and before.


Never had any problems.

It seems BaseX is a software that doesn't use anything only Oracle has 
in their distribution.


I start to forget about Oracle as primary source of Java. Any OpenJDK 
is good these days I think. I hope that is what they intended to achieve.


Best regards

Omar

Am 16.04.2021 um 23:39 schrieb Peter Villadsen:


Guys,

I was wondering what the options are for running BaseX on top of a 
runtime that is different from the Oracle one? I see Oracle is 
aggressively monetizing the Java runtime, but I know there are 
alternatives out there. Have any been tested with BaseX?


Best Regards

Peter Villadsen

Principal Architect

Microsoft Business Applications Group



[basex-talk] BaseX and Oxygen scenario

2021-04-21 Thread Zimmel, Daniel
Hi,

am I right in assuming that in order to use the XQJ interface as described here 
(https://docs.basex.org/wiki/Integrating_oXygen) , you  will always need a 
running local database instance of BaseX?
I am not able to use the BaseX.jar standalone in a transformation scenario as I 
would for example do in a custom ant scenario where I can use BaseX as a 
standalone transformer (using it as a commandline process).

Thanks, Daniel