B4J Question B4J + Temurin - Error @5b87ed94

grzegorzu78

New Member
I need help with the proper operation of the application I wrote. The application written in B4J + Java 7 works fine so far. After installing the Temurin software and recompiling the program, it does not work properly. I get the following error in the logs.
(IllegalAccessException) java.lang.IllegalAccessException: class anywheresoftware.b4j.object.JavaObject cannot access class com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl (in module java.xml) because module java.xml does not export com.sun.org.apache.xerces.internal.dom to unnamed module @5b87ed94

Below is the program code

Public Sub Create(Par As Receipt_entity, Status As String) As String

DateTime.DateFormat = "yyyy-MM-dd"
DateTime.TimeFormat = "HHmmss"
Dim dd As String = DateTime.Date(DateTime.now)
Dim tt As String = DateTime.Time(DateTime.now)

Try
xml = xml.create("SOAP:Envelope")
xml = xml.attribute("xmlns:SOAP","http://schemas.xmlsoap.org/soap/envelope/")
xml = xml.attribute("xmlns:ser","urn:fiscal.printer.tpe/services")

xml = xml.element("SOAP:Header").up
xml = xml.element("SOAP:Body")
xml = xml.element("ser:MsgFiscalPrinterStatus")
xml = xml.element("MsgHeader")
xml = xml.element("sourceSystem").text("FPS").up
xml = xml.element("targetSystem").text("SAP").up
'xml = xml.element("submitUser").text("xxx").up
'xml = xml.element("submitUserEmail").text("xxx").up
'xml = xml.element("messageId").text("99999").up
'xml = xml.element("timeStamp").text("20170529-112427-000").up
xml = xml.up() 'zamyka MsgHeader

xml = xml.element("InvoiceNumber").text(Par.InvoiceNumber).up
xml = xml.element("IDOCNumber").text(Par.IDOCNumber).up
xml = xml.element("Date").text(dd).up
xml = xml.element("Time").text(tt).up
xml = xml.element("Status").text(Status).up
xml = xml.up() 'zamyka ser:MsgFiscalPrinterStatus


xml = xml.up() 'zamyka soap:envelop
xml = xml.up() 'zamyka oapenv:Body

Dim props As Map
props.Initialize
props.Put("{http://xml.apache.org/xslt}indent-amount", "4")
props.Put("indent", "yes")

'ustawia atrybut standalone
SetStandalone(xml, True)
props.Put("standalone", "yes")

Return (xml.asString2(props))
Catch
Log(LastException)
Return ""
End Try
End Sub


I am using the xmlbuilder library
 

teddybear

Well-Known Member
Licensed User
Please use </> tag to quote your code.it looks like this:
B4X:
Public Sub Create(Par As Receipt_entity, Status As String) As String
DateTime.DateFormat = "yyyy-MM-dd"
...
Which version of B4J IDE are you using? what is Temurin version?
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
you probably need to include an --add-opens to open com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl to ALL-UNAMED
 
Upvote 0

grzegorzu78

New Member
My program is called TEST.JAR. Could you write where to add the entry, whether in the B4J application during compilation or something else. What exactly should this command look like in my case?
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
in the main b4j

B4X:
#VirtualMachineArgs: --add-opens java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED
 
Upvote 0
Top