https://kotlinlang.org logo
#ktor
Title
# ktor
a

Ameho Chan

12/27/2018, 12:12 PM
Could ktor be deployed on jboss by packing it into a war file. I add a web.xml by following the document. It works on my local machine but failed on the remote test environment.
1
c

cy

12/27/2018, 12:25 PM
Do you deploy it into root context path? How exactly it is not working?
a

Ameho Chan

12/27/2018, 12:35 PM
Yeah, I deployed the war into root context path. I use guice to init and load the ktor application. The deployment on jboss don't do anything after the jboss started until I request the index page from browser.
The log
Successfully started the ctuom admin.
didn't print after the jboss starting. When I request the index url on browser. A bunch of bootstrap log printed and finally the
Successfully started the ctuom admin.
showed.
c

cy

12/27/2018, 12:48 PM
So, do you get 404 or something?
or a blank page?
a

Ameho Chan

12/27/2018, 12:52 PM
Nope. The main problem is that the ktor application in war don't fully start on jboss unless request any url of the ktor application.
c

cy

12/27/2018, 12:58 PM
Why do you think that it's not correct? It is done as designed and is controlled by by load-on-startup web.xml parameter
In the
<servlet>
section with
ServletApplicationEngine
you can specify
<load-on-startup>1</load-on-startup>
👍 1
Otherwise it is lazily initialized by a servlet container
a

Ameho Chan

12/27/2018, 1:01 PM
Tks, this fixed my problems. 😁
👍🏻 1
c

cy

12/27/2018, 1:03 PM
I believe you are the first one who tried to deploy it into JBoss container. Please let us know is something doesn't work
😅 1
btw, is it old JBoss or Wildfly?
a

Ameho Chan

12/27/2018, 1:05 PM
Wildfly 8
c

cy

12/27/2018, 1:06 PM
our integrations tests are running inside of Tomcat, Perhaps we can configure it for wildfly one day
a

Ameho Chan

12/27/2018, 1:09 PM
I hope so. Besides servlet 3.0 don't require the
web.xml
. Could we have a
ServletInitializer
like spring boot.
c

cy

12/27/2018, 1:11 PM
a

Ameho Chan

12/27/2018, 1:15 PM
That's cool. Thanks for your help.
6 Views