Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Dockerizing Xtext web app(docker + xtext )
Dockerizing Xtext web app [message #1841312] Tue, 11 May 2021 22:48 Go to next message
z232 I is currently offline z232 IFriend
Messages: 42
Registered: February 2016
Member
Hi,
I have created a DSL web application.
When running the application from the terminal (with the command gradle jettyRun) , everything works as expected.
When dockerizing the same application, the applications works, but the xtext-services dont . When calling the generator, I get a 500 from the xtext services.

POST http://192.168.1.4:18282/xtext-service/generate?resource=56d64298.mdl   [HTTP/1.1 500 Server Error 12ms]


Also i get this from the logs
84021 [qtp399573350-17] WARN org.eclipse.jetty.servlet.ServletHandler - /xtext-service/generate
 java.awt.HeadlessException:
 No X11 DISPLAY variable was set, but this program performed an operation which requires it.


Any idea?


Best Regards,
Michael

[Updated on: Tue, 11 May 2021 22:54]

Report message to a moderator

Re: Dockerizing Xtext web app [message #1841314 is a reply to message #1841312] Wed, 12 May 2021 04:29 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14064
Registered: July 2009
Senior Member
How does your docker file look like?
Do you package the war into a jetty base?
Do other services work?
The question is what exception happens in the generator service
what does docker logs tell?
Maybe you should also debug the awt exception


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Wed, 12 May 2021 07:31]

Report message to a moderator

Re: Dockerizing Xtext web app [message #1841339 is a reply to message #1841314] Wed, 12 May 2021 15:23 Go to previous messageGo to next message
z232 I is currently offline z232 IFriend
Messages: 42
Registered: February 2016
Member
Hi Christian,



I created a Docker compose file running both the webapp and the tomcat services.

The application communicates with a remote DB through the Tomcat webservices. The problem is only that i am having issues with the content-assist and the generator. I am still getting this 500 error when calling the xtext/services as i mentioned.

Also in the console log i get the following message while triggering the generator
 11123 [qtp399573350-16] WARN org.eclipse.jetty.servlet.ServletHandler - /xtext-service/generate
webapp_1  | java.awt.HeadlessException:
webapp_1  | No X11 DISPLAY variable was set, but this program performed an operation which requires it.
webapp_1  |     at java.applet.Applet.<init>(Applet.java:67)
webapp_1  |     at webapp.generator.JsonGenerator.<init>(JsonGenerator.java:147)
webapp_1  |     at webapp.generator.MdlGenerator.doGenerate(MdlGenerator.java:366)
webapp_1  |     at org.eclipse.xtext.generator.GeneratorDelegate.doGenerate(GeneratorDelegate.java:43)
webapp_1  |     at org.eclipse.xtext.generator.GeneratorDelegate.generate(GeneratorDelegate.java:34)
webapp_1  |     at org.eclipse.xtext.web.server.generator.GeneratorService.compute(GeneratorService.java:121)
webapp_1  |     at org.eclipse.xtext.web.server.generator.GeneratorService.compute(GeneratorService.java:46)
webapp_1  |     at org.eclipse.xtext.web.server.model.XtextWebDocument.getCachedServiceResult(XtextWebDocument.java:74)
webapp_1  |     at org.eclipse.xtext.web.server.model.XtextWebDocumentAccess$3.exec(XtextWebDocumentAccess.java:311)
webapp_1  |     at org.eclipse.xtext.web.server.model.XtextWebDocumentAccess$3.exec(XtextWebDocumentAccess.java:305)
webapp_1  |     at org.eclipse.xtext.util.concurrent.CancelableUnitOfWork.exec(CancelableUnitOfWork.java:26)
webapp_1  |     at org.eclipse.xtext.web.server.model.XtextWebDocumentAccess.doAccess(XtextWebDocumentAccess.java:210)
webapp_1  |     at org.eclipse.xtext.web.server.model.XtextWebDocumentAccess.readOnly(XtextWebDocumentAccess.java:160)
webapp_1  |     at org.eclipse.xtext.web.server.model.XtextWebDocumentAccess.getCachedServiceResult(XtextWebDocumentAccess.java:317)
webapp_1  |     at org.eclipse.xtext.web.server.model.AbstractCachedService.getResult(AbstractCachedService.java:27)
webapp_1  |     at org.eclipse.xtext.web.server.generator.GeneratorService.getArtifact(GeneratorService.java:146)
webapp_1  |     at org.eclipse.xtext.web.server.generator.GeneratorService.getArtifact(GeneratorService.java:178)
webapp_1  |     at org.eclipse.xtext.web.server.XtextServiceDispatcher.lambda$null$26(XtextServiceDispatcher.java:785)
webapp_1  |     at org.eclipse.xtext.web.servlet.XtextServlet.doService(XtextServlet.java:165)
webapp_1  |     at org.eclipse.xtext.web.servlet.XtextServlet.doPost(XtextServlet.java:132)
webapp_1  |     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
webapp_1  |     at org.eclipse.xtext.web.servlet.XtextServlet.service(XtextServlet.java:60)
webapp_1  |     at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
webapp_1  |     at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837)
webapp_1  |     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
webapp_1  |     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
webapp_1  |     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
webapp_1  |     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
webapp_1  |     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
webapp_1  |     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
webapp_1  |     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
webapp_1  |     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
webapp_1  |     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
webapp_1  |     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
webapp_1  |     at org.eclipse.jetty.server.Server.handle(Server.java:518)
webapp_1  |     at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
webapp_1  |     at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
webapp_1  |     at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
webapp_1  |     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
webapp_1  |     at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
webapp_1  |     at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
webapp_1  |     at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
webapp_1  |     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
webapp_1  |     at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
webapp_1  |     at java.lang.Thread.run(Thread.java:748)



Bests


[Updated on: Thu, 20 May 2021 14:52]

Report message to a moderator

Re: Dockerizing Xtext web app [message #1841340 is a reply to message #1841339] Wed, 12 May 2021 15:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14064
Registered: July 2009
Senior Member
Why does your generator call into applet

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Dockerizing Xtext web app [message #1841341 is a reply to message #1841340] Wed, 12 May 2021 15:31 Go to previous messageGo to next message
z232 I is currently offline z232 IFriend
Messages: 42
Registered: February 2016
Member
I don't really know? Is this a bug ?
Re: Dockerizing Xtext web app [message #1841342 is a reply to message #1841341] Wed, 12 May 2021 15:35 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14064
Registered: July 2009
Senior Member
Obviously you need to have an Xserver running
To call into applet
So you could play around
With Xvfb or Xnvc but maybe you don't need it
Thus would be interesting what you do there


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Cannot import an Existing Maven Projetct in a Run As Eclipse Aplication
Next Topic:My xtext-maven-plugin does not generate DSL code on project
Goto Forum:
  


Current Time: Thu Sep 23 00:35:52 GMT 2021

Powered by FUDForum. Page generated in 0.02226 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top