Forum Stats

  • 3,767,980 Users
  • 2,252,736 Discussions
  • 7,874,399 Comments

Discussions

SQLcL throws error when started as co process in KSH with set heading off directive

User_206XM
User_206XM Member Posts: 2 Green Ribbon

While running the sqlcl as co process from a KSH shell script, noticed that sqlcl is thowing exception in making connection when below condition are there

  1. process started as co process
  2. VM : Oracle Linux Server 7.7
  3. JAVA : OpenJDK 64-Bit Server VM (Zulu 8.44.0.11-linux64)-Microsoft-Azure-restricted (build 25.242-b20, mixed mode)
  4. Setting "set heading off " in sqlcl connection

Error

Exception in thread "main" java.lang.Error: Probable fatal error:No fonts found.

at sun.font.SunFontManager.getDefaultPhysicalFont(SunFontManager.java:1236)

at sun.font.SunFontManager.initialiseDeferredFont(SunFontManager.java:1100)

at sun.font.SunFontManager.findOtherDeferredFont(SunFontManager.java:1037)

at sun.font.SunFontManager.findDeferredFont(SunFontManager.java:1054)


If heading is turned on, not seeing any error and connection getting established.

Also on centOS the connection is getting established.

has any one observed similar behavior?

Coprocess sample

echo "create sqlcl connection"

sql -S -L /nolog |&

SQLCL_PID=$!

ps -f --ppid $SQLCL_PID

status=$?

while [[ $status -ne 0 ]];

do

echo " sleeping for 2 second"

sleep 2

ps -f --ppid $SQLCL_PID

status=$?

done

echo "main process pid[$$] sqlcl pid[$SQLCL_PID]"

#ptree $$



echo "check file descriptor after sqlcl start"

lsof -p $$

#keep pipe open with subscriber

cat <& p &

print -p "connect <<CONNECT_STRING>>"

print -p "spool connection.monitor.log"

print -p "select '1' from dual;"

print -p "spool off;"

Answers

  • user9540031
    user9540031 Member Posts: 129 Silver Badge

    Hello,

    Just tried it, out of curiosity, and I could not reproduce the above-mentioned ("Probable fatal error:No fonts found") java error.

    Test configuration:

    • Oracle Linux Server release 7.7
    • Oracle JDK 1.8.0_311 for linux x64
    • SQLcl release 21.3.2.287.1503 (from the "latest" download link)

    The only addition to your code was:

    export JAVA_TOOL_OPTIONS="-Dorg.jline.terminal.dumb=true"
    

    before starting the co-process; this gets rid of the "unable to create a system terminal, creating a dumb terminal" warning message—you know that already.

    JAVA : OpenJDK 64-Bit Server VM (Zulu 8.44.0.11-linux64)-Microsoft-Azure-restricted (build 25.242-b20, mixed mode)

    Why wouldn't you use an Oracle-supported JDK?

    [Remark: please format code sections in posts as such, it's a lot easier to read!]

    Regards,