How to package the project to war in play2? - war

In play1, we can package the project to a war, then put it in a tomcat:
play war
But how to do the same in play2? play war doesn't work, it reports war is not a valid task.

as pointed out by #Freewind, officialy, it's not supported, this is because they need the Servlet 3.1 specifications to support all the nice websocket and other advanced features that play2 provides.
However, if you do not use that, there is a plugin on github to provide play war and be able to deploy on some cloud servers, etc:
https://github.com/dlecan/play2-war-plugin/

It's not still supported, support won't be released until Play 2.1 (as per current plan)
PS: I know your comment says so, but it's better to have it as an answer for people finding this page.

WAR Plugin for Play framework 2.0 bring this feature.
This project is a module for Play framework 2 to package your apps into standard WAR packages. It can be used with Servlet 3.0 and 2.5 containers (Tomcat 6/7, Jetty 7/8/9, JBoss 5/6/7, ...)

offered by the official site, if you just want to publish your website, there may be some alternative ways to achieve the goal.
Creating a standalone version of your application
Or, you can use with lighttpd or nginx, here is the configuration doc:
Set-up a front-end HTTP server
If you plan to host several applications in the same server or load balance several instances of your application for scalability or fault tolerance, you can use a front-end HTTP server.

Related

Setup for ASP.NET web application

We have some ASP.NET web application which used in 2 ways:
enterprise solution (msi-like installer)
cloud solution (use same installer)
Currently we use home-grown installer, but consider if we can replace it with something more convenient and suitable for CI/CD development cycle.
What technologies/products can be used? Currently I think about webdeploy, but not sure how it can be applied for enterprise setup...
This is quite a broad question, but I think it deserves an answer.
1. (partially) Open source solution
One way to configure CI cycle is to use Jenkins along with MS deployment functionality. This article shows how to quickly set up a job to integrate Jenkins with msdeploy tool.
Basically it configures a job to perform the deployment using Powershell:
msdeploy.exe -allowUntrusted=true -verb:sync -source:contentpath='D:\WS\ExampleProject' -dest:contentpath=F:\webfolder,computerName=exampleproject.example.com,Username='yourdomain\username',Password='password' -skip:objectName=dirPath,absolutePath="config" -skip:objectName=filePath,absolutePath="web.config"
It also tells that the executing user should be an administrator on target server, but this can be circumvented through proper configuration of Web Deployment Handler as indicated in this article.
One intermediary step that can be done before Jenkins integration (which I recommend) is to configure Web deployment. This allows to quickly check that deployment can be performed onto target server IIS using Visual Studio and any configured user that is allowed to deploy. It also allows to quickly see the difference between current code base (web pages, JS files, binaries) and target server deployed package.
2. Visual Studio 2017 DevOps solution
Microsoft recently released VS 2017 which contains a great support for DevOps which handles most the issues related to CI/CD. I cannot find a reference, but I remember that this feature is available for Enterprise version only. Also, the good news is that it is not tightened to Microsoft technologies.
A presentation related to the subject can be found here.
I think WebDeploy can be used without significant problems. From my experience with it:
backup limitation: can be done only at Web Site level, not Web application level
deployment time: is quite small - actual files copy + Web site backup (if configured) + application pool recycle.
Recently I saw a vendor offering customers who wanted on-premises deployments the same Docker image that they use for cloud deployments. Seemed like a good, clean, solution.
Another option is nuget packages - host your own repository. Then deploy with a tool like Octopus Deploy. I'm not terribly familiar with it, but both solutions look to be easy after an initial hump in setup.

Deploy Spring MVC in WSO2 Application Server

I am trying to deploy my Spring MVC application on WSO2 Application Server by going to Main > Manage > Applications > Add > Web Applications and upload my Spring MVC's WAR file. The upload completed successfully, but I still can't run the web app itself. The error message just basically complaining it doesn't have org.springframework.
The same WAR file can be run on Apache Tomcat with no problem at all. All I did is dropping the same WAR file to \webapps, and it works.
Is there a special setting that needs to be configured to get Spring MVC run on WSO2 Application Server? I would assume WSO2 Application is also using Apache Tomcat, so why it won't run by just uploading the WAR file?
Thanks!
What is your WSO2 AS version ? please make sure to use latest AS 5.1.0 version. We have tested large number of Spring (including SpringMVC) based applications on AS 5.1.0, basically if something working on Tomcat it should be work on WSO2 AS too. If you still have issues on AS 5.1.0 please let me know.
I solved this issue by:
Upgrading WSO2 AS to latest version (5.1.0) as mentioned by Sagara Gunathunga. For some reasons, previous WSO2 AS doesn't take my JSTL templating (something like $ {blabla}). Only in 5.1.0 did the issue resolved. I start to wonder what this WSO2 is doing with its half-baked product.
Modify Maven POM file, specifically slf4j-api dependency. WSO2 has its own slf4j-api library and I have to set the scope of slf4j-api in my app to "provided" before deploying to WSO2. This solve the issue with unable to load all JavaScript files.
Downside for this is you will need the scope of slf4j-api to be "compiled" when you run this locally under regular Tomcat. Setting it to "provided" will not work under Tomcat. But in WSO2, the scope will need to be "provided" to run. So, there is manual work to change before deploying the application.
I did try to match the slf4j-api version to match what WSO2 and set the scope to "compile", but it still won't work. WSO2, for some bad reasons, can't use my app's compiled slf4j-api.
yes there is a separate workaround to deploy a spring service to wso2 appserver. Please follow [1] for instructions.
[1]. http://docs.wso2.org/wiki/display/AS510/Spring+Services
Thank you,
Dharshana
#stack247,
Well I'm from WSO2 and it's nice to hear that your JSTL issue is solved by now. But I completely disagree with " I start to wonder what this WSO2 is doing with its half-baked product" statement. You may know that spec like Servelt , JSP and JSTL having different versions and update it's version with time. Previous version of application server does not supported for latest JSP 2.0 and JSTL 1.2 specs hence you can't use application which depends on JSP 2.0 or JSTL 1.2 that was a known limitation but can't consider it as half-baked product due to that. This is very common nature with any software product and that's why we are actively developing, fixing issues, upgrading dependencies and frequently releasing new versions, also we are responding to community issues like this.
With Latest AS 5.1.0 release we officially support for Servelt 3.0, JSP 2.0 and JSTL 1.2 and any dependent applications too. When it come to logging case most of the application server having their own logging mechanisms and some cases it's required remove logging dependencies from applications.

Symfony 2 on shared hosting?

I'm developing my app in Symfony 2, and one of the things that i have kept in mind is that symfony 2 have a lot of requirements. I know that in my pc works. But i've never tryed to deploy my app in a shared hosting. Is not that i want all the functionalities of the framework, i only need that the app works, and also the caching works.
Do i need a special shared hosting or it can run in any hosting that have (of course) PHP and the Database Engine that i'm using?
If i do, which shared hosting may I use?
If i don't, do i need a special configuration?
Thanks in advanced.
These are the requirements for running symfony2
http://symfony.com/doc/2.0/reference/requirements.html
Have a look at it and compare with your hosting provider and see if they matches.
Most of them should match othwise give the support team a call and they will look at it.
usually most of the Hosting companies have symfony2 available as addon so i think they might have all requirements but ask you can confirm with them. like Godaddy
You also want to be cautious for shared hosting servers that use separate php versions for CLI vs Apache. If this is the case, even though you can run parts of your application via ssh, you may not be able to run most of your Symfony2 application via http.
I think you may be better off investing in a cheap VPS for Symfony2 development as it allows more flexibility and will ultimately save you more time. A lot of vps these days are almost as cheap as shared hosting anyway.
Well No doubt Symfony requires lot of pre requsites. specially when it comes to shared hosting. I practice my self managed cloud hosing services of Cloudways. This is so because they provide popular php framework as one click app installation, Moreover, i found installation process of symfony on cloud server over there blog. Just followed the simple steps and symfony 3 was installed on my server.

Web site deployment software

I work for a company that has a multi tier web site. So we have several front end sites talking to several back end web services. All this is load balanced across several servers and hosted in IIS 6.0.
When we do a new release we need to copy several sites from a staging environment onto a pre live version on the live web servers. The number and types of sites deployed in any release could vary. Currently use robocopy scripts/bat files to do this. Which works but is prone to errors and is difficult to maintain.
Does anyone have any experience of some good, preferably open source, deployment software which may aid us in this task?
I would use PowerShell and its WebAdministration module. Also have a look at Scott Hanselman's article here, where he explains the WebDeploy packaging and deployment solution (on Channel9 also).
We use a continuous integration server and Web Deploy. The only manual steps are triggering the build in the CI server.
We use TeamCity, which has a limited free version. CruiseControl.NET is an open source CI server, but the configuration isn't nearly as nice as TeamCity.
Here are a few articles on setting up TeamCity for deployment:
http://www.diaryofaninja.com/blog/2010/05/09/automated-site-deployments-with-teamcity-deployment-projects-amp-svn
http://www.troyhunt.com/2010/11/you-deploying-it-wrong-teamcity_26.html

started to learn EJB. What options do I have for an application server?

I have started learning EJB. I like to know which is best application server for beginner to learn EJB...
I would recommend an open source server as there are plenty good ones available. The open source servers often have greater community support which is helpful while learning.
Caucho Resin (also has a commercial extension)
Sun Glassfish
JBoss Application Server
I think JBoss Appliocation Server
I don't think that the particular app server matters too much, the basic criterion is that it should support JEE5 (EJB3 and JPA) rather than being limited to earlier versions of those specs.
There are free app servers such as WebSphere Community Edition(WCE) which is based in Apache Geronimo.
You will probably find it convenient to use a development tool such as Eclipse, check that whichever server you use is supported by some such tool. WCE has a suitable Eclipse plugin

Resources