grails run-war no controllers

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

grails run-war no controllers

Uwe Rasmus
Hello,
I'm lost. My application works perfectly, when doing grails run-app.
Now I wanted to build .war and deploy it on server.
Command 'grails war' created .war, I deployed it to the remote server and at the end I have found it has no controllers and no domain classes. (in the default home page listing at left there are zeros at controllers and domain fields and the list of available controllers is empty).
Then I tried 'grails run-war' with the same result on localhost.
I searched through forums and internet and I have found only one note - to test it with grails run-war (which I did) and look at stacktrace.log. This file is empty (0 bytes) in my case.
Can anyone tell me, what is going on?
I looked into the .war, it looks ok, there is web.xml, there is applicationContext.xml, also grails.xml and there are the controllers listed like this <resource>grails-app.controllers.mypackage.BookController</resource> 
The appropriate .class is in WEB-INF/classes/mypackage/BookController.class.

Thank you for support, it must be something obvious and simple, but I don't know what it is.
Uwe
Reply | Threaded
Open this post in threaded view
|

Re: grails run-war no controllers

boriskin
Could it be that you have some environment specific settings?
"grails war" invokes production environment by default whereas "grails run-app" invokes dev environment.
Try running "grails dev war" and see what you get.
Reply | Threaded
Open this post in threaded view
|

Re: grails run-war no controllers

Owen Rubel
In reply to this post by Uwe Rasmus
I've never run across something like this before but on a wild guess, have you checked permissions on your project directory structure? While run-war and run-app require 'read-write-execute' permissions and 'grails war' requires 'read-write' permissions in different directories (specifically the 'target directory').

This might be something as simple as permissions.

You may have an issue with your permissions

On Tue, Jan 11, 2011 at 4:22 PM, Uwe Rasmus <[hidden email]> wrote:

Hello,
I'm lost. My application works perfectly, when doing grails run-app.
Now I wanted to build .war and deploy it on server.
Command 'grails war' created .war, I deployed it to the remote server and at
the end I have found it has no controllers and no domain classes. (in the
default home page listing at left there are zeros at controllers and domain
fields and the list of available controllers is empty).
Then I tried 'grails run-war' with the same result on localhost.
I searched through forums and internet and I have found only one note - to
test it with grails run-war (which I did) and look at stacktrace.log. This
file is empty (0 bytes) in my case.
Can anyone tell me, what is going on?
I looked into the .war, it looks ok, there is web.xml, there is
applicationContext.xml, also grails.xml and there are the controllers listed
like this
<resource>grails-app.controllers.mypackage.BookController</resource>
The appropriate .class is in WEB-INF/classes/mypackage/BookController.class.

Thank you for support, it must be something obvious and simple, but I don't
know what it is.
Uwe
--
View this message in context: http://grails.1312388.n4.nabble.com/grails-run-war-no-controllers-tp3209929p3209929.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: grails run-war no controllers

Uwe Rasmus
Hi,
on local I'm on windows, admin, so I think, it's not issue with permissions?
Reply | Threaded
Open this post in threaded view
|

Re: grails run-war no controllers

Uwe Rasmus
In reply to this post by boriskin
Hi,
I have tried grails dev war, and deploy to the local tomcat, still the same result.

I tried to configure some logging, when comparing grails run-app and tomcat output, I found this:

[main] DEBUG framework.JdkDynamicAopProxy  - Creating JD
K dynamic proxy: target source is HotSwappableTargetSource for target: URL Mappi
ngs
------------
org.codehaus.groovy.grails.web.mapping.ResponseCodeUrlMapping@b6dff
/
/(*)/(*)?/(*)?

That is logged with run-app, however on tomcat output it ends with -----. the ResponseCodeUrlMapping is not there at all.
Could it be the problem? How to solve it?

After modifying the log again, this is what I get with run-app:
Configuring Spring Security ...
[main] DEBUG mapping.DefaultUrlMappingsHolder  - Reverse
 mapping: [DefaultUrlMappingsHolder.UrlMappingKey@1d34eac controller = [null], a
ction = [null], params = set[[empty]]] -> org.codehaus.groovy.grails.web.mapping
.ResponseCodeUrlMapping@1d20651
[main] DEBUG mapping.DefaultUrlMappingsHolder  - Reverse
 mapping: [DefaultUrlMappingsHolder.UrlMappingKey@1e27046 controller = [null], a
ction = [null], params = set[[empty]]] -> /
[main] DEBUG mapping.DefaultUrlMappingsHolder  - Reverse
 mapping: [DefaultUrlMappingsHolder.UrlMappingKey@1391a2c controller = [null], a
ction = [null], params = set['controller']] -> /(*)/(*)?/(*)?
[main] DEBUG mapping.DefaultUrlMappingsHolder  - Reverse
 mapping: [DefaultUrlMappingsHolder.UrlMappingKey@1e54eb7 controller = [null], a
ction = [null], params = set['action', 'controller']] -> /(*)/(*)?/(*)?
[main] DEBUG mapping.DefaultUrlMappingsHolder  - Reverse
 mapping: [DefaultUrlMappingsHolder.UrlMappingKey@1930089 controller = [null], a
ction = [null], params = set['id', 'action', 'controller']] -> /(*)/(*)?/(*)?
[main] DEBUG filter.UrlMappingsFilter  - Initializing filter 'urlMapping'
[main] DEBUG filter.UrlMappingsFilter  - Filter 'urlMapping' configured successfully
Server running. Browse to ...

and this is what I get from (grails dev war and deploy on local tomcat) tomcat output:
Configuring Spring Security ...
[main] DEBUG filter.UrlMappingsFilter  - Initializing filter 'urlMapping'
[main] DEBUG filter.UrlMappingsFilter  - Filter 'urlMapping' configured successfully

Also the .war itself has around 27MB. Isn't it somehow too much? Could it be some classpath issue?
(I just added webflow and spring security (I don't use it at first urls, so this shouldn't be the problem))

Thank you
Uwe
Reply | Threaded
Open this post in threaded view
|

Re: grails run-war no controllers

Uwe Rasmus
In reply to this post by Uwe Rasmus
Hi,
I have found the reason why there is no controllers and domain classes.

The generated grails.xml looks like:
<resource>DefaultSecurityConfig</resource>
    <resource>grails.plugins.springsecurity.SpringSecurityService</resource>
    <resource>grails.plugins.springsecurity.SecurityTagLib</resource>
    <resource>grails-app.conf.BootStrap</resource>
    <resource>grails-app.conf.BuildConfig</resource>
    <resource>grails-app.conf.Config</resource>
    <resource>grails-app.conf.DataSource</resource>
    <resource>grails-app.conf.spring.resources</resource>
    <resource>grails-app.conf.UrlMappings</resource>
    <resource>grails-app.controllers.LoginController</resource>
    <resource>grails-app.controllers.LogoutController</resource>
    <resource>grails-app.controllers.mypackage.BookController</resource>
    <resource>grails-app.domain.ook.Book</resource> 
...

the prefixes grails-app.conf, grails-app.controllers, grails-app.domain are wrong.
I don't know why grails war command generates this. However, when manually edited and removed, the war starts ok and everything is working!

It was visible in logs, after turning on the debug level on commons in conf/Config.groovy

debug  'org.codehaus.groovy.grails.commons' // core / classloading

If anyone knows how to generate the grails.xml right... Is this bug?
version 1.3.5 and (after upgrade) 1.3.6.
Thank you
Uwe
Reply | Threaded
Open this post in threaded view
|

Re: grails run-war no controllers

Gert Wohlgemuth
did anybody ever found a solution for this? I have a similar issues with my grails application.

On Wed, Jan 12, 2011 at 2:34 PM, Uwe Rasmus <[hidden email]> wrote:

Hi,
I have found the reason why there is no controllers and domain classes.

The generated grails.xml looks like:
<resource>DefaultSecurityConfig</resource>
   <resource>grails.plugins.springsecurity.SpringSecurityService</resource>
   <resource>grails.plugins.springsecurity.SecurityTagLib</resource>
   <resource>grails-app.conf.BootStrap</resource>
   <resource>grails-app.conf.BuildConfig</resource>
   <resource>grails-app.conf.Config</resource>
   <resource>grails-app.conf.DataSource</resource>
   <resource>grails-app.conf.spring.resources</resource>
   <resource>grails-app.conf.UrlMappings</resource>
   <resource>grails-app.controllers.LoginController</resource>
   <resource>grails-app.controllers.LogoutController</resource>
   <resource>grails-app.controllers.mypackage.BookController</resource>
   <resource>grails-app.domain.ook.Book</resource>
...

the prefixes grails-app.conf, grails-app.controllers, grails-app.domain are
wrong.
I don't know why grails war command generates this. However, when manually
edited and removed, the war starts ok and everything is working!

It was visible in logs, after turning on the debug level on commons in
conf/Config.groovy

debug  'org.codehaus.groovy.grails.commons' // core / classloading

If anyone knows how to generate the grails.xml right... Is this bug?
version 1.3.5 and (after upgrade) 1.3.6.
Thank you
Uwe

--
View this message in context: http://grails.1312388.n4.nabble.com/grails-run-war-no-controllers-tp3209929p3214925.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
------------------------------------------------------------
Lead Developer - Fiehnlab, UC Davis

gert wohlgemuth
[hidden email]

work:
http://fiehnlab.ucdavis.edu/staff/wohlgemuth

phone:
(530) 383-0974

coding blog
http://codingandmore.blogspot.com

------------------------------------------------------------
you're "a long time dead", as they say
Reply | Threaded
Open this post in threaded view
|

Re: grails run-war no controllers

Jeff Scott Brown
On Fri, Apr 15, 2011 at 12:59 PM, wohlgemuth <[hidden email]> wrote:
> did anybody ever found a solution for this? I have a similar issues with my
> grails application.
>

Are you able to create a simple app that demonstrates this problem?
If yes, please file a JIRA and attach the app.

Thanks.



jb

--
Jeff Brown
SpringSource
http://www.springsource.com/

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: grails run-war no controllers

Gert Wohlgemuth
hi jeff,

sadly not able to. And I think my thing is a seperate issue. I'm writing up some details right now.

thanks,

g.

On Fri, Apr 15, 2011 at 11:12 AM, Jeff Brown <[hidden email]> wrote:
On Fri, Apr 15, 2011 at 12:59 PM, wohlgemuth <[hidden email]> wrote:
> did anybody ever found a solution for this? I have a similar issues with my
> grails application.
>

Are you able to create a simple app that demonstrates this problem?
If yes, please file a JIRA and attach the app.

Thanks.



jb

--
Jeff Brown
SpringSource
http://www.springsource.com/

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
------------------------------------------------------------
Lead Developer - Fiehnlab, UC Davis

gert wohlgemuth
[hidden email]

work:
http://fiehnlab.ucdavis.edu/staff/wohlgemuth

phone:
(530) 383-0974

coding blog
http://codingandmore.blogspot.com

------------------------------------------------------------
you're "a long time dead", as they say
Reply | Threaded
Open this post in threaded view
|

Re: grails run-war no controllers

Uwe Rasmus
Hi,

I'm back to push the old problem. :)
In the last two years, I built war file and everytime after build, I replaced grails.xml in .war with backuped version with correct paths. It was not so often, so it was managable.

Now having upgraded to the newest Grails 2.2.1 and seeing it's still a problem, I decided to fill the issue.
It is here - http://jira.grails.org/browse/GRAILS-9979

The issue has attached a fresh project, with no sources at all - and it's happening.

If you can help me with this issue, please do so. :)

Thank you in advance
Uwe
Reply | Threaded
Open this post in threaded view
|

Re: grails run-war no controllers

Angel Gallegos
Hi I'm sorry to bring back this but I'm having the same issue, did you found a solution to this?