grzegorzu78
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
(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