[jboss-jira] [JBoss JIRA] (WFLY-12769) Make standalone.sh more classpath friendly

Dominik Derwiński (Jira) issues at jboss.org
Thu Nov 7 05:51:00 EST 2019


Dominik Derwiński created WFLY-12769:
----------------------------------------

             Summary: Make standalone.sh more classpath friendly
                 Key: WFLY-12769
                 URL: https://issues.jboss.org/browse/WFLY-12769
             Project: WildFly
          Issue Type: Enhancement
          Components: Class Loading
    Affects Versions: 18.0.0.Final
            Reporter: Dominik Derwiński
            Assignee: Richard Opalka


Java 9+ no longer has jre/lib/ext, which was easiest way to add custom charset provider for use by JDBC data sources. The way to handle it now is to add charset jar on classpath or put it in app-specific lib/ext counterpart. It works well for apps like NetBeans or SquirrelSQL. I have found adding charset provider nearly impossible WildFly, which prevents migrating from Java 8 to 11, but a simple change to standalone.sh allows to solve that issue.

I have tried other approaches:
* classpath argument in JAVA_OPTS
* custom global module with services set to true
* JDBC driver module depending on custom module with services set to import
* JDBC driver module with charset jar as resource (along driver jar)

None of those method work. Finally I have found why the classpath argument doesn't work, it's because standalone.sh uses -jar option, which causes it to ignore classpath settings. By changing this line:
{noformat}
-jar \""$JBOSS_HOME"/jboss-modules.jar\" \
{noformat}
to
{noformat}
-cp \""$JBOSS_HOME"/jboss-modules.jar:"$JBOSS_BASE_DIR"/lib/ext/*\" org.jboss.modules.Main \
{noformat}
I was able to add charset jar on classpath by placing it in my profile/lib/ext directory.

Please consider changing this code in standalone.sh to make the standalone/lib/ext directory actually useful for something.

You may also try to investigate why isn't the charser provider loaded when using module approach. That might be some kind of bug.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)



More information about the jboss-jira mailing list