Years ago, I made RDC work in B4A with an insecure Windows server. Today, more confident UBUNTU server is resisting connection.
I do not know why I get this in DEBUG? Where is "0.0.0.0" coming from?
I think something is wrong with config.properties ...
End of Main.AppStart ...
I do not know why I get this in DEBUG? Where is "0.0.0.0" coming from?
B4X:
2023-01-25 08:42:03.104:INFO :oejss.DefaultSessionIdManager:main: Session workerName=node0
2023-01-25 08:42:03.108:INFO :oejs.AbstractConnector:main: Started ServerConnector@1ba9117e{HTTP/1.1, (http/1.1)}{0.0.0.0:51068}
2023-01-25 08:42:03.283:INFO :oejus.SslContextFactory:main: x509=X509@1c6804cd(jetty,h=[mir kwir],a=[],w=[]) for Server@4b6e2263[provider=null,keyStore=file:///D:/B4X/B4J/X-WEB%20SRV%20III/Objects/keystore.jks,trustStore=null]
2023-01-25 08:42:03.283:INFO :oejus.SslContextFactory:main: x509=X509@655f7ea(www.pearlnecklacemedia.com,h=[mir kwir],a=[],w=[]) for Server@4b6e2263[provider=null,keyStore=file:///D:/B4X/B4J/X-WEB%20SRV%20III/Objects/keystore.jks,trustStore=null]
2023-01-25 08:42:03.474:INFO :oejs.AbstractConnector:main: Started ServerConnector@36916eb0{SSL, (ssl, alpn, h2, http/1.1)}{0.0.0.0:51069}
2023-01-25 08:42:03.482:INFO :oejs.Server:main: Started Server@4f32a3ad{STARTING}[11.0.9,sto=0] @11048ms
Viewer running on os: windows 10
Trying to open: http://localhost:51068/Pearl?1674664912991
MAIN - *** BEGIN jRDC STUFF ***
2023-01-25 08:42:26.438:INFO :cmvl.MLog:MLog-Init-Reporter: MLog clients using slf4j logging.
2023-01-25 08:42:26.516:INFO :cmvc.C3P0Registry:main: Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
MAIN - rdcServer and rdcConnector1 initialized
MAIN - Using ConfigureSSL Port = 17178
MAIN - ConfigureSSL: sPort = 17178
2023-01-25 08:43:02.314:INFO :oejs.Server:main: jetty-11.0.9; built: 2022-03-30T17:44:47.085Z; git: 243a48a658a183130a8c8de353178d154ca04f04; jvm 11.0.1+13
Error occurred on line: 178 (Main)
java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:17178
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:344)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:304)
at org.eclipse.jetty.server.Server.lambda$doStart$0(Server.java:401)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at org.eclipse.jetty.server.Server.doStart(Server.java:397)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at anywheresoftware.b4j.object.ServerWrapper.Start(ServerWrapper.java:266)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:673)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:240)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at com.pearlnecklace.media.main.main(main.java:29)
Caused by: java.net.BindException: Address already in use: bind
at java.base/sun.nio.ch.Net.bind0(Native Method)
at java.base/sun.nio.ch.Net.bind(Net.java:461)
at java.base/sun.nio.ch.Net.bind(Net.java:453)
at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:339)
... 30 more
Program terminated (StartMessageLoop was not called).
I think something is wrong with config.properties ...
B4X:
#DATABASE CONFIGURATION
DriverClass=com.mysql.jdbc.Driver
#JdbcUrl=jdbc:mysql://localhost/pearl?characterEncoding=utf8
#JdbcUrl=jdbc:mysql://www.pearlnecklacemedia.com/pearl?characterEncoding=utf8
JdbcUrl=jdbc:mysql://192.168.1.130/pearl?characterEncoding=utf8
User=MrKittyNipplekins
Password=Rumplestiltskin
#Java server port
ServerPort=17178
End of Main.AppStart ...
B4X:
' jRDC STUFF ---------------------------------------------------------------------------------------------
LogSub("*** BEGIN jRDC STUFF ***")
rdcServer.Initialize("")
rdcConnector1.Initialize
LogSub("rdcServer and rdcConnector1 initialized")
'srvr.AddHandler("/test", "TestHandler", False)
rdcServer.AddHandler("/pnmrdc", "PearlHandler", False)
rdcServer.AddHandler("/rdc", "RDCHandler", False)
' call ConfigureSSL before the server is started
rdcServer.Port = rdcConnector1.serverPort ' ultimately from non-ssl port in config.properties
LogSub("Using ConfigureSSL Port = " & rdcServer.Port)
ConfigureSSL(rdcServer.Port)
'' no! ConfigureSSL(opnJRDC)
rdcServer.Start
LogSub("*** rdcServer Started ***")
RDC.Initialize("nothing parm") ' jRDC module
LogSub("jRDC Initialized")
LogSub($"jRDC is running (version = $1.2{VERSION})"$)
StartMessageLoop