grails - Render doesn't work in production mode - spring

My render works well in development when I deploy the application I have an exception:
HTTP Status 404 - /myApplication/WEB-INF/grails-app/views/myController/MyView.jsp
def myView(){
....
render(view: "MyView", model: [params:params])
return
}
I found a fixed issue in JIRA but I don't know if there is exactly the same issue:
http://jira.grails.org/browse/GRAILS-5201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel
My environment:
GGTS: 3.3.0.RELEASE
Grails:2.0.3
apache-tomcat-6.0.37

As we figured out, it was because of inconsistent view name.
It's very likely that you're using a Windows for development, and a Linux for production. Windows is usually case-insensitive for filenames, but Linux is case sensitive (usually). So on production system myView.gsp and MyView.gsp is two different files, you must use same case for filename and in your code.

Related

Undefined route brings list of avalaible routes in production env

I realized my first WebApp with Vaadin 14 and deployed it to Tomcat 9 on the production server.
So far everything is working great, but when I'm using a non-existing route in the client browser the system responds with a plain text list of all available routes and shows even the following line on the bottom:
"This detailed message is only shown when running in development mode."
I have created the WAR-file with "-pProduction" and the startup-log of Tomcat does not show any dev-mode-message.
Any ideas what happens here? Thanks for reading my first question on this platform!
I worked my way through the Vaadin docs and tried the following entry in application.properties:
vaadin.productionMode=true
But nothing changed?
This is a known vulnetability CVE-2021-31413 in Vaadin 14.6.1 and older versions. The resolution is to update the Vaadin version to 14.6.2. The latest version is 14.9.1 as of writing this. Naturally I recommend that.
https://vaadin.com/security/cve-2021-31412

InvalidArgumentException - View not found

recently I upload my laravel a server program, but from there I can not get into any form, only the grids, this why?
Check your filenames. Different operating systems and software versions work differently. For example: it might not be the same to return 'view.index' and 'view.Index'

Play framework 2.3.8 mixed content in production mode

I'm running an application in prod mode, getting multiple "mixed content" warnings since scripts are apparently requested trough unsecure http. Of course in dev mode this is not an issue.
Allowing the browser to access mixed content (https and http), warnings like the following can be found in the console:
Mixed Content: The page at 'https://192.168.0.100:9443/' was loaded over HTTPS, but requested an insecure script 'http://cdn.jsdelivr.net/webjars/jquery/2.1.3/jquery.min.js'. This content should also be served over HTTPS.
I've read many post with similar issues, but I couldnt find any simple solution. This happened to be a problem in prior versions of play, but for 2.3.8 seems to be fully funcional. Don't really know, hope some of you does.
This patch should do the work: on build.sbt, add this two lines:
# at the beggining
import RjsKeys._
#...
# at the end
webJarCdns := Map("org.webjars" -> "//cdn.jsdelivr.net/webjars")

Spring security login error

I just implemented a simple login functionality using spring it how ever worked with the eclipse in built browser but gives the following error in chrome and firefox.
HTTP Status 404 - /SpringLogin/welcome.jsp;jsessionid=8332D4F3D4709DCA37C87F30F1EA03D5
The requested resource (/SpringLogin/welcome.jsp;jsessionid=BEE789093FF79CB6B67F8DA368E8B3E4) is not available.
can you please tell me why it is happening?
PS: I have two projects SpringLogin and both of them had same project names and both had similar packages. Then neither of the projects worked properly and gave the above error. How ever after I created another project with a different name and using different package names, it worked like magic. I am guessing here that it may have been the problem. But what is the logical answer that'll explain what happened there?
you don't have being calling the correct URL
it seems that the context /SpringLogin/ does not exists anymore.
Try /welcome.jsp or if you changed the name of application - try /newappname/welcome.jsp

My Working Application MVC3 Razor Unexplainably stopped working :-( IIS 7

I have the following projects within my solution.
MyWebApplication.Data --> Here i interact with my Data Repository
MyWebApplication.Services --> Here i interact with the Data Layer
MyWebApplication.Web --> The UI which relies on the Service Layer
MyWebApplication.Tests --> Unit testing project
For MONTHS i have had NO problems with IIS in my local dev environment. Ready for a long weekend of programming but all day i have been getting 500 Server Errors when simply trying to resolve the Home page. Before I went to bed all was well, the entire day thereafter i could NOT even load the home/index view.
After looking at the logs it says continually MyWebApplication.Data.System (which is a class i created called System()) does not include Web. But no where in code is this true. Then i get another error of mismatching files in the Temp Directory.
Steps I have taken:
Deleted all temp files
Created a new repository in IIS and pointed URL there, No luck
Cleaned solution
Deleted all bin folders to have regenerated... No Luck
PLEASE HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Without the details of the error messages, one strategy may be to create a new MVC project and copy/paste the files over to it.
A few other common causes:
Are you referencing any 64-bit libraries but compiling the project as 32-bit (or vice-versa)? Try changing the "bitness" of your application.
If your application is 32-bit and is running on a 64-bit server, you need to enable running 32-bit apps in IIS. See http://exhibita.com/blog/post/2010/03/30/IIS-75-on-x64-with-32bit-applications.aspx
If all else fails, please post the exact error messages. If all it says is "HTTP 500: Internal Server Error", you should enable debug output or run your app from the server itself (actually using a web browser on the server), which will tell IIS it's "safe" to display full debug information. The debugging messages have actually been pretty useful in my experience.
Figured it out. In
MyWebApplication.Web project, within the Shared/Site.Master I added a imported a reference to my Data Layer. (i.e., <%# Import Namespace="MyWebApplication.Data" %>
I resolved by removing the static reference to my ShoppingCart class in the Data layer and just created an ActionResult to return the same and in the MasterPage (which currently holds the javsscript to allow the user to peek into their cart from anywhere in the site without a redirect to a specific page) used the Html.RenderAction() and just returned Content(shoppingCartString).
Guess I have learned that within the Site.Master page it is complied differently than every other page in an MVC application. I can positively say this because in other pages I am doing exactly as I attempted to do here without any issues. Maybe its the build process?
Anyhow, problem solved and hopefully it can help someone else too.

Resources