B4J Question How can I use broker.As(JavaObject).GetFieldJO("config") with MQTTBrokerExtended

fengce

Member
Dim Broker As MQTTBroker
broker.As(JavaObject).GetFieldJO("config")
It's OK in MQTTBroker.

Dim Broker As MQTTBrokerExtended
broker.As(JavaObject).GetFieldJO("config") -->Error
report error in MQTTBrokerExtended.

Can anybody help me,thanks!
 

Daestrum

Expert
Licensed User
Longtime User
Posting the error message would certainly make it easier to help you with the problem. Is it a run-time error or IDE error?
 
Upvote 0

fengce

Member
Posting the error message would certainly make it easier to help you with the problem. Is it a run-time error or IDE error?
Thanks for your suggestion.
here is the error log:


Waiting for debugger to connect...
Program started.
Error occurred on line: 20 (Main)
java.lang.RuntimeException: Field: config not found in: flm.b4j.mqttbroker.MQTTBrokerExtended
at anywheresoftware.b4j.object.JavaObject$FieldCache.getField(JavaObject.java:307)
at anywheresoftware.b4j.object.JavaObject.GetField(JavaObject.java:182)
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:564)
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:564)
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.example.main.main(main.java:29)

I post the code.please have a look. Thanks for your help.
 

Attachments

  • Screenshot 2023-10-21 223547.png
    Screenshot 2023-10-21 223547.png
    108.3 KB · Views: 49
  • MQTTBrokerExtended.zip
    1.2 KB · Views: 50
Upvote 0
Top