Robocode reading robot database failed when -DNOSECURITY=true

Tao Ma <[email protected]> Sun, 27 Nov 2022 17:03:05 -0800 (PST)
Newsgroups gmane.comp.java.robocode
Message-ID <[email protected]>
------=_Part_7358_588715693.1669597385135
Content-Type: multipart/alternative; 
	boundary="----=_Part_7359_1838602552.1669597385135"

------=_Part_7359_1838602552.1669597385135
Content-Type: text/plain; charset="UTF-8"

Hey guys, I have used robocode for one of my course projects and I am 
running into an issue.

*TL;DR: Not able to load any robot from the robot database (robots/) when 
-DNOSECURITY is set to true.*

OS: macOS Monterey Version 12.3.1
Robocode Version: 1.9.4.7 (05-Aug-2022)
JDK:
openjdk version "1.8.0_352"
OpenJDK Runtime Environment (Zulu 8.66.0.15-CA-macos-aarch64) (build 
1.8.0_352-b08)
OpenJDK 64-Bit Server VM (Zulu 8.66.0.15-CA-macos-aarch64) (build 
25.352-b08, mixed mode)

Description:
I was trying to disable the security manager since I have third-party 
dependencies (slf4j, nd4j) for my robot and need additional access. 
However, when I try pass in the additional argument -DNOSECURITY = true to 
the start up argument provided in robocode.command like following

java -Xdock:icon=robocode.ico -Xdock:name=Robocode -Xmx512M -cp "libs/*" 
-DNOSECURITY=true -XX:+IgnoreUnrecognizedVMOptions 
"--add-opens=java.base/sun.net.www.protocol.jar=ALL-UNNAMED" 
"--add-opens=java.base/java.lang.reflect=ALL-UNNAMED" 
"--add-opens=java.desktop/javax.swing.text=ALL-UNNAMED" 
"--add-opens=java.desktop/sun.awt=ALL-UNNAMED" robocode.Robocode $*

, robocode failed to read any robot files. Those files was successfully 
read if there is no -DNOSECURITY or -DNOSECURITY=false. The error log shows 
java.lang.ClassNotFoundException for each robots like this: Got an error 
with sampleteam.MyFirstLeader: java.lang.ClassNotFoundException: 
sampleteam.MyFirstLeader.



-- 
You received this message because you are subscribed to the Google Groups "Robocode" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/robocode/b01341cc-fcd5-4aff-b4e3-f5c22254ed48n%40googlegroups.com.

------=_Part_7359_1838602552.1669597385135
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div><span style=3D"font-family: Arial;">Hey guys, I have used robocode for=
 one of my course projects and I am running into an issue.</span></div><div=
><span style=3D"font-family: Arial;"><br></span></div><div><span style=3D"f=
ont-family: Arial;"><b>TL;DR: Not able to load any robot from the robot dat=
abase (robots/) when -DNOSECURITY is set to true.</b></span></div><div><spa=
n style=3D"font-family: Arial;"><br></span></div><div><span style=3D"font-f=
amily: Arial;">OS: macOS Monterey Version 12.3.1<br></span></div><div><span=
 style=3D"font-family: Arial;">Robocode Version: <span>1.9.4.7 (05-Aug-2022=
)</span></span></div><div><span style=3D"font-family: Arial;">JDK:</span></=
div><div><span style=3D"font-family: Arial;">openjdk version "1.8.0_352"<br=
>OpenJDK Runtime Environment (Zulu 8.66.0.15-CA-macos-aarch64) (build 1.8.0=
_352-b08)<br>OpenJDK 64-Bit Server VM (Zulu 8.66.0.15-CA-macos-aarch64) (bu=
ild 25.352-b08, mixed mode)</span></div><div><span style=3D"font-family: Ar=
ial;"><br></span></div><div><span style=3D"font-family: Arial;">Description=
:</span></div><div><span style=3D"font-family: Arial;">I was trying to disa=
ble the security manager since I have third-party dependencies (slf4j, nd4j=
) for my robot and need additional access. However, when I try pass in the =
additional argument -DNOSECURITY =3D true to the start up argument provided=
 in robocode.command like following</span></div><div><span style=3D"font-fa=
mily: Arial;"><br></span></div><div><span style=3D"font-family: Arial;">jav=
a -Xdock:icon=3Drobocode.ico -Xdock:name=3DRobocode -Xmx512M -cp "libs/*" -=
DNOSECURITY=3Dtrue -XX:+IgnoreUnrecognizedVMOptions "--add-opens=3Djava.bas=
e/sun.net.www.protocol.jar=3DALL-UNNAMED" "--add-opens=3Djava.base/java.lan=
g.reflect=3DALL-UNNAMED" "--add-opens=3Djava.desktop/javax.swing.text=3DALL=
-UNNAMED" "--add-opens=3Djava.desktop/sun.awt=3DALL-UNNAMED" robocode.Roboc=
ode $*<br></span></div><div><span style=3D"font-family: Arial;"><br></span>=
</div><div><span style=3D"font-family: Arial;">, robocode failed to read an=
y robot files. Those files was successfully read if there is no -DNOSECURIT=
Y or -DNOSECURITY=3Dfalse. The error log shows java.lang.ClassNotFoundExcep=
tion for each robots like this: Got an error with sampleteam.MyFirstLeader:=
 java.lang.ClassNotFoundException: sampleteam.MyFirstLeader.</span></div><d=
iv><span style=3D"font-family: Arial;"><br></span></div><div><span style=3D=
"font-family: Arial;"><br></span></div><div><span style=3D"font-family: Ari=
al;"><br></span></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;Robocode&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">robocode+u=
[email protected]</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msgid/robocode/b01341cc-fcd5-4aff-b4e3-f5c22254ed48n%40googlegroups.co=
m?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid=
/robocode/b01341cc-fcd5-4aff-b4e3-f5c22254ed48n%40googlegroups.com</a>.<br =
/>

------=_Part_7359_1838602552.1669597385135--

------=_Part_7358_588715693.1669597385135--