When deploying old GWT app to Tomcat, RPC URL returns 404 - spring

I'm moving old GWT app from one server to another. Both in Eclipse and on old Tomcat everything is working OK, but on new server GWT app gets loaded (so the server is working and serving files), but fails on RPC call returning 404.
My admin and I have looked at possible differences in context paths, Tomcat and Java versions, and tried to recreate config on the new server as close as possible but it seems that we're missing something so I'm looking for fresh ideas.
As mentioned on this link under common pitfalls, it indicates that web.xml is misconfigured, but this is ruled out as the same web.xml works OK on old server. My #RemoteServiceRelativePath is "app.rpc" and in web.xml this is mapped to:
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.rpc</url-pattern>
</servlet-mapping>
...and in dispatcher servlet this is mapped to a correct controller. I can also give server.xml or any other part of config if needed, but I'm looking for other things that could be incorrect.

Solved it, but by going nuclear and copying the exact same Tomcat and Java version with the same paths and all settings as on the old server. What I do know is that it was not a network problem, and that the request was received by Tomcat but never got to GWT or application code; so either Tomcat (5.5 in original configuration, 6.0 in the) or Spring (2.0.2) is the culprit. This is the old application that won't be updated and is due to be replaced and I hope it dies a quick and painless death.

Related

Unable to find out JSP translated files are stored in Google App engine

Working on webapplication using Spring 3, Maven and deploy code on Google App engine while configure code into workspace it shows error
org.apache.jsp.pages.list_jsp could not be resolved
Below are the sample code which I am using in web.xml
<servlet>
<servlet-name>org.apache.jsp.pages.list_jsp</servlet-name>
<servlet-class>org.apache.jsp.pages.list_jsp</servlet-class>
</servlet>
When I was created WAR file and delpoyed it on local server i.e. Tomcat then code is working fine but it is not working on Google App engine.
The JSP translated files are stored (in Tomcat) in /work/Catalina/localhost/[your_app_context]/org/apache/jsp/. so with the help same path it was findout the path and work properly but at Google App engine the server is Jetty and it is not recoginized path.
Kinldy suggest me what changes I need to made so the code is working fine.
2) ScreenShot for Production deployment error.
enter image description here
3) Web.xml configration ScreenShot
enter image description here
According to Jetty docs, you need to configure the package for precompiled JSPs in your web.xml.
<context-param>
<param-name>org.eclipse.jetty.servlet.jspPackagePrefix</param-name>
<param-value>org.apache.jsp</param-value>
</context-param>
Then try running it locally using jetty-maven-plugin. If all goes well, deploy to App Engine.

Wildfly Undertow HTTP Response 200 but no content

I am developing a simple web service using Eclipse Java EE IDE for Web Developers : Version: Kepler Service Release 2 Build id: 20140224-0627 and Wildfly-8.2.0.Final. I chose wildfly-javaee7-webapp-blank-archetype using Maven and started development. Firstly, there was no problem, I could add some simple jsp pages and also a simple html page with some images and javascript inclusion then I could deployed, launched and accessed those pages by browser. But all of a sudden, Wildfly (I guess Undertow maybe?) started to response with HTTP response 200 with no content... I really don't get what is going on. I also did rollback my sources to the very early simple pages only. But still the symptoms are the same. Also I have tried to use newer version of Wildfly-9.0.1.Final and deployed manually but I haven't seen any difference.
ex1) this is ok. (Of course browsers take care of this...)
ex2) this kind of contents won't be loaded and sent back as content 0...
I doubted local path issue but I haven't changed anything and it was loaded earlier.
It would be really appreciated if somebody could give me a solution.
Finally I have solved this problem. I have found a problem on a servlet I have added at last. Actually I was trying to migrate my web service running on glassfish and did migrate files one by one. I specified a URL to be handled by the servlet in Web.xml when it run on glassfish. But somehow, it's not working on Wildfly which means all URL request are unexpectedly handled by the servlet... Since I have no idea to specify url to be handled by the specific servlet in Web.xml for Wildfly, I decided to filter request URL in the servlet code. So it is working now. Thank you guys trying to help me...

Not auto-starting webapp without servlet

I have a simple webapp deployed within Apache Tomcat (7.0.x) which is bootstrapped using a ContextLoaderListener instead of a Servlet. I would like this webapp to NOT auto-start whenever the Tomcat server itself is started but instead only started/stopped manually via the Tomcat manager. The examples I see online show how this can easily be done with the following code for servlets within web.xml:
<servlet><load-on-startup>0</load-on-startup></servlet>
But no examples are available for when using a ContextLoaderListener. Is this possible at all? Or would I need to include a servlet in order to configure the webapp to NOT auto-start whenever the Tomcat server itself is started?
Thanks in advance,
PM.
You should read this recent discussion on the Tomcat users' list which I believe answers your exact question: http://markmail.org/message/5hp3dohwj3vncg4c
The bottom line is that you can start only the Manager webapp on startup, but there are some restrictions about what happens after a restart. The replies from Mark Thomas are the most useful.
I don't think you will be able to do this in web.xml. load-on-startup is used to tell the webapp to start a servlet when the webapp is started. A webapp often consists of multiple servlets.
If you want to make sure the webapp is not loaded at startup, and instead use Tomcat manager to start it, I suggest you set deployOnStartup="false" in the <Host> container, in settings.xml. See the Tomcat 7 documentation page for the details:
http://tomcat.apache.org/tomcat-7.0-doc/config/host.html

Match spring controller to domain

I don't know how to describe it in a better way, as in the headline, because I really don't know what I'm actually looking for.
I have my spring app and the main Servlet matches the root. Here is the used servlet mapping:
<servlet-mapping>
<servlet-name>shop</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
And the app it self is deployed as root app.
So the Problem is now, when I try to access the domain via example.com it does not work and I get a 404 not found error. Only when I use the following url: example.com/ ... tara ... it works as expected.
I know that is a really basic question, but since I do not know what I have to search for. I couldn't find any thing to solve this problem.
Thanks for any kind of solution to solve this issue. :)
Don't confuse application context root with URL root. Remember java web containers are not the same thing as an HTTP server.
If you're using a container such as Tomcat to deploy the app and want the app to tie to the root URL, you're going to have to use an http server such as Apache HTTP to set up a virtual host.
Would start reading this documentation:
http://httpd.apache.org/docs/2.2/mod/core.html
If you want to set up a virtual host for your web app.
/ is a special url matching pattern meaning the "default" servlet. If you want your servlet to serve all requests, use /*. The default servlet is called when no other match is found to serve static content and list folders, which is probably not what you want here. Not sure about it, but the default servlet might require the leading slash.
thanks for your answers. I know that question is a bit old, but for all who had the same problem.
Here you can find the solution for xml and java config:
http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-default-servlet-handler
If you add this xml tag or override the java config method it works, that your web app can respond to '/' urls :)

A WebGroup/Virtual Host to handle /ShoppingWAR/shooperServlet has not been defined

I am trying to add one web application in to the existing EAR. I have added the web.xml and a servlet file and packaged it as a war then packaged it in the EAR. When i am trying to access the servlet in internet explorer i am getting the page can not be displayed error. I am not sure whats is going wrong here.
I am getting the following error in system.out log
A WebGroup/Virtual Host to handle /ShoppingWAR/shooperServlet has not been defined.
Any help in this is highly appreciated. I am ready to give further file details if you need friends.
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
DataBase
jdbc.shoppingmall
javax.sql.DataSource
Container
Shareable
shooperServlet
shooperServlet
<servlet-class>com.shopping.shooperServlet </servlet-class>
<load-on-startup>1</load-on-startup>
shooperServlet
/shooperServlet
Besides what chro has mentioned ensure that the web app is deployed to the correct virtual host. By default there are two virtual hosts (one for applications and one for the admin console). I don't know if you have added additional VHosts.
HTH
Manglu

Resources