Karaf: 4.4.3
Java Virtual Machine:  OpenJDK 64-Bit Server VM version 11.0.2+9

I am seeing the following error when using ShellTable.print() to shell's 
session console.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by 
org.apache.karaf.shell.support.table.ShellTable 
(jar:bundle://e299aef6-746a-44e6-b810-da872d8d9244_44.0:0/!/) to field 
java.io.PrintStream.charOut
WARNING: Please consider reporting this to the maintainers of 
org.apache.karaf.shell.support.table.ShellTable
WARNING: Use --illegal-access=warn to enable warnings of further illegal 
reflective access operations
WARNING: All illegal access operations will be denied in a future release

The default for --illegal-access changes to deny in Java 16 and the 
functionality is remove in Java 17.
 
https://docs.oracle.com/en/java/javase/16/docs/specs/man/java.html#extra-options-for-java

The offending code appears in getEncoding() for 
shell/core/src/main/java/org/apache/karaf/shell/support/table/ShellTable.java
Since the Should I create an issue in GitHub?

### Example Code
import org.apache.karaf.shell.api.console.Session;
import org.apache.karaf.shell.support.table.ShellTable;
@Service
@Command(scope = "bugdata", name = "appt-display", description = "Display an 
appoiment schedule")
public class MyCommand implements Action {
 @Reference
 private Session session;

 @Override
 public Object execute() throws Exception {
   final var output = session.getConsole();
   final var table = new ShellTable();
...
   table.print(output);
 }
}


Paul Spencer

Reply via email to