Can't resolve view name

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't resolve view name

bobbywarner

This isn't a bug with Grails as everything works fine on my Mac, but rather just a question (that I'm sure others will encounter too) I have in regards to running Grails 3 Jars on CentOS.

gvm use grails 3.0.0.RC1
grails create-app foobar
grails package
java -jar build/libs/foobar-0.1.jar

This works great on my Mac with Java 8.  However, when I run the exact same Jar (upload and run java -jar foobar-0.1.jar) on a fresh CentOS 7 box with Java 8, the app starts up fine, but always encounters this error when trying to hit the app in the browser:

ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[grailsDispatcherServlet] - Servlet.service() for servlet [grailsDispatcherServlet] in context with path [] threw exception [Could not resolve view with name '/index' in servlet with name 'grailsDispatcherServlet'] with root cause

I've tried creating controllers/views too and the same exception happens.  I can run a regular Spring Boot app with "java -jar" with no problems on the same Centos box.  I assuming I will need to change something in how Grails 3 runs these Jars with Tomcat embedded compared to Spring Boot, but not sure exactly where to start.  Please let me know if you have any thoughts as to how I could fix this in Grails 3.


Thanks,
Bobby

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/03988a48-45db-4498-a9dc-8c2d548f8b0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can't resolve view name

Eric Helgeson
I was able to reproduce this issue as well coping the jar to any other machine and any other platform than what it was built on.

I built the jar the same way (on a Mac) and copied it to another Mac, Windows 7, CentOS 6 and 7, and all gave an error running it. Though running the same jar where it was built did not. (all on java 8). Also verified going from centos6 to mac, same issue.

Running `java -jar foobar-0.1.war` worked on different platforms, which is odd since I would think the war would not include any tomcat libs.

Also it looks like users are giving multiple ways to package, `grails package`, `gradle war`, `gradle jar`, `gradle bootRepackage`. This may be confusing to a new user since grails create app doesnt create a ./grailsw (so sharing the code base with other users would only see ./gradlew and those tasks).

Oddly trying ./gradlew bootRepackage it DOES produce a jar that would runs on systems other than the one it was built on.

Finally I did get 1 jar to work across machines but assets did not work (css/img/js), though I didn't change anything (using grails package) and am unable to reproduce.

Diff of unziped jar/war:
$ diff -rt jar war
Only in jar: BootStrap$_closure1.class
Only in jar: BootStrap$_closure2.class
Only in jar: BootStrap.class
diff -rt jar/META-INF/MANIFEST.MF war/META-INF/MANIFEST.MF
4c4
< Main-Class: org.springframework.boot.loader.JarLauncher
---
> Main-Class: org.springframework.boot.loader.WarLauncher
Only in jar: UrlMappings$__clinit__closure1$_closure2$_closure3.class
Only in jar: UrlMappings$__clinit__closure1$_closure2.class
Only in jar: UrlMappings$__clinit__closure1.class
Only in jar: UrlMappings.class
Only in war: WEB-INF
Only in jar: application.yml
Only in war: assets
Only in jar: error.gsp
Only in jar: index.gsp
Only in jar: layouts
Only in jar: lib
Only in jar: logback.groovy
Only in jar: messages.properties
Only in jar: messages_cs_CZ.properties
Only in jar: messages_da.properties
Only in jar: messages_de.properties
Only in jar: messages_es.properties
Only in jar: messages_fr.properties
Only in jar: messages_it.properties
Only in jar: messages_ja.properties
Only in jar: messages_nb.properties
Only in jar: messages_nl.properties
Only in jar: messages_pl.properties
Only in jar: messages_pt_BR.properties
Only in jar: messages_pt_PT.properties
Only in jar: messages_ru.properties
Only in jar: messages_sv.properties
Only in jar: messages_th.properties
Only in jar: messages_zh_CN.properties
Only in jar: notFound.gsp
Only in jar: spring
Only in jar: testapp


On Thursday, March 12, 2015 at 11:52:48 AM UTC-5, Bobby Warner wrote:

This isn't a bug with Grails as everything works fine on my Mac, but rather just a question (that I'm sure others will encounter too) I have in regards to running Grails 3 Jars on CentOS.

gvm use grails 3.0.0.RC1
grails create-app foobar
grails package
java -jar build/libs/foobar-0.1.jar

This works great on my Mac with Java 8.  However, when I run the exact same Jar (upload and run java -jar foobar-0.1.jar) on a fresh CentOS 7 box with Java 8, the app starts up fine, but always encounters this error when trying to hit the app in the browser:

ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[grailsDispatcherServlet] - Servlet.service() for servlet [grailsDispatcherServlet] in context with path [] threw exception [Could not resolve view with name '/index' in servlet with name 'grailsDispatcherServlet'] with root cause

I've tried creating controllers/views too and the same exception happens.  I can run a regular Spring Boot app with "java -jar" with no problems on the same Centos box.  I assuming I will need to change something in how Grails 3 runs these Jars with Tomcat embedded compared to Spring Boot, but not sure exactly where to start.  Please let me know if you have any thoughts as to how I could fix this in Grails 3.


Thanks,
Bobby

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/d3a6137c-3919-497c-8e3e-5c9196b6ddcd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can't resolve view name

Graeme Rocher-2
Please report an issue with steps to reproduce 

On Monday, March 16, 2015, Eric Helgeson <[hidden email]> wrote:
I was able to reproduce this issue as well coping the jar to any other machine and any other platform than what it was built on.

I built the jar the same way (on a Mac) and copied it to another Mac, Windows 7, CentOS 6 and 7, and all gave an error running it. Though running the same jar where it was built did not. (all on java 8). Also verified going from centos6 to mac, same issue.

Running `java -jar foobar-0.1.war` worked on different platforms, which is odd since I would think the war would not include any tomcat libs.

Also it looks like users are giving multiple ways to package, `grails package`, `gradle war`, `gradle jar`, `gradle bootRepackage`. This may be confusing to a new user since grails create app doesnt create a ./grailsw (so sharing the code base with other users would only see ./gradlew and those tasks).

Oddly trying ./gradlew bootRepackage it DOES produce a jar that would runs on systems other than the one it was built on.

Finally I did get 1 jar to work across machines but assets did not work (css/img/js), though I didn't change anything (using grails package) and am unable to reproduce.

Diff of unziped jar/war:
$ diff -rt jar war
Only in jar: BootStrap$_closure1.class
Only in jar: BootStrap$_closure2.class
Only in jar: BootStrap.class
diff -rt jar/META-INF/MANIFEST.MF war/META-INF/MANIFEST.MF
4c4
< Main-Class: org.springframework.boot.loader.JarLauncher
---
> Main-Class: org.springframework.boot.loader.WarLauncher
Only in jar: UrlMappings$__clinit__closure1$_closure2$_closure3.class
Only in jar: UrlMappings$__clinit__closure1$_closure2.class
Only in jar: UrlMappings$__clinit__closure1.class
Only in jar: UrlMappings.class
Only in war: WEB-INF
Only in jar: application.yml
Only in war: assets
Only in jar: error.gsp
Only in jar: index.gsp
Only in jar: layouts
Only in jar: lib
Only in jar: logback.groovy
Only in jar: messages.properties
Only in jar: messages_cs_CZ.properties
Only in jar: messages_da.properties
Only in jar: messages_de.properties
Only in jar: messages_es.properties
Only in jar: messages_fr.properties
Only in jar: messages_it.properties
Only in jar: messages_ja.properties
Only in jar: messages_nb.properties
Only in jar: messages_nl.properties
Only in jar: messages_pl.properties
Only in jar: messages_pt_BR.properties
Only in jar: messages_pt_PT.properties
Only in jar: messages_ru.properties
Only in jar: messages_sv.properties
Only in jar: messages_th.properties
Only in jar: messages_zh_CN.properties
Only in jar: notFound.gsp
Only in jar: spring
Only in jar: testapp


On Thursday, March 12, 2015 at 11:52:48 AM UTC-5, Bobby Warner wrote:

This isn't a bug with Grails as everything works fine on my Mac, but rather just a question (that I'm sure others will encounter too) I have in regards to running Grails 3 Jars on CentOS.

gvm use grails 3.0.0.RC1
grails create-app foobar
grails package
java -jar build/libs/foobar-0.1.jar

This works great on my Mac with Java 8.  However, when I run the exact same Jar (upload and run java -jar foobar-0.1.jar) on a fresh CentOS 7 box with Java 8, the app starts up fine, but always encounters this error when trying to hit the app in the browser:

ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[grailsDispatcherServlet] - Servlet.service() for servlet [grailsDispatcherServlet] in context with path [] threw exception [Could not resolve view with name '/index' in servlet with name 'grailsDispatcherServlet'] with root cause

I've tried creating controllers/views too and the same exception happens.  I can run a regular Spring Boot app with "java -jar" with no problems on the same Centos box.  I assuming I will need to change something in how Grails 3 runs these Jars with Tomcat embedded compared to Spring Boot, but not sure exactly where to start.  Please let me know if you have any thoughts as to how I could fix this in Grails 3.


Thanks,
Bobby

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;grails-dev-discuss%2Bunsubscribe@googlegroups.com&#39;);" target="_blank">grails-dev-discuss+unsubscribe@....
To post to this group, send email to <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;grails-dev-discuss@googlegroups.com&#39;);" target="_blank">grails-dev-discuss@....
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/d3a6137c-3919-497c-8e3e-5c9196b6ddcd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Graeme Rocher

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CAO_wNodQ19F3bY29Lq1NH0aTgBU88wYKGJW2QpvEFiDtzt8y0w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.