1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

B4J Question How do I restart jRDC.jar

Discussion in 'B4J Questions' started by ValhallSW, Sep 13, 2019 at 4:52 PM.

  1. ValhallSW

    ValhallSW Member Licensed User

    Hi.

    I followed the tutorial
    [B4X] jRDC2 - B4J implementation of RDC (Remote Database Connector) and it was a great success. I got it online and everything looked good. Untill I got an error message (from the B4A app) that there was an error in the SQL query in the config.properties file.

    The problem is that when I correct the config.properties file, and try to restart/recompile the b4j file, I get the message that: "java.net.BindException: Address already in use: bind".

    I read that I could Kill the process in the Log field. But it does not help. I need to kill the initial process. When I open the page in a browser it sais that the RemoteServer is running and Connection Successful. How is it possible to stop the process and restart it?

    BTW: Do I need to recompile the process everytime I need to add/change an sql query, or can I just update the config.properties file?
     
  2. OliverA

    OliverA Expert Licensed User

    As is, you need to recompile after changing the config.properties file. Since a jar is a zip file, you may also try replacing the config.properties file in the zip file. You can also modify the code of jRDC2 to copy your config.properties file to another location if it does not exist in that location. Then use that config.properties file. That can then be modified and after restarting your jRDC2 server, it will read this config.properties file.
     
    BillMeyer likes this.
  3. OliverA

    OliverA Expert Licensed User

    What operating system?
     
  4. Anser

    Anser Well-Known Member Licensed User

    Another alternative.

    Try the following changes in the RDCConnector module, so that you don't have to restart the jRDC.jar each time you make modifications in your SQL statements in the file config.properties

    Ensure that you have the file config.properties in the same folder as your jRDC.jar

    Code:
    Public Sub Initialize
        
    Dim config As Map = LoadConfigMap
        pool.Initialize(config.Get(
    "DriverClass"), config.Get("JdbcUrl"), config.Get("User"), _
            config.Get(
    "Password"))
    #if DEBUG
        DebugQueries = True
    #else
        DebugQueries = False
    #end if
        DebugQueries = 
    True 'This line added by Anser to make Debug Mode always enabled
        serverPort = config.Get("ServerPort")
        LoadSQLCommands(config)
    End Sub

    Private Sub LoadConfigMap As Map
        
    'Return File.ReadMap(File.DirAssets, "config.properties")
        Return File.ReadMap(File.DirApp, "config.properties"'Changed by Anser
    End Sub
     
    OliverA and BillMeyer like this.
  5. ValhallSW

    ValhallSW Member Licensed User

    I am running Windows 10.
    I tried to Open Task manager and closed the "Java platform...", didn't work.
    But when I shut down the "Open JDK platforn binary" process, it worked.

    I just had to get my question "out there" to see the obvious answer.
    I closed the wrong process!

    Thanks!
     
  6. OliverA

    OliverA Expert Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice