Grails - Won't open localhost when adding data to bootstrap.groovy - grails

I am trying to learn Grails and following along the guide on grails.org http://guides.grails.org/creating-your-first-grails-app/guide/index.html which to some extend works fine. My issue is, that I follow the guide to the dot, and when I come to part 4.4 about bootstrapping data. I fill in the code in the BootStrap.groovy file in the init folder.
When I then proceed to run my app and try to connec to the url localhost:8080 the site simply will not load. I can acces the dbconsole and see that the data is bootstrapped, so I guess the app is working to some extend. But the site wont load.
When I remove 2 of the Vehicles, the site loads fine. I have tried using grails-clean, and kill all processes on the port 8080, stille nothing helps.
Please help me with this, as I am stuck!

In your save method call, add failOnError: true. It's likely that something is failing when you try to save it. Also keep an eye on your console for error messages.
If that doesn't help, post some exact code.

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

Grails Helloworld tutorial app not working

I feel guilty coming to Stack Exchange with such a trivial issue, but I've been banging my head against it all morning and can't seem to get anywhere. I am trying to run the simple HelloWorld app in the Grails tutorial: http://grails.org/doc/latest/guide/gettingStarted.html#creatingAnApplication
I have Grails installed, I can run it, create the controller and everything, but no matter what page I hit, I get nothing but a blank. Even pages that don't exist, return a blank page and not an error.
For example, I tried http: //localhost:8080/helloworld, obviously, and get nothing but a blank page back. The same thing happens for http: //localhost:8080/hellowrld, http: //localhost:8080/helphelphelp and http: //localhost:8080/pleasefortheloveofpeteworkalready. Always the empty response.
When I try a different port, I get an error. When I stop-app and try, I get an error. When I run grails run-app with port 9090 and try port 8080, I get an error, but on 9090, I get the blank page. So, I assume the server is fielding the requests, but just isn't responding for some reason.
I'm probably missing something super simple, something dumb, but I can't figure out what it is, and the complete lack of feedback is killing me.
Are there logs anywhere I can check? And, is there something obvious I'm missing?
(PS: I assume the environment vars are correct, because I can run Grails no problem. Also, I installed, but never ran, the GGST IDE thing. I rebooted since then, but could that have installed some service that's taking over?)
Thanks,
Peter
The application name is the default "context", so if you create an application called foo (grails create-app foo) it will be available at http://localhost:8080/foo if you run grails run-app. You can use a different port, for example 9090, by running grails -Dserver.port=9090 run-app and you can also use a different context (or none at all).
The run-app script displays the full URL of the application in the output window - you should see something like:
Server running. Browse to http://localhost:8080/helloworld

rails view not updating

I have started with my first rails project using Redmine. I have started to dig into the code to get a better idea and having a hard time understanding the erb files. When I go to make a simple change to the welcome.html.erb file, I make the change and check in the browser and there is no change. Once I save a file is there something that I need to run before the view will be updated? I did not think so, but that is why I am here asking because the view will not update the page when I save the file.
Thank you in advance for any help.
UPDATE: After I update the .html.erb file and open it up again in vim, my changes are still there. Only problem is that the page does not reflect what the change has been made to and when I view source it is not there either?????
It looks as though my cloud server is slow to update the pages so I need to check and see why this is. There is no problem with the pages when working locally and the page was updated in the source the next morning.
Using an IDE is not a good idea when you're learning Rails.
Try opening a console and cd into your application directory. Then run rails s and you should see your application running on a browser when you point to localhost:3000
You can leave the server running and modify your view file with any text editor. Changes should reflect automatically without even need to restart the server.
HTH!

Grails + Netbeans + Apache Tomcat

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?

Resources