Divad 0 Posted July 20, 2023 hi all has anyone used the spring4d on Linux in a webserver? it works really well in windows, but the moment I even include the container unit in an app for linux, it fails to start. I get a segmentation fault (in Apache). thanks Share this post Link to post
Jo茫o Ant么nio Duarte 7 Posted July 20, 2023 I use Spring4D container (develop branch) + DelphiMVCFramework on linux as daemon. Works great, no problem. 1 Share this post Link to post
Divad 0 Posted July 20, 2023 Hi. when you say as a daemon, I assume it鈥檚 not running as a web server ? 聽 Thanks聽 Share this post Link to post
Jo茫o Ant么nio Duarte 7 Posted July 21, 2023 16 hours ago, Divad said: Hi. when you say as a daemon, I assume it鈥檚 not running as a web server ? 聽 Thanks聽 Yes, it's a RESTful web server. Share this post Link to post
Divad 0 Posted July 21, 2023 Which version of Linux/ apache are you using? Would you be willing to share an example of code that runs?聽 I tried again today and on a web service that runs perfectly, I added the spring. Container to the uses clause and it fails. Not other change made聽 聽 im at a loss 馃槥 聽 thanks聽 Share this post Link to post
Jo茫o Ant么nio Duarte 7 Posted July 21, 2023 6 hours ago, Divad said: Which version of Linux/ apache are you using? Would you be willing to share an example of code that runs?聽 I tried again today and on a web service that runs perfectly, I added the spring. Container to the uses clause and it fails. Not other change made聽 聽 im at a loss 馃槥 聽 thanks聽 See this example project:聽https://github.com/joaoduarte19/DMVC-with-Spring4D-DI 聽 I use Ubuntu 20.04 and 22.04 to deploy in production. For testing and debugging I use Windows WSL. Share this post Link to post
Aztec 0 Posted July 21, 2023 (edited) Hi.聽 Thanks for that. I have tried to聽compile it, but it seems to have many errors.. so perhaps there is a different version of spring? I have installed MVC, but still cannot compile. Where is this sample from?聽 thanks Edited July 21, 2023 by Aztec Share this post Link to post
Jo茫o Ant么nio Duarte 7 Posted July 25, 2023 On 7/21/2023 at 6:13 PM, Aztec said: Hi.聽 Thanks for that. I have tried to聽compile it, but it seems to have many errors.. so perhaps there is a different version of spring? I have installed MVC, but still cannot compile. Where is this sample from?聽 thanks You have to use the Spring聽development branch Share this post Link to post
Aztec 0 Posted July 26, 2023 Hi. Ok, so I downloaded the development branch, and installed it into delphi. (Removed everything from before) I then added spring.container to the uses clause of my unit, built and deployed.聽 Tried to start apache and get a segmentation fault. Removed the unit聽from the uses clause, recompiled, and everything works. 聽 FYI:聽Linux is Ubuntu 22.04, running virtualmin. Delphi 11.3聽 聽 I have no idea what else to try! 聽 thanks Share this post Link to post
David Heffernan 2446 Posted July 26, 2023 Is this a minimal do nothing program? Or is your actual application logic there?聽 Share this post Link to post
Aztec 0 Posted July 26, 2023 Hi 聽 I have tried with both.. my own application that has code (TMS coomponents) and a simple app that simply does nothing. Same result Share this post Link to post
Jo茫o Ant么nio Duarte 7 Posted July 26, 2023 9 hours ago, Aztec said: Hi. Ok, so I downloaded the development branch, and installed it into delphi. (Removed everything from before) I then added spring.container to the uses clause of my unit, built and deployed.聽 Tried to start apache and get a segmentation fault. Removed the unit聽from the uses clause, recompiled, and everything works. 聽 FYI:聽Linux is Ubuntu 22.04, running virtualmin. Delphi 11.3聽 聽 I have no idea what else to try! 聽 thanks Perhaps the problem occurs because you are deploying your application as an Apache module. In my case I don't use apache, I deploy it as a self-contained application running as a Linux service. The way an Apache module is started is different from a self-contained application. It may be that this is causing a failure in the Spring container. Share this post Link to post
Aztec 0 Posted July 26, 2023 Yes it seems to be the case. I created a simple self contained app, and it runs.. Thats a pain! 聽 I assume聽you running your app as a web service?聽 if so what are you using as an alternative to Apache? We will have many thousands of users, so need something robust. 聽 thanks! 聽 聽 Share this post Link to post
Jo茫o Ant么nio Duarte 7 Posted July 26, 2023 25 minutes ago, Aztec said: I assume聽you running your app as a web service?聽 if so what are you using as an alternative to Apache? We will have many thousands of users, so need something robust. I run my web services as self-contained services, so I use Indy as the HTTP server. However, all my webservices are behind a reverse proxy (Nginx), so I can set up load balancing for endpoints with a large flow of requests. Share this post Link to post
Aztec 0 Posted July 26, 2023 Ok great, thanks! I will try that and see how it goes! Share this post Link to post