Skip to content

Commit

Permalink
Remove set.ext.dirs from GlassFish Porting kit (#879)
Browse files Browse the repository at this point in the history
* Remove set.ext.dirs for Jakarta EE 10+ / JDK 11 #733

Signed-off-by: Scott Marlow <smarlow@redhat.com>

* Deeper removal of ext.dirs for #733, including substantial update to com.sun.ts.lib.util.sec.misc.Launcher

Signed-off-by: Scott Marlow <smarlow@redhat.com>

* remove PolicyFile reference to removed ext.dirs support

Signed-off-by: Scott Marlow <smarlow@redhat.com>
  • Loading branch information
scottmarlow committed Mar 17, 2022
1 parent 1988de2 commit 2185cc9
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 916 deletions.
124 changes: 0 additions & 124 deletions bin/xml/impl/glassfish/s1as.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
<property name="server.config.dir" value="config"/>
<property name="server.home" value="${javaee.home}"/>
<property name="drive" value="${s1as.applicationRoot}"/>
<property name="ext.dir.prop" value="-Djava.ext.dirs="/>
<property name="start.index" value="16"/>
<property name="custom.resource.jndi.name" value="custom/dog"/>

Expand Down Expand Up @@ -217,23 +216,13 @@
</not>
</condition>

<!-- Check if we need to set ext.dirs -->
<condition property="s1as.db.ext.dirs.set">
<not>
<equals arg1="" arg2="${s1as.db.ext.dirs}" casesensitive="true" trim="true"/>
</not>
</condition>

<!-- Check to see if we are using DB2 -->
<condition property="using.db2.type2">
<contains string="${use.jdbc.poolName}" substring="db2" casesensitive="false"/>
</condition>

<condition property="db2.props.set">
<and>
<isset property="using.db2.type2"/>
<isset property="s1as.db.ext.dirs.set"/>
</and>
</condition>

<!-- Check to see if we are using Oracle, will be needed in the future -->
Expand Down Expand Up @@ -710,19 +699,6 @@
<antcall target="copy.db2.jars"/>
<antcall target="delete.db2.jars"/>

<!--
Since the get command is broken (issue tracker bug id 7151) we need to use
our regular expression hack to set the extension directories while the server
is down. If we modify the domain.xml disk file while the server is up, the
server process can overwrite our changes to the domain.xml file. See
set.ext.dirs target below to see the hack. We now call these two targets from
javaee_vi.xml's config.vi target before the server is started. Seems to do
the trick. This code can be reverted once they fix bug ID 7151. We can go
back to using the get command.
<antcall target="reset.ext.dirs"/>
<antcall target="add.ext.dirs"/>
-->
<antcall target="set" >
<param name="set.value" value=" ${resources.dottedname.prefix}.jdbc-connection-pool.${use.jdbc.poolName}.max_pool_size=${use.jdbc.maxpoolsize}"/>
</antcall>
Expand Down Expand Up @@ -1053,106 +1029,6 @@
</antcall>
</target>

<!-- revisit these values for V3. -->
<target name="set.ext.dirs.value.mac" if="isMac">
<property name="default.ext.dirs" value="$$\{com.sun.aas.javaRoot\}/lib/ext$\{path.separator\}$$\{com.sun.aas.javaRoot\}/jre/lib/ext$$\{path.separator\}$$\{com.sun.aas.instanceRoot\}/lib/ext$$\{path.separator\}$$\{com.sun.aas.installRoot\}/lib/jdbcdrivers$$\{path.separator\}$$\{com.sun.aas.installRoot\}/../javadb/lib"/>
</target>

<target name="set.ext.dirs.value.non.mac" unless="isMac">
<property name="default.ext.dirs" value="$$\{com.sun.aas.javaRoot\}/lib/ext$\{path.separator\}$$\{com.sun.aas.javaRoot\}/jre/lib/ext$$\{path.separator\}$$\{com.sun.aas.instanceRoot\}/lib/ext$$\{path.separator\}$$\{com.sun.aas.installRoot\}/lib/jdbcdrivers$$\{path.separator\}$$\{com.sun.aas.installRoot\}/../javadb/lib"/>
</target>


<!--
reset.ext.dirs Sets the S1AS extension directory property
back to it's original value as defined by the default.ext.dirs
property.
-->
<target name="reset.ext.dirs" depends="set.ext.dirs.value.mac, set.ext.dirs.value.non.mac"
unless="using.db2.type2">
<antcall target="set.ext.dirs">
<param name="ext.dirs.to.use" value="${default.ext.dirs}"/>
</antcall>
</target>

<!--
add.ext.dirs Add the extension directories defined by
the s1as.db.ext.dirs property in the ts.jte file to the
S1AS extension directory. This is currently used to allow
CTS to run against S1AS using a type 2 DB driver. Currently
our only type 2 driver is DB2.
-->
<target name="add.ext.dirs" depends="set.ext.dirs.value.mac, set.ext.dirs.value.non.mac"
if="db2.props.set">
<antcall target="set.ext.dirs">
<param name="ext.dirs.to.use" value="${default.ext.dirs}$$\{path.separator\}${s1as.db.ext.dirs}"/>
</antcall>
</target>

<!--
set.ext.dirs sets the extension directory value for S1AS.
The value is passed as the ext.dirs.to.use param. This
task is called by add.ext.dirs and reset.ext.dirs.
-->
<target name="set.ext.dirs">

<property name ="domain.file"
value="${server.home}/domains/domain1/config/domain.xml"/>
<loadfile property="domain.file.contents" srcfile="${domain.file}"/>
<propertyregex property="ext.dir.not.found"
input="${domain.file.contents}"
regexp="&lt;jvm-options>-Djava.ext.dirs=(.*)&lt;/jvm-options>"
replace="&lt;jvm-options>-Djava.ext.dirs=${ext.dirs.to.use}&lt;/jvm-options>"
defaultvalue="true"/>
<if>
<istrue value="${ext.dir.not.found}"/>
<then>
<echo>Extension directory does not match default, so not setting.</echo>
</then>
<else>
<echo>Extension directory found.</echo>
<echo> Extension directory set to: ${ext.dirs.to.use}</echo>
<copy file="${domain.file}" tofile="${domain.file}.original" failonerror="false"/>
<echo message="${ext.dir.not.found}" file="${domain.file}"/>
<echo>${domain.file} written to disk.</echo>
</else>
</if>


<!-- Currently broken in V3. See bug ID 7151 in issues tracker. Add back secodn dash to
user, passworfile, host and port when working, sicne the double -'s are not allowed in XML
comments.
<exec executable="${exec.asadmin}" outputproperty="current.props">
<arg line="${exec.asadmin.part2}"/>
<arg line="-user ${admin.user}"/>
<arg line="-passwordfile ${password.file}"/>
<arg line="-host ${server.host}"/>
<arg line="-port ${server.port}"/>
<arg line="get"/>
<arg line="${server.instance}-config.java-config.jvm_options"/>
</exec>
<string this="${current.props}" method="indexOf" return="index.of.ext.prop" arg1="${ext.dir.prop}"/>
<string this="${current.props}" method="substring" return="ext.dirs" arg1="${index.of.ext.prop}"/>
<string this="${ext.dirs}" method="indexOf" return="index.of.last.comma" arg1=","/>
<string this="${ext.dirs}" method="length" return="ext.dirs.length"/>
<condition property="end.index" value="${ext.dirs.length}">
<equals arg1="${index.of.last.comma}" arg2="-1"/>
</condition>
<property name="end.index" value="${index.of.last.comma}"/>
<string this="${ext.dirs}" method="substring" return="ext.dir" arg1="${start.index}" arg2="${end.index}"/>
<echo message="Current Extension Directories: &quot;${ext.dir}&quot;"/>
<property name="new.ext.dirs" value="${ext.dir.prop}${ext.dirs.to.use}"/>
<echo message="New Extension Directories: &quot;${new.ext.dirs}&quot;"/>
<antcall target="delete-jvm-options">
<param name="jvm.options" value="${ext.dir.prop}${ext.dir}"/>
</antcall>
<antcall target="create-jvm-options" >
<param name="jvm.options" value="${new.ext.dirs}"/>
</antcall>
-->
</target>

<property name="ant.opts" value=""/>
<property name="run.client.args" value=""/>
<property name="buffering.enabled" value="false"/>
Expand Down
1 change: 0 additions & 1 deletion install/connector/bin/ts.jte
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ s1as.imq.share.lib=${connector.home}/imq/lib
s1as.jvm.options=-XX\\\:MaxPermSize=512m:-Doracle.jdbc.J2EE13Compliant=true:-Dj2eelogin.name=${user}:-Dj2eelogin.password=${password}:-Deislogin.name=${user1}:-Deislogin.password=${password1}
s1as.java.endorsed.dirs=${endorsed.dirs}
s1as.applicationRoot=c:
s1as.db.ext.dirs=



Expand Down
1 change: 0 additions & 1 deletion install/jacc/bin/ts.jte
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ s1as.imq.share.lib=${jacc.home}/imq/lib
s1as.jvm.options=-XX\\\:MaxPermSize=512m:-Doracle.jdbc.J2EE13Compliant=true
s1as.java.endorsed.dirs=${endorsed.dirs}
s1as.applicationRoot=c:
s1as.db.ext.dirs=

###############################################################
# @extension.dir - The extension directory for the app server under test.
Expand Down
5 changes: 0 additions & 5 deletions install/jakartaee/bin/ts.jte
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,6 @@ vi.applicationRoot=c:
# with connector tests.
# @s1as.applicationRoot-- Location of application repository
# Only needed when running on windows
# @s1as.db.ext.dirs -- The extension directory for DB Type 2
# drivers. Currently, this only needs
# to be set when using DB2 else it
# should be empty.
###############################################################
s1as.admin.user=admin
s1as.admin.passwd=
Expand All @@ -409,7 +405,6 @@ s1as.jvm.options=-XX\\\:MaxPermSize=512m:-Doracle.jdbc.J2EE13Compliant=true:-Xmx
s1as.jvm.options.remove=-XX\\\:MaxPermSize=192m:-Xmx512m:${s1as.jvm.options}
s1as.java.endorsed.dirs=${endorsed.dirs}
s1as.applicationRoot=c:
s1as.db.ext.dirs=

###############################################################
# @sjsas.das.orb.port -- ORB port number for the DAS
Expand Down
13 changes: 0 additions & 13 deletions install/jakartaee/bin/xml/impl/glassfish/javaee_vi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,6 @@

<ant antfile="s1as.xml" dir="${common.bin.dir}/xml/impl/glassfish" target="filter.password.file"/>

<!--
Now called from here instead of from s1as.xml's add.jdbc.resources
target. Since the get command is broken (issue tracker bug id 7151)
we need to use our regular expression hack to set the extension
directories while the server is down. If we modify the domain.xml disk
file while the server is up, the server process can overwrite our
changes to the domain.xml file. See set.ext.dirs target in s1as.xml
to see the hack. This code can be reverted once they fix bug ID 7151.
We can go back to using the get command.
-->
<ant antfile="s1as.xml" dir="${common.bin.dir}/xml/impl/glassfish" target="reset.ext.dirs"/>
<ant antfile="s1as.xml" dir="${common.bin.dir}/xml/impl/glassfish" target="add.ext.dirs"/>

<antcall target="config.das"/>
<antcall target="config.remoteInstance"/>

Expand Down
1 change: 0 additions & 1 deletion install/jakartaee/bin/xml/impl/glassfish/sjsas_ee.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<property name="server.config.dir" value="config"/>
<property name="server.home" value="${javaee.home}"/>
<property name="drive" value="${s1as.applicationRoot}"/>
<property name="default.ext.dirs" value="$$\{com.sun.aas.javaRoot\}/jre/lib/ext$$\{path.separator\}$$\{com.sun.aas.instanceRoot\}/config/$$\{com.sun.aas.configName\}/lib/ext$$\{path.separator\}$$\{com.sun.aas.instanceRoot\}/lib/ext$$\{path.separator\}$$\{com.sun.aas.installRoot\}/lib/jdbcdrivers$$\{path.separator\}$$\{com.sun.aas.installRoot\}/javadb/lib/"/>

<!--
Used to signify that we update the system properties in the domain.xml
Expand Down
5 changes: 0 additions & 5 deletions install/jaspic/bin/ts.jte
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,6 @@ ts.display=:0.0
# @s1as.java.endorsed.dirs -- endorsed directory used by SJSAS
# @s1as.applicationRoot-- Location of application repository
# Only needed when running on windows
# @s1as.db.ext.dirs -- The extension directory for DB Type 2
# drivers. Currently, this only needs
# to be set when using DB2 else it
# should be empty.
###############################################################
s1as.admin.user=admin
s1as.admin.passwd=
Expand All @@ -187,7 +183,6 @@ s1as.imq.share.lib=${jaspic.home}/imq/lib
s1as.jvm.options=-XX\\\:MaxPermSize=128m:-Dj2eelogin.name=${user}:-Dj2eelogin.password=${password}
s1as.java.endorsed.dirs=${endorsed.dirs}
s1as.applicationRoot=c:
s1as.db.ext.dirs=

sjsas.master.password=changeit
sjsas.instance.config.dir=config
Expand Down
6 changes: 1 addition & 5 deletions install/jaxws/bin/ts.jte
Original file line number Diff line number Diff line change
Expand Up @@ -523,11 +523,7 @@ javaee.home=${webcontainer.home}
# with connector tests.
# @s1as.applicationRoot-- Location of application repository
# Only needed when running on windows
# @s1as.db.ext.dirs -- The extension directory for DB Type 2
# drivers. Currently, this only needs
# to be set when using DB2 else it
# should be empty.
###############################################################
###############################################################
s1as.admin=${javaee.home}/bin/asadmin
s1as.domain.dir=${javaee.home}/domains
s1as.domain.name=${glassfish.domain.name}
Expand Down
6 changes: 1 addition & 5 deletions install/websocket/bin/ts.jte
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,7 @@ javaee.home=${web.home}
# @s1as.java.endorsed.dirs -- endorsed directory used by SJSAS
# @s1as.applicationRoot-- Location of application repository
# Only needed when running on windows
# @s1as.db.ext.dirs -- The extension directory for DB Type 2
# drivers. Currently, this only needs
# to be set when using DB2 else it
# should be empty.
###############################################################
###############################################################
s1as.admin=${javaee.home}/bin/asadmin
s1as.domain.dir=${javaee.home}/domains
s1as.domain.name=domain1
Expand Down
Loading

0 comments on commit 2185cc9

Please sign in to comment.