B4J Question -Xbootclasspath/p:alpn-boot-8.1.11.v20170118.jar

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hello

I am developing a web server which use's -Xbootclasspath/p:alpn-boot-8.1.11.v20170118.jar.

B4X:
#Region  Project Attributes
   #CommandLineArgs:  -Xbootclasspath/p:alpn-boot-8.1.11.v20170118.jar
   #MergeLibraries: True
   #VirtualMachineArgs: -Xbootclasspath/p:alpn-boot-8.1.11.v20170118.jar
#End Region


This working when running in the IDE, but when the jar file is executed (windows) I get the following error:

B4X:
AppStart
2018-01-16 10:39:49.503:INFO::main: Logging initialized @105ms to org.eclipse.jetty.util.log.StdErrLog
ConfigureSSL, SslPort = 51042
ConfigureSSL, Initialize
ConfigureSSL, SetKeyStorePath
ConfigureSSL, SetSslConfiguration
ConfigureSSL, Done
main._appstart (java line: 63)
java.lang.RuntimeException: ALPN is not configured properly (required by HTTP2)
   at anywheresoftware.b4j.object.ServerWrapper.Start(ServerWrapper.java:122)
   at ies.http2.main._appstart(main.java:63)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
   at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
   at ies.http2.main.main(main.java:29)

main.main (java line: 29)
java.lang.RuntimeException: java.lang.RuntimeException: ALPN is not configured properly (required by HTTP2)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:119)
   at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
   at ies.http2.main.main(main.java:29)
Caused by: java.lang.RuntimeException: ALPN is not configured properly (required by HTTP2)
   at anywheresoftware.b4j.object.ServerWrapper.Start(ServerWrapper.java:122)
   at ies.http2.main._appstart(main.java:63)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
   ... 2 more

I assumed that assigning the #CommandLineArgs: -Xbootclasspath/p:alpn-boot-8.1.11.v20170118.jar that the app would handle this. I have also created a shortcut with the following :
"C:\Users\John Murphy\Documents\B4J\Http2\Objects\Http2.jar" -Xbootclasspath/p:alpn-boot-8.1.11.v20170118.jar which also produces the same error.


It there a certain way procedure required to process this type of command line ?

Regards

John.
 

Jmu5667

Well-Known Member
Licensed User
Longtime User
1. Both #CommandLineArgs and #VirtualMachineArgs only affect the program when you run it from the IDE.
2. #CommandLineArgs is not relevant in this case.

You need to run it with:
B4X:
java -Xbootclasspath... -jar <your jar>
You can create a batch file for this.


Thanks for the reply Erel, that worked, however can it be run in a non console window, just like a background process. We cannot have console windows showing on the server as there is a potential that a user can close them. This is the first of about 16 different sever apps that we are developing to replace out legacy VB6 app.

Would lauch4j help or some other tool ?

Regards

John.
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
Launch4J will probably make it simpler. You can set the the bootclassoption parameter under JRE - JVM options (test it).


That worked, had to set Header GUI so it does not show a console window. BTW, how does the B4J IDE do it, I plan to have an GUI app manager for each server app to allow for config settings etc. Would it be possible using a b4J Gui app to launch the server app so it could be manage like you do in the B4J IDE, with the kill process etc.

Regards

John.
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
Works great, how can I get the server app to report back to jshell that it launched ok, at the moment I can getting the 'timeout', is them some stdout func ?
 
Upvote 0
Top