Hi all, I'm converting a B4J project based on jServer 3 where I'm using the code provided by @rwblinn long time ago (see https://www.b4x.com/android/forum/threads/how-to-disable-jetty-debug-info-please.61448/post-387786):
With jServer 4 this code generates a ClassNotFoundException: org.eclipse.jetty$util$log$StdErrLog with the last line of code before EndSub:
Does anyone have an idea on what should be changed to make it work with jServer 4?
Thanks!
Set Jetty Logging level:
'Set Jetty Logging Level
'Parameter: Level. Possible values: ALL|DEBUG|INFO|WARN|OFF
'See: https://www.eclipse.org/jetty/documentation/current/configuring-logging.html
'Note: Be aware that logging contains important info. Default is INFO
Public Sub SetLoggingLevel (level As String)
Log("Set Logging Level to " & level.ToUpperCase)
If level.Length = 0 Then Return
Dim joJ As JavaObject 'Jetty Object
Dim joP As JavaObject 'Properties Object
joP.InitializeNewInstance("java.util.Properties", Null)
joP.RunMethod("setProperty", Array("org.eclipse.jetty.LEVEL", level.ToUpperCase))
joJ.InitializeNewInstance("org.eclipse.jetty.util.log.StdErrLog", Array("JettyLog", joP))
End Sub
With jServer 4 this code generates a ClassNotFoundException: org.eclipse.jetty$util$log$StdErrLog with the last line of code before EndSub:
B4X:
Waiting for debugger to connect...
Program started.
Set Logging Level to INFO
Error occurred on line: 430 (Util)
java.lang.ClassNotFoundException: org.eclipse.jetty$util$log$StdErrLog
at anywheresoftware.b4j.object.JavaObject.getCorrectClassName(JavaObject.java:289)
at anywheresoftware.b4j.object.JavaObject.InitializeNewInstance(JavaObject.java:84)
at b4j.server.util._setlogginglevel(util.java:58)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.server.main.main(main.java:29)
Does anyone have an idea on what should be changed to make it work with jServer 4?
Thanks!