Dear Community,
have a Question about missing depencies, see the little Example.
Want to add a new Grid in a Table in a Word XDoc with jPOI, based on Erels
https://www.b4x.com/android/forum/threads/jpoi-to-the-rescue.104082/#content.
I copied all the .jars correctly. (All other things are working, except the CT-Table XML things.)
Tried also to reference and add the poi-ooxml-schemas-4.1.1.jar and XMLBeans.jar "manually", but the same error.
Any ideas?
Greets
Patent
have a Question about missing depencies, see the little Example.
Want to add a new Grid in a Table in a Word XDoc with jPOI, based on Erels
https://www.b4x.com/android/forum/threads/jpoi-to-the-rescue.104082/#content.
I copied all the .jars correctly. (All other things are working, except the CT-Table XML things.)
Tried also to reference and add the poi-ooxml-schemas-4.1.1.jar and XMLBeans.jar "manually", but the same error.
Any ideas?
Greets
Patent
B4X:
Sub Process_Globals
Private fx As JFX
End Sub
Sub AppStart (Form1 As Form, Args() As String)
test
End Sub
Sub test
Dim docX As JavaObject = CreateNewDocx
docX.RunMethod("createTable",Array(2,2))
Dim bodies As List = docX.RunMethod("getBodyElements", Null)
If bodies.IsInitialized Then
For Each bodyelement As JavaObject In bodies
Dim elementType As String=bodyelement.RunMethod("getElementType",Null)
Select elementType
Case "PARAGRAPH"
Dim runs As List = bodyelement.RunMethod("getRuns", Null)
If runs.IsInitialized Then
For Each run As JavaObject In runs
Dim zeilenText As String = run.RunMethod("getText", Array(0))
If zeilenText <> Null And zeilenText<>"null" And zeilenText<>" " Then
Log("Paragraph: "&zeilenText)
End If
Next
End If
Case "TABLE"
Dim te As JavaObject=bodyelement.RunMethodJO("getCTTbl",Null).RunMethod("addNewTblGrid",Null)
End Select
Next
End If
End Sub
Sub CreateNewDocx() As JavaObject
Dim document As JavaObject
document.InitializeNewInstance("org.apache.poi.xwpf.usermodel.XWPFDocument", Null)
Return document
End Sub
Waiting for debugger to connect...
Program started.
Cannot get methods of class: org.openxmlformats.schemas.wordprocessingml.x2006.main.impl.CTTblImpl, disabling cache.
Error occurred on line: 34 (Main)
java.lang.NullPointerException
at anywheresoftware.b4j.object.JavaObject$MethodCache.getMethod(JavaObject.java:340)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:120)
at b4j.example.main._test(main.java:153)
at b4j.example.main._appstart(main.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
at b4j.example.main.start(main.java:38)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)
Program started.
Cannot get methods of class: org.openxmlformats.schemas.wordprocessingml.x2006.main.impl.CTTblImpl, disabling cache.
Error occurred on line: 34 (Main)
java.lang.NullPointerException
at anywheresoftware.b4j.object.JavaObject$MethodCache.getMethod(JavaObject.java:340)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:120)
at b4j.example.main._test(main.java:153)
at b4j.example.main._appstart(main.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
at b4j.example.main.start(main.java:38)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)