"Additional libraries present" error on starting 22.1

Having trouble installing Oxygen? Got a bug to report? Post it all here.
mboudreau
Posts: 68
Joined: Sat Jan 07, 2017 1:23 am

"Additional libraries present" error on starting 22.1

Post by mboudreau »

I downloaded and installed Oxygen 22.1 today. However, after adding the file mysql-connector-java-5.1.42-bin.jar to the libraries folder (we use this for an XSLT transform that consults a MySQL database), I get this error message on startup:
There are additional libraries present in the application libraries folder.
Please close the application, uninstall it completely and then re-install.
If I click OK on the error message dialog, it goes away and the application finishes starting up and seems to work as usual. However, the next time I quit and start the app again, I get the same error message.

We've added this .jar file to previous versions of Oxygen with no trouble. Is there a way to get rid of the error message for good?
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: "Additional libraries present" error on starting 22.1

Post by Radu »

Hi,

Indeed Oxygen reports this new error when there are extra libraries in its "lib" folder because those libraries may interfere with its default libraries. Also by default if you click Ok in the error dialogs, Oxygen will skips loading those extra libraries and start up.
Some options that you have:

1) One option is to avoid adding that JAR library to the "lib" folder, instead in the transformation scenario you have configured in Oxygen to run the XSLT transformation there is a "Libraries" button where you can refer to that extra JAR library and use it only when transforming.
2) In the Oxygen "lib" folder there is a "libraries.list" file. Delete that file and re-start Oxygen, it will no longer show that error on startup and will load your additional library.
3) You can create a plugin for Oxygen and have that plugin contribute the library to Oxygen's class loader. I can give you more details about this if you are most interested.

I would recommend (1), it's cleaner not to add that library in the Oxygen libraries folder.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
mboudreau
Posts: 68
Joined: Sat Jan 07, 2017 1:23 am

Re: "Additional libraries present" error on starting 22.1

Post by mboudreau »

Hi Radu,

Thanks for your reply. I tried to set up your option 1, moving the JAR file into the framework folder, but on running the transformation that connects to MySQL, I now get a different error message:
The script cannot be executed: Failed to load JDBC driver org.gjt.mm.mysq.Driver
In the framework's configuration dialog for the transformation scenario, I clicked the "Extensions" button and updated the "Libraries" dialog to show the new location of the JAR file:

Code: Select all

${framework}/lib/mysql-connector-java-5.1.42-bin.jar
(I don't seem to have the Libraries button that you mentioned)

Then in Preferences > Data Sources I have also configured a data source called "MySQL" with the following values:
  • Type: Generic JDBC
  • Driver files: file:/Applications/Oxygen%2022.1/frameworks/ucp_journalpublishing/lib/mysql-connector-java-5.1.42-bin.jar
  • Driver calls: org.jgt.mm.mysql.Driver
So the only things that have changed from when this worked under Oxygen 21.1 are the location of the JAR file and the paths indicated in the transformation configuration and the data source configuration.
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: "Additional libraries present" error on starting 22.1

Post by Radu »

Hi,

Indeed in my last email I should have referred to the "Extensions" button instead of the "Libraries".
What you did seems alright to me.
So the XSLT transformation does not work, right? Does the data source connection work?
I'm not sure about the XSLT transformation, would you be able to provide me with a minimal XSLT for which the problem can be reproduced on my side?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
mboudreau
Posts: 68
Joined: Sat Jan 07, 2017 1:23 am

Re: "Additional libraries present" error on starting 22.1

Post by mboudreau »

Hi Radu,

The transformation doesn't work because the script is set up to terminate if the MySQL connection cannot be made.

Here is my minimal version of the transformation (I hope it's not too long). This works under Oxygen 21.1 with the JAR file in OxygenHome/lib, and does not work under Oxygen 22.1 with the JAR file in OxygenHome/frameworks/framework/lib.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:atict="http://www.arbortext.com/namespace/atict" xmlns:saxon="http://saxon.sf.net/"
    xmlns:sql="http://saxon.sf.net/sql" xmlns:ucpj="http://www.journals.uchicago.edu/xslt"
    xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"
    exclude-result-prefixes="atict ucpj xs" extension-element-prefixes="saxon sql" version="2.0">
    
    <xsl:output method="xml" xml:space="default" extension-element-prefixes="sql"/>
    
    <!-- OLD DRIVER: com.mysql.jdbc.Driver -->
    <!-- NEW DRIVER: org.gjt.mm.mysql.Driver -->
    <xsl:variable name="db-driver" select="'org.gjt.mm.mysql.Driver'"/>
    <xsl:variable name="db-database" select="'jdbc:mysql://[servername]:3306/ucpj'"/>
    <xsl:variable name="db-user" select="'****'"/>
    <xsl:variable name="db-password" select="'****'"/>

    <!-- as=java:java.sql.Connection -->
    <!-- as=java:java.lang.Object -->
    <xsl:variable name="db-connect" as="java:java.sql.Connection"
        xmlns:java="http://saxon.sf.net/java-type">
        <sql:connect driver="{$db-driver}" database="{$db-database}" user="{$db-user}"
            password="{$db-password}">
            <xsl:fallback>
                <xsl:message terminate="yes">
                    <xsl:text>ERROR: Connection to MySQL database failed.</xsl:text>
                </xsl:message>
            </xsl:fallback>
        </sql:connect>
    </xsl:variable>

    <xsl:variable name="ucpj-test" as="xs:string">
        <sql:query connection="$db-connect" table="people" column="initials" where="PeopleID = '47'"
            row-tag="#auto" column-tag="#auto"/>
    </xsl:variable>

    <xsl:template match="@* | *">
        <xsl:copy copy-namespaces="no">
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="article">
        <xsl:choose>
            <xsl:when test="not(element-available('sql:connect'))">
                <xsl:message terminate="yes">
                    <xsl:text>ERROR: sql:connect IS NOT AVAILABLE.</xsl:text>
                </xsl:message>
            </xsl:when>
            <xsl:otherwise>
                <xsl:message>
                    <xsl:text>Database says: </xsl:text>
                    <xsl:value-of select="$ucpj-test"/>
                </xsl:message>
            </xsl:otherwise>
        </xsl:choose>
        <xsl:copy copy-namespaces="yes">
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template>

</xsl:stylesheet>
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: "Additional libraries present" error on starting 22.1

Post by Radu »

Hi,

Let's say that you copy that extra jar to the Oxygen 22.1 "lib" folder, if you follow my advice above:
In the Oxygen "lib" folder there is a "libraries.list" file. Delete that file and re-start Oxygen, it will no longer show that error on startup and will load your additional library.
does Oxygen 22.1 start working with your XSLT and the original transformation scenario?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
mboudreau
Posts: 68
Joined: Sat Jan 07, 2017 1:23 am

Re: "Additional libraries present" error on starting 22.1

Post by mboudreau »

Hi Radu,

Yes, if I go back to the configuration that worked with 21.1 and move "libraries.list" from the lib directory, the MySQL connection is made and the transformation works.

I do prefer your solution #1 though, since it makes sharing the framework or upgrading to a new version a bit easier.
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: "Additional libraries present" error on starting 22.1

Post by Radu »

Hi,

Thanks for the details, we have an internal issue to look into first making such a connection work with the JAR library included in the main Oxygen libraries, after this to try and move the JAR library as an extension in the transformation scenario and try to make it work this way. If we manage to fix this problem we'll update this forum thread.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply