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.
Related
I published my project, which uses Application Insights, on an IIS server. The files I published are: all DLL from Application Insights, the script tag for collects http requests from the view that i want to track, and the applicationInsights.config with the intrssumentation key in it.
The issue is that not collect SQL dependencies. But the interesting thing is that when I run the project in Visual Studio it collects all the dependencies including the SQL dependencies.
In this case, what could be the problem? a configuration issue on the server? something missing from publish to server?
If you're seeing them collected locally while debugging, but not when deployed, then chances are you have a different version of .net or the AI sdks installed in the 2 places, or you're missing a required library when you deploy? make sure your deployed items are the same as your local dependencies?
see: https://learn.microsoft.com/en-us/azure/azure-monitor/app/auto-collect-dependencies
for a bunch of the details about versions and packages, etc.
I am trying to publish a website from my computer to an IIS web server via web deploy.
I have 3 servers. All servers have installed the same things (Webdeploy etc.) and the services are started (Web Deployment Agent Service and Web Management Service).
On the first server I have no problems on connecting. But the other two servers give me some error when I "Validate Connection" in Visual Studio to the IIS. When I look at the logs on the IIS server, there are my accesses listet with html code 200 (ok).
An error ocurred when the request was processed on the remote computer. Filename: MACHINE/WEBROOT
Error: The configuration section 'system.webServer/management/delegation' cannot be read because it is missing schema
I really have no idea what could solve this problem and hope you are able to help me.
I had the exact same problem, it turned out I had installed Web Deploy 3.6 on top of 3.5. Remove Web Deploy 3.6 and reinstall 3.5 and see if it solves your issue.
You can also try #james-wilkins comment below: "In my case I installed Web Deploy BEFORE installing the management service..."
Uninstall and then re-install Web Deploy.
This fixed the problem for me -- the 'repair' option in the installer did not.
In my case, I installed Web Deploy BEFORE installing the management service. I tried to do a "change" on the install to include the management service (or you can add the feature from add/remove windows features), but that didn't help (got the error on this post). In the end, a simple uninstall and reinstall of 3.6 was what worked for me. Seems it needs the Web Management Service to be installed FIRST. Typical MS instructions don't even mention this at all.
I have built a small web app using Gradle. Things seemed to be going well using the embedded Jetty server, but not so well when I tried to copy the WAR file to a standalone server.
I used the gradle war plugin to assemble the war.
Running gradle jettyRunWar works fine.
Copying the war to the Jetty webapps folder and running Jetty fails with this exception:
java.lang.IllegalStateException: No such servlet servlet_name
But this very same servlet is found and used without issue in the embedded Jetty server.
The same issue happens if I manually copy the exploded war to the webapps directory.
The Spring web and Spring mvc libs are copied and present in the WEB-INF/libs directory, so it isn't an issue of not finding Spring (or is it?)
I'm using Jetty 9.1, and my web.xml file is configured for Servlets v3.
I'm also using Spring 3.2. The web app I'm writing is a RESTful service, using the #Controller annotations to route requests.
This should be as simple as copying the war over, but it seems not to be. At a bit of a loss at what to do here, any thoughts?
Thanks!
Sometimes the answer is staring you in the face...after posting I realized that I had my servlet-mapping before my servlet declaration. While this did not present an issue for the Gradle Jetty (not sure why), it made Jetty unhappy. Not sure why I changed the order to begin with...
In short, Jetty seemed to not find the servlet because it had not been declared yet.
I have an web application that runs in JBoss and i use FlyWay in command line mode to migrate between database versions.
I want integrate Flyway in to my application using Spring Framework and only stop the deployment in to the web server if the db version is wrong. Is this possible?
First of all, I strongly recommend migrating the database on application startup so a mismatch can never occur.
If this is not an option, you can implement custom logic to check the results of Flyway.info() against the desired version.
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.