B4J Question #PackagerProperty - Which 'IncludedModules' must be added?

MaaMoz

Member
Licensed User
Longtime User
Hello to all B4J users:

Having problems with 'Build Standalone Package'.

When running generated EXE file and clicking on WebView, 'Sub WebView_MouseClicked' is executed and generates
Error Code: (NullPointerException) java.lang.NullPointerException

This error is NOT generated when running the program in B4J.

Included #PachagerProperty:
#Region Form Preparation
#PackagerProperty: IncludedModules = javafx.web
#End Region

Used Libraries:
1591003257470.png


Do I need to add other 'IncludedModules' or #PackagerProperty?

Thank you very much for your input.

Reply
Report
 

MaaMoz

Member
Licensed User
Longtime User
Good afternoon Erel

I thank you very much for kindly taking time to look at my mail.

The error:

C:\windos\system32zcmd.exe:
...\Objects\temp\build\bin>java.exe @release_java_modules.txt -m b4j/b4j.example.main
(NullPointerException) java.lang.NullPointerException


Is there any other place I can find an error code?

Thank you very much again for your excellent B4X

Markus
 
Upvote 0

MaaMoz

Member
Licensed User
Longtime User
Positive, Erel, it is the only message I get.
Sorry, could only take a photo. Some program seems to block any screen shots taken.
20200603_154917.jpg
 
Upvote 0

MaaMoz

Member
Licensed User
Longtime User
To further clarify. this is the code which seem to trigger the error:

js.enginePut("doc", weConts.RunMethod("getDocument", Null))
js.evalString("var element = doc.elementFromPoint(" & EventData.X &","& EventData.y & ").id;") ' get the hyperlink
Log(js.engineGet("element"))

But, it does NOT trigger any error when executing in B4J
 
Upvote 0

MaaMoz

Member
Licensed User
Longtime User
Sorry Erel,
I am learning how to work with errors.
I deleted the Try block and got the following message.
Sorry, I did not know that to get the correct error message, I had to run the program without Try block.

C:\tmp\build>cd bin

C:\tmp\build\bin>java.exe @release_java_modules.txt -m b4j/b4j.example.main
main._wvcontacts_mouseclicked (java line: -1)
java.lang.NullPointerException
at b4j/jScriptEngine.jScriptEngine.enginePut(Unknown Source)
at b4j/b4j.example.main._wvcontacts_mouseclicked(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at b4j/anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
at b4j/anywheresoftware.b4a.BA.raiseEvent(Unknown Source)
at b4j/anywheresoftware.b4j.objects.NodeWrapper$1.handle(Unknown Source)
at b4j/anywheresoftware.b4j.objects.NodeWrapper$1.handle(Unknown Source)
at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
at javafx.base/javafx.event.Event.fireEvent(Unknown Source)
at javafx.graphics/javafx.scene.Scene$ClickGenerator.postProcess(Unknown Source)
at javafx.graphics/javafx.scene.Scene$ClickGenerator.access$8200(Unknown Source)
at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Unknown Source)
at javafx.graphics/javafx.scene.Scene$MouseHandler.access$1200(Unknown Source)
at javafx.graphics/javafx.scene.Scene.processMouseEvent(Unknown Source)
at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
at javafx.graphics/com.sun.glass.ui.View.notifyMouse(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)


C:\tmp\build\bin>pause
Press any key to continue . . .
 
Upvote 0

MaaMoz

Member
Licensed User
Longtime User
Sorry Erel to still come back to you.
Could you recomment another library or code to run javascript on a WebView?

Thank you very much for the time you have dedicated to my questions.
I whish you an excellent afternoon.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The less you use WebView the better.

 
Upvote 0

MaaMoz

Member
Licensed User
Longtime User
Thank you very much Erel.
Will see how I can get around using WebView... kind of difficult as the world "is" the Web right now..
 
Upvote 0
Top