Can't run my Spring MVC project on a Tomcat web server (local) - web-services

I have used Spring Template Project to create a Spring MVC Project. It works fine running it on the "VMware vFabric tc Server Developer Edition v2.8"-server. But when I move it to the Tomcat server and I try to run it it doesn't work. When I try to access the site I get following:
HTTP Status 404 - /analyse
type Status report
message /analyse
description The requested resource is not available.
Do I have to convert the project some how? It doesn't have the same structure as the other projects in the webapps-folder.
Any idea?
So basically I need to know what has to be done in order to run my Spring MVC Project on my Tomcat-server.
Aprreciate any help I can get!

What is the name of your *.war file?
Typically you can access your app via a URL by the same name, minus ".war"

The problem is in deployment assembly,you have to check it.
As you are using maven so you can type following command
eclipse:eclipse -Dwtpversion=2.0
so it will solve deployment assembly problem and also download necessary jar's.
Then run command
clean install
and clean the project from
project clean option.

Go to Project --> Properties configure Java, Javascript and Dynamic Web Module.
And now you can access the application in Tomcat Server as well. The problem is in deployment assembly.
Properties Configuration

Related

Codename One: Webservice not available

I used the CN1 Webservice Wizard to add a the webservice proxy to my mobile app and to generate all the server side code. I have a local XAMPP installation with a tomcat linked within my Eclipse IDE. Also, I imported the server generated code as a new Java Project and added the "Dynamic Web Module" project facet to it so that I could launch it not as a local Java application but rather on the Tomcat server.
When starting my client, I noted that I get HTTP 404, resource not found errors. I traced the error back to the URL, where the server is hosted to.
I know I have to adapt the urlPatterns parameter in the generated class CN1WebServiceServlet, which I did. Also, I checked the context of my app in the Web project settings and defined the value for context root. So, in my client app, the URL to call the service should be
http://localhost:8080/< context root>/< urlPattern>
However, even when calling that in the browser, I should get the result of the doGet method of the server generated code, showing the message "Webservice access only". Instead, I get 404 errors all the time.
Is there some problem to importing the server generated code as a plain Java project and adding the web parts to it afterwards? How would that be done in the ideal case?
And what other problems might be hindering the URL from properly being published on the server side?
Thanks and best regards
EDIT
I stripped everything from the project to limit the options and I found the cause: when using the web service wizard to dump the source files into a new directory, adding that with the Eclipse import wizard, it will be looked at as a plain java project without any web components. Using the project settings to add the dynamic web piece to it (Eclipse calls those project facets), the CN1 webservice will NOT work.
If instead you create a "Dynamic Web Project" first and then use the CN1 Webservice Wizard to dump the server source files into the "src" folder of that project, it works without any issues.

Cant Find my Axis2 Web Service deployed on OpenShift

I deployed a web service developed using Apache Axis2 on Openshift.
When I try accessing the axis2 index.jsp, I can see the index page which only contains the default Version.
Q:
How do I get to display the web service other web services I created as I can view them on my localhost through the browser in Eclipse?
I have done a few searches online and seen some suggestions as to making adjustments to axis2.xml. In that regard, I have tried changing the contextRoot parameter and the servicePath without no success though I am not too sure if I am making the right changes.
My project structure in Eclipse is shown below:
SieveService
+...
+Java Resources
++src
+++Model
++++some model classes
+++Services
++++SieveServiceService.java
++Libraries
+...
+WebContent
++axis2-web
+++...
I had the same problem and that's occurs because openshift's tomcat server only deploys services in aar format, meanwhile in localhost deploys aar and exploded files too.
You need to create a aar file with your services and put it into your WebContent/WEB-INF/services/ directory. You need to update the services.list file too with the name of your services.
After that you must see your services in your openshift server.

Issues while deploying tomcat 7 in cloudfoundry

I have a java Spring application that I want to deploy to Cloudfoundry on Tomcat7. I am newbie to Cloudfoundry and followed the steps mentioned here but when I issue vmc push command I am getting warning Can't determine the Application Type with no options provided. Any idea to resolve this ?
C:\apps\tomcat7>vmc push
Would you like to deploy from the current directory? [Yn]:
Application Name: myApp77
[WARNING] Can't determine the Application Type.
Select Application Type:
Dan's comment is correct. You should be given the option to choose standalone app.
You may want to have a look at https://github.com/ericbottard/cloudfoundry-tomcat-7 which is a distribution of tomcat already customized (and tested) as described in the blog post you mention.
Even better, if you're using Maven, just follow the README and you'll be able to deploy your war project automatically as a tomcat7 standalone.
Hope this helps,
This actually sounds correct to me, in the list of application types should be an entry named "standalone application". Select that one and then provide the command you wish to start the application with, in this case it's 'bin/startup.sh'

Where to place clientaccesspolicy.xml in Netbeans Webservice project?

I develop a Webservice using Netbeans 6.9 and I use an embedded glassfish server to deploy my Webservice (http://some_domain/project_name/ws_for_sl4). On a different server there is deployed a Silverlight 4 client, which should have accesss to the Webservice.
I know that I have to have clientaccesspolicy.xml (under http://some_domain/project_name) however I do not know how to do it. I mean, I do not know in which folder of the netbeans project I need to put clientaccesspolicy.xml to have it automaticly deployed on an embedded glassfish server. To have my SL4 client using the webservice.
Solution:
- put clientaccesspolity.xml and crossdomain.xml under /Web Pages*
- open Project Properties (click right mouse button on a project root), go to Run, and delete a value of "Context Path".
Now your WS will be deployed directly under some_domain as it is required by SL4 (SL4 is looking for these files under the domain name.). SL4 will have no problem to access clientaccesspolity.xml and crossdomain.xml.
In case anyone doesn't like moving their webservice to "root", and instead prefers to have it in http://localhost:8080/aDifferentLocation/MyActualWebService, then placing those XMLs in the project Web Pages folder doesn't cut it.
http://localhost:8080/aDifferentLocation/clientaccesspolicy.xml
and
http://localhost:8080/aDifferentLocation/crossdomain.xml
would not work, as they need to be in
http://localhost:8080/clientaccesspolicy.xml
and
http://localhost:8080/crossdomain.xml
To achieve this, you must track down the folder where your GlassFish server is installed, let's call it [GlassFishInstallPATH] and paste the XMLs into the subfolder called docroot:
[GlassFishInstallPATH]/domains/domain1/docroot/ <--here go the XMLs.
(source)
In case you're wondering how you would do the same thing in Eclipse, you must track down the ROOT folder in your Eclipse J2EE workspace:
C:\Eclipse_j2ee_workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ROOT/ <-- the XMLs go here.

Where does the tomcat axis file server-config.wsdd come from?

Part of our system provides a web service through apache tomcat, the service is referenced in the server-config.wsdd file. Unfortunately nobody can remember how it got in there.
The apache set up has changed, and I need to update the system for the new configuration. What magic keywords can I google for to help me work out how and why it got into the existing server-config.wsdd, and how it might fit into the new server-config.wsdd
The server-config.wsdd file is generated by the wsdl2java tool from Axis. So, some developer used the tool and copied the file inside your Tomcat conf, where it belongs.
The server-config.wsdd is created when you deploy your web service by running
java org.apache.axis.client.AdminClient \deploy.wsdd
my knowledge says that it is hardcoded... and by using java org.apache.axis.client.AdminClient \deploy.wsdd or by explicitly invoking it through an ant script you can embody it to the server-config.wsdd and deploy the service