Standalone Jetty Server Proxy is not working - eclipse

We have developed a SAP UI5 web app using eclipse. In this app some cross domain ajax calls are there. That's why we are trying to use Jetty proxy.
While testing the app inside Eclipse(which actually uses inbuilt Jetty server) its running fine. But Whenever we are deploying the war file to Standalone Jetty server its not able to forward messages to target.
Can you please help how to configure Jetty proxy?
Below is the screenshot of web.xml inside my webapp.

Related

How do i deploy my wicket project?

i am new to web development and i created a wicket app on my local computer. i have a server running apache 2.0, maven and open jdk. Its an ubuntu server with only command line.
Any help would be wonderful.
Thank you
You cannot run the wicket app by itself; like any java servlet it has to be run on a servlet container.
There are many containers to choose from, the ones I most commonly come across are
Tomcat
GlassFish
Jetty
You need to install one of containers like that to convert the HTTP requests into java. Once you have one of them installed and running, you can deploy your wicket web-app in it.

spray-servlet: Issues when war is deployed to tomcat7

I have created a sample application based on akka and spray-servlet. The code and other details can be found at https://github.com/rajvaibhav/spray-tomcat-routing. I am using embedded tomcat for development purpose. The application runs as expected when I deploy it on the embedded tomcat. But when I deploy successfully the same war file to a stand alone tomcat7 server, I am getting 404 after hitting the application's URL. This is very strange. I have checked my tomcat7 server by deploying another Servlet 3.0 application. That works fine, but following the same steps I am not able to hit my application on standalone tomcat7. Any help appreciated.

GWT Deployment to JBoss

I am currently working on a project which has a GWT frontend and a seperate Java module with servlets and a REST interface on the backend. The project when deployed runs on a single JBoss server.
I am running into difficulties though as when I run the GWT app in hosted mode (in eclipse) the jetty server does not have a deployed Java module to interact with.
My idea was to setup a JBoss server which eclipse could deploy into for development purposes, the problem with this is that the installer for the product sets up a JBoss server with a GWT app already embedded in it, so redeploying into this JBoss instance might cause problems?
My other idea would be to create a second JBoss server to host the GWT app, with some sort of url redirect for the rest calls which would redirect to the first JBoss instance. Is this possible?
EDIT: Can I do this with the built in jetty server in eclipse and not have to worry about using a seperate JBoss server. In other words can I somehow get the jetty server in eclipse to redirect particular requests to a different URL?

Web Services in Eclipse

I have many projects setup in eclipse. One of these projects is a Web Service Client Project. When I start tomcat using the Start Tomcat plugin in eclipse Juno, my Web Service project is not running. I get a 404 http error. However, using the Server tab in eclipse (on creating my web services project, a Server project is also created), if I start Server, my Web Service Projects runs corectly.
I am of the view therefore that Web Services projects must be started using the Server->Start option and not Start Tomcat using the plugin.
I am new to Web services. Can anyone share some information on this, and how perhaps I can get the Web Services project to run using the Tomcat plugin.
Regards
Fyzal
did you add the Web Service project on the Server ? Right Click on Webservice Project and Run on Server OR Right Click on the Server and "Add or Remove" Resource

how to run the servlet in eclipse?

I want to run a servlet in Eclipse. For this I have created a dynamic web project and I have deployed my servlet.java file under the WEB-INF folder. I have also added the servlet.jar file. How can I run the file as a java application?
Servlets run in a servletcontainer. Servlets are not "plain vanilla" java applications. See, they do not have a main() method! Servlets listens on HTTP requests and returns HTTP responses through the network. Running the sole servlet class as a plain vanilla Java application doesn't automagically make them to listen and react on HTTP requests.
Apache Tomcat is a popular servletcontainer. Just download and unzip it. Then in Eclipse (I assume that you already have downloaded the Eclipse Java EE version, else drop it all together and redownload the right version), go to Servers view and add the newly installed Tomcat instance. Then create a Dynamic Web Project wherein you pick the newly integrated server instance from the list. Eclipse will then automatically take the Servlet API libraries in the classpath/buildpath (thus, you do NOT need to download a random "servlet.jar file" separately yourself! this is only receipt for major trouble). Then create a Servlet class and register it in web.xml. Then deploy the project to the newly integrated server and start it. Then in your favourite webbrowser go to http://hostname:port/contextname which is usually http://localhost:8080/webprojectname.
To learn more about servlets (and Eclipse and Tomcat) I strongly recommend you to go through those tutorials. You can also search on youtube for video tutorials using the obvious keywords.
Servlets run in servlet/JSP engines, like Tomcat or Resin or Jetty. You normally don't run them outside a container.
You can certainly deploy your app to a servlet/JSP engine and start in from Eclipse. But it's the app server that you run, which then acts as the home for your servlet.
Servlets cannot be run directly as an Java app.
I recommend two approaches:
Refactor your servlet and put your "java" code (what ever generic code you want to call) in another jar that you call from both the servlet and the Java application.
Run the servlet in a container in Eclipse. See http://www.eclipse.org/jetty/
Communicate with the servlet through HttpRequest's and HttpResponse's