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 6 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’s not running as a web server ? Thanks Share this post Link to post
João Antônio Duarte 6 Posted July 21, 2023 16 hours ago, Divad said: Hi. when you say as a daemon, I assume it’s 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 6 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 6 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 2345 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 6 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 6 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