Grails + Netbeans + Apache Tomcat - grails

So I have my grails server running with netbeans and i'm codding new features / testing in my browser at same time. For some reason, sometimes when i change code im domain classes and then save and refresh my page, the server seems to go down but in reality, it is still running. I get this error:
HTTP Status 404 -
type Status report
message
description The requested resource () is not available.
Apache Tomcat/6.0-snapshot
Any idea how to solve that? Because its really anoying, i make changes and then when i want to visualize it the server goes down. Any help would be apreciated.

If you change anything in a domain class and save it your app will get re-deployed and may take a minute (404 in the meantime). You can change views and controllers without the app being re-deployed and you should see the changes as soon as you save and refresh.
Does this help?

Related

404 error when accessing Struts2 Web application

I had created a web application and committed the code in CVS. The web application is working good in my machine. When i tried to import the same code in another machine i am getting 404 error. I tried importing the code via ftp from my machine to another machine and also checking out the code from CVS. But still i get 404 error.
I also noticed that there is no error that had been captured in the console or in the application's log. Could someone help me in how to proceed further in identifying the issue. Please let me know if i need to post any further details regarding the issue.
I notice this issue to be in the Websphere server. I tried hosting the application in different machine and found that in few machine the same code is working good and some it is not. Is there any way to compare the server configuration?
In the WAS server 6.1 i added the below value in the web container and the application worked fine.
Steps:
In the server admin console, click on Application Server--> --> Web container--> custom properties.
Add the name as com.ibm.ws.webcontainer.invokefilterscompatibility and value as true.
Thank you all for the response.

Django+uwsgi: uwsgi_response_write_body_do(): Broken pipe [core/writer.c line 248]

I have this weird issue in my django application. I am using the admin interface. When I try to load the change page it doesn't render completely and when i see in logs it says:
**uwsgi_response_write_body_do(): Broken pipe [core/writer.c line 248]
IOError: write error**
The page has been working fine before and suddenly this started happening. And also the behavior is inconsistent. If I reload the page multiple times, few times it renders correctly. This issue is happening in production environment and I am not able to replicate it on my local. The production server is using uwsgi 1.9.10 with nginx and django 1.5. Also I am writing custom HTML on page and there is an inline table also on the same page.
Please let me know if anyone knows why it is happening...
that error means the client (browser) disconnected before getting the full response. Check your webserver logs, maybe you hit a timeout

JBoss not responding to valid URLs

I encountered strange behavior of an JBoss AS 7 on linux server. When I deploy war with my application, the server doesn't respond for valid HTTP requests for this app. When I try to GET a valid URL, I can see in logs, that backend functions (e.g. DAO methods) are called, debug logs shows that subsequent tags in my JSF are rendered, I even can see a message Rendering View index.xml, but the response never reaches the client.
When I use a non-existent URL (e.g. index.asd) response is 404 and when I use a wrong page name (e.g. inswxasd.xhtml) the response is 500. Thus it fails only with valid requests.
I tried to connect both remotely (using firefox) and locally (with wget) and I reproduced the problem. The strange thing is that I deploy the war that I already used and then it worked.
EDIT 1:
I've just noticed that when I send a request to, the server process takes 200% of CPU. Additionally it happens for only one application with stack: Hibernate, Spring, JSF 2.0, Primefaces.
EDIT 2:
Here is pastie with jstack output (jstack -l -F <PID>). All threads are blocked.
Additionally I noticed (using top and dumping stack of the JBoss process) that the problem is most probably caused by a thread called http--0.0.0.0-8080-1. Any ideas?
Thanks for help. I reverted the database to previous state, and it started to work. Apparently there was a problem in the data that caused this infinite loop. Now we need to find it, but as it is reproducible, I'll manage.

Repeated "java.lang.IllegalStateException: Cannot forward after response has been committed" errors with Grails and Tomcat

Please see my post on the Grails user mailing list. Essentially, I get the error "Cannot forward after response has been committed" with Grails 2.x after every few requests. This happens for all types of URLs, controllers, GSPs, CSS files, JS files and even image files. I have tried Grails 2.0.0 and Grails 2.0.1 with Tomcat 6.0.35 and Tomcat 7.0.25 on Windows XP 32-bit, Windows 7 32-bit and Centos 64-bit. The error comes up on all these combinations.
As I have mentioned in my post, there are no response.redirect or response.forward statements in our code. This is causing severe problem on our production application so need help in determining what else can be looked at to get to the bottom of the problem.
This has been solved. In one of the controllers in the application, response output stream was being directly written to but not closed explicitly after the operation was over. It seems Tomcat and Jetty recycle response objects. When a response object that did not have their output stream closed earlier was recycled for a future request and redirect was performed on it, the redirect would fail.
The code has been changed and the error has disappeared now. The lesson learned is that any time such an error occurs, scan the entire code base for direct access to response output stream and close output stream responsibly before existing controller methods.
You should create a new grails application and move the controllers, domains and etc yourself rather than grails update.
When you do that also make sure you look into the configuration files of grails.
Also take a look at what plugins you have.
Also, when moving the files, try out the application once in a while when it is possible, and perhaps you can detect when the error arises. Start out by trying it in your most basic controller and see if the error is there then as well.
Good luck.

Why am I getting the message "The specified request cannot be executed from current Application Pool"?

Quite not sure why I see this error.
I navigate to my Login View like so http://test.staging.com/mywebsite/Login
My Login view was just redone using MVC but I have seen this same error message going to an aspx page as well...
If I use http I get the error message The specified request cannot be executed from current Application Pool.
If I use https://test.staging.com/mywebsite/Login, I'm good.
If I don't specify a protocol, test.staging.com/mywebsite/Login, I get the error as well
Is there an error happening under the covers and my custom error page can't be shown like discussed here?
What are some other causes of this error?
That usually means your custom errors are configured to run as a different AppPool.
You can read more at MSDN. (See section "Using Custom Errors from Another Application Pool").
There are two ways to correct this behavior. The first is possibly not one that you are interested in because it would require you to change your current architecture and run both sites in the same application pool (such as share the same worker process memory space). To do this, simply move the /errors virtual directory to run in the same application pool as the site for which it serves the custom error.
The second way is to make use of a registry key provided by IIS 6.0. This registry key makes sure IIS 6.0 does not check the metadata during the execution of the custom error and therefore allowing this to work.
See the article for information on the registry key fix.
It may also mean that you are using something along the lines of Server.Transfer to a page that is in a different AppPool.
It could be because you're using different versions of ASP.NET for one or many apps in the pool.
Make sure all apps in the pool use the same version of ASP (e.g. ASP 2.0.50727)
If you just added a new app, try changing the app momentarily to a different version of ASP, then back to same version. I experienced an issue where the displayed version was correct, but under the hood, a different version was used!
Check your event log, under Application, to get more details about the error.
The message would be caused by your page server-side redirecting to a page served by another application pool. Such as for example, in your link, the error page.
I know this is an old thread, but I stumbled upon it and found a different solution. Here's what worked for me: Make sure your application handles .asmx files correctly
From IIS:
Right Click on your project > Properties > Configuration
If necessary, add the .asmx file extension that maps to the aspnet_isapi.dll
Limit to: "GET,HEAD,POST,DEBUG" and restart.
Because I can't comment on vcsjones's answer, I'll add it down here. The DWORD value IgnoreAppPoolForCustomErrors needs to be set under HKLM\SYSTEM\CurrentControlSet\Services\W3SVC\ Parameters vs HKLM\SYSTEM\CurrentControlSet\Services\W3SVC referenced in that technet article. Set it to 1 and do an iisreset and you're good to go.
Source Blog Post
In my particular case, I received this error while trying to serve a content (non ASP.NET) website while it was an Application. Right-Clicking the virtual folder and removing the application fixed it for me.
In my case the application used the application pool that didn't exist. I have no idea how it's happened.

Resources