GWT GUI Application not getting loaded on Apache Tomcat 7.0.39 - apache

I have a GWT GUI (getmap) application and i have placed it at \Apache Software Foundation\Tomcat 7.0\webapps directory.
Now when i am trying to open it using http://:8080/getmap/GetMap.html>, i am getting an error " Requested Resource is not available"
But when i copy same GWT GUI Application under \Apache Software Foundation\Tomcat 7.0\examples directory and load it using http://:8080/examples/getmap/GetMap.html>, everything works perfectly !!!
This problem is faced on Windows Vista.
I wold appreciate if anybody could provide some pointers to get rid of this issue ?

webapps contains WAR files or their exploded equivalent (i.e. a folder with a WEB-INF subfolder containing a web.xml file). The root of the server (served at the URL /) is a special webapp named ROOT.
So either create a ROOT webapp, or make getmap a webapp by adding the necessary WEB-INF/web.xml.
DISCLAIMER: the above is overly simplified and might not be accurate; plase check the Servlets spec and/or the Tomcat docs about deployment.

Related

grails.app.context being ignored deploying to Tomcat

I have an Apache server proxying all traffic from mainhost.com/subdirectory to someec2instance/subdirectory. When I start Apache and hit someec2instance.com, I get the ROOT war page. That works fine. If I deploy my app as ROOT.war, everything works fine form someec2instance.com.
However, when I access mainhost.com/subdirectory, all the asset urls and link_to urls are wrong and point to mainhost.com instead of mainhost.com/subdirectory.
I've set grails.app.context and confirmed via application.properties that the correct grails.env is being set.
Why isn't grails.app.context being respected when I deploy as ROOT.war? I would expect the site to be accessible on someec2instance.com/context, but it's like it ignore grails.app.context entirely.
The reason is doesn't work is that those settings are for running locally, not when deployed as a WAR file. When you use the tomcat or jetty plugin in run-app we configure the container to make it look like it's running an "exploded" war (similar to when a WAR gets unpacked to the file system by various servers). Since the container is running in embedded mode, it's easy to configure it programmatically as needed.
But when you deploy a WAR file there's nowhere near as much configurability. In run-app the build logic of Grails starts the server, configures it, and deploys the app, but a WAR file deployed to a "real" server is managed by the server and not the other way around.

not able to deploy war file in jelastic cloud

I developed a web application using java and mongodb. I used glassfish server.
I tried to deploy it on jelastic cloud service
I uploaded my war file. But when I run it after deploying the war file it shows a 404 error. Why? The project works fine on my machine.
There are at least few potential causes:
your app needs some resources which are not started by default (such as DerbyDB). In this case you can check GlassFish log file - server_instance.log for more details.
you are trying to get resources from wrong context, make sure you are trying to get it via correct context name

Glassfish: how to investigate roles/groups problems

I have a Glassfish server in production which uses JDBC Realm for authentication.
It works well, but there is the need to change all the roles/groups. I developed a new version of the web application in a test environment changing glassfish-web.xml and web.xml to align them with the groups contained in the groups table on the db for test. Everything works flawlessly. So I moved the web application to the production environment and updated the content of the groups table on production db.
The authentication works well but roles are not recognized. How can I investigate this problem ? I checked the production db and the groups table is fine and can be accessed for select. Glassfish-web.xml and web.xml are the same of the test enviroment. This is a real brain teaser. The only explanation I can give is that Glassfish-web.xml is discarded for unknown reasons or the old file is still present and read from some other location than web-inf directory.
Thanks for any help
Filippo
Explore your domain's folder under GlassFish root folder + \domains. If you are unsure what domain you are on, it is domain1 by default. Under this folder you should have a folder called applications. This folder contains the deployed version of all your applications, and it's the place where to check your application's Glassfish-web.xml configuration file.
Anyway, if you are having this kind of problems, a Clean & Build of your project, followed by a redeploy, usually works.

Axis2 and Spring3 integration

I have an Web application developed using Spring3. Some functions of Web app needs to be exposed as Web services also.
Web app is deployed in the Tomcat Server as a .war file.
I have gone through Axis2 and Spring integration in the site http://axis.apache.org/axis2/java/core/docs/spring.html. What I am unclear is how the final structure looks like. Need clarifiaction on the below points,
1) What should be the directory structure of my final app for "With ServletContext" as well as "Without ServletContext" ?
2)The .aar file also should be placed in WEB-INF/lib directory? If so how does axis2 recognize this as service as it has compulsion on the directory structure like .aar file and inside it META-INF which contains services.xml. and the classes at the same level as META-INF folder.
I am not sure if I am going wrong in getting the whole picture. Any guidelines or a good tutorial would be highly helpful.

How can I get aspnet compiler to handle a page that contains an include file

I have a web application that lands on a shared hosting platform for my company. That platform has global header/footer code that all applications on the platform consume using include files. I can't change how the header files are structured and how they are to be cosumed--that is dictated to me by another group. I have a build server that does not has IIS installed by design. I am attempting to use the aspnet_compiler.exe during the build process to generate the precompiled website files for deployment.
However, when the build runs I get errors like this:
/Company/Controls/Header.ascx(7): error ASPPARSE: Failed to map the path '/sites/header.inc'.
The Header.ascx control has this server-side include in the HTML:
<!-- #include virtual="/sites/header.inc" -->
On my local machine, I have created a virtual directory in IIS named "sites" that points to the global header code (which I have also copied to my local machine). This same "sites" virtual exists in IIS on the hosting environment. I would really like to avoid having to install IIS on the build machine because it is a shared build machine and I don't anyone to mistakenly work IIS dependencies into their code. The build machine shouldn't need to have IIS.
What is the best way to get the precompiled site files that aspnet_compiler.exe produces during my build without installing IIS?
Microsoft has a very simple example of how to replace an include statement...
http://support.microsoft.com/kb/306575
Looking at the path of your error it seems you are already using some sort of global user control and I'm guessing this is a file which is reused by other applications or languages so I would suggest coming up with a more custom version with error handling and such since it is working over a mapped drive but the basic answer is you need to read the file and output it to the stream during the Render event.
Don't use server-side includes. They are ancient technology and are disabled on most modern sites.
I recommend you instead create .ascx files to replace each of the .inc files, and use those instead.
Try this:
<!-- #include virtual="~/sites/header.inc" -->
The ~ is a shortcut for "root of the web application."