B4J Question Information about Application Startup Error, B4J 8.90, jdk1.8.0_171

johnerikson

Active Member
Licensed User
Longtime User
Application startup error after compilation in debug mode, that occurs from time to time (See below)
To move forward when it occur, just compile again, somtimes up to 3 times.
I do not know if it is a bug or something else!!

(Log)
Waiting for debugger to connect...
java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: java.net.SocketException: Connection reset
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:120)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at GISIQON.EasyMedia.main.<clinit>(main.java:17)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
at java.io.DataInputStream.readByte(DataInputStream.java:265)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:229)
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)
... 2 more
Exception in thread "main"
 

johnerikson

Active Member
Licensed User
Longtime User
B4X:
'Non-UI application (console / server application)
#Region  Project Attributes
    #CommandLineArgs:
    #MergeLibraries: True
    #AdditionalJar: sqlite-jdbc-3.7.2
    #AdditionalJar: metadata-extractor-2.6.2
#End Region

Sub Process_Globals
    Public srvr As Server  
    Dim ABM As ABMaterial
    Public folder_file As String = "\send_files\"
    Public dbImage As SQL
    Public SQLite As SQL
    'Public PG_sStoragePath As String = "D:\Program\B4J\Server\StorageService"
    Public PG_sStoragePath As String = "C:\D\Program\B4J\Server\StorageService"

    Public PG_sCStore As String = "c:/Users/Namn/AppData/EasyMedia"
    Public PG_sCfile As String = "file:///c:/Users/Namn/AppData/EasyMedia"
    Public PG_sAppPath As String = File.DirApp & "\www\easymedia"
    Public PG_bSQLRFirsttime As Boolean = True
    Public filesFolder As String = "D:\Program\B4J\exempel\Fileserver\Uploaded"
    Private domain As String = "DATOR"
    Private token As String = "code-code"
    Private updateIp As Timer
   
    Type GoObj (id As String, lat As Double, lng As Double, iZoom As Int)
  
End Sub


Sub AppStart (Args() As String)

    dbImage.InitializeSQLite(PG_sStoragePath & "\Databases", "dbsImage.db", True) 'OBS ändrat
    dbImage.ExecNonQuery("PRAGMA journal_mode = wal")
    dbImage.ExecNonQuery("PRAGMA integrity_check")
    DateTime.DateFormat ="yyyy-MM-dd"
    DateTime.TimeFormat = "hh:mm:ss"
    ABMShared.Globals.Initialize
    ' Build the Theme
    ABMShared.BuildTheme("mytheme")
    ' the user needs to login
    ABMShared.NeedsAuthorization = True
   
     ABMShared.TrackingID = "UA-1"
   
    ' create the app
    Dim myApp As ABMApplication
    myApp.Initialize
   

    Dim PageDatachoiser As EasyDatachoiser
    PageDatachoiser.Initialize  

    Dim PageEasyTreeview As EasyTreeview
    PageEasyTreeview.Initialize
       
    Dim PageEasyImages As EasyImages
    PageEasyImages.Initialize  

    Dim PageEasyEditimages As EasyEditimages
    PageEasyEditimages.Initialize  

   
    Dim PageEasyImageslider As EasyImageslider
    PageEasyImageslider.Initialize  


    Dim PageEasyGooglemap As EasyGooglemap
    PageEasyGooglemap.Initialize  

    Dim EasyStartPage As EasyStart
    EasyStartPage.Initialize
   
    Dim pageEasyRedig As EasyRedig
    pageEasyRedig.Initialize
   
    Dim PageEasyFileDialog  As EasyFileDialog
    PageEasyFileDialog.Initialize

    Dim PageEasyVideos As EasyVideos
    PageEasyVideos.Initialize
   
    Dim PageEasyPres As EasyPres
    PageEasyPres.Initialize

    Dim PageEasyText As EasyText
    PageEasyText.Initialize
   
    myApp.AddPage(PageEasyEditimages.Page)
    myApp.AddPage(PageDatachoiser.Page)  
    myApp.AddPage(PageEasyFileDialog.page)
    myApp.AddPage(PageEasyTreeview.Page)  
    myApp.AddPage(PageEasyImages.Page)
    myApp.AddPage(PageEasyImageslider.Page)  
     myApp.AddPage(PageEasyGooglemap.Page)
    myApp.AddPage(EasyStartPage.Page)      
    myApp.AddPage(pageEasyRedig.page)  
    myApp.AddPage(PageEasyVideos.page)
    myApp.AddPage(PageEasyPres.page)  
    myApp.AddPage(PageEasyText.page)
   
    updateIp.Initialize("UpdateIp", 10 * 60 * 1000) '10 minutes
    updateIp.Enabled = True
    UpdateIp_Tick
    File.MakeDir(File.DirApp, filesFolder)
   
    ' start the server
    myApp.StartServer(srvr, "srvr", xxxxx)  
    ABMShared.RedirectOutput(File.DirApp, "logs.txt")
   
    ABM.ViewerOpen("http://localhost:xxxxx/easymedia?" & ABMShared.AppVersion)
    StartMessageLoop
End Sub

Sub UpdateIp_Tick()
    Dim j As HttpJob
    j.Initialize("j", Me)
    j.Download2("http://www.duckdns.org/update", Array As String("domains", domain, "token", token, "ip", ""))
End Sub


Sub JobDone (j As HttpJob)
    If j.Success = True Then
        Log("Update DuckDNS: " & j.GetString)
    Else
        Log("Error updating Duck DNS: " & j.ErrorMessage)
    End If
    j.Release
End Sub
 
Last edited:
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
You might want to remove some of the personal information from the above posting. tracking id etc. Don't think anyone here would use it, but the pages are public so anyone can view them.
 
Upvote 0
Top