gr8crm / gr8crm-web

Demo that shows how to use GR8 CRM plugins to serve HTML pages for a web site
5 stars 3 forks source link

Does not start.. #1

Closed jakobklein closed 10 years ago

jakobklein commented 10 years ago

I would love to take a look, but I get the stacktrace below during startup: (same with Grails 2.3.7 and 2.2.4) (this demo works fine for me (with 2.2.4): https://github.com/technipelago/gr8crm-demo-app)

Error | 2014-08-28 16:19:22,212 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: org.apache.shiro.subject.ExecutionException: grails.validation.ValidationException: Validation Error(s) occurred during save():

Message: org.apache.shiro.subject.ExecutionException: grails.validation.ValidationException: Validation Error(s) occurred during save():

Caused by ExecutionException: grails.validation.ValidationException: Validation Error(s) occurred during save():

->> 382 | execute in org.apache.shiro.subject.support.DelegatingSubject


| 72 | runAs in grails.plugins.crm.security.shiro.ShiroSecurityDelegate | 99 | runAs . . . . . . . . . . . . . in grails.plugins.crm.security.CrmSecurityService | 23 | doCall in BootStrap$_closure1_closure3 | 90 | doCall . . . . . . . . . . . . . in org.apache.shiro.subject.support.SubjectCallable | 83 | call in '' | 380 | execute . . . . . . . . . . . . in org.apache.shiro.subject.support.DelegatingSubject | 72 | runAs in grails.plugins.crm.security.shiro.ShiroSecurityDelegate | 79 | runAs . . . . . . . . . . . . . in grails.plugins.crm.security.CrmSecurityService | 20 | doCall in BootStrap$_closure1 | 308 | evaluateEnvironmentSpecificBlock in grails.util.Environment | 301 | executeForEnvironment in '' | 277 | executeForCurrentEnvironment . . in '' | 262 | run in java.util.concurrent.FutureTask | 1145 | runWorker . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor | 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker ^ 745 | run . . . . . . . . . . . . . . in java.lang.Thread

Caused by ValidationException: Validation Error(s) occurred during save():

->> 708 | createFolder in grails.plugins.crm.content.CrmContentService


| 721 | createFolders in '' | 68 | importFiles . . . . . . . . . . in grails.plugins.crm.content.CrmContentImportService | 30 | doCall in BootStrap$_closure1_closure3_closure4 | 49 | withTenant . . . . . . . . . . . in grails.plugins.crm.core.TenantUtils | 100 | doCall in grails.plugins.crm.security.CrmSecurityService$_runAs_closure3 | 90 | doCall . . . . . . . . . . . . . in org.apache.shiro.subject.support.SubjectCallable | 83 | call in '' | 380 | execute . . . . . . . . . . . . in org.apache.shiro.subject.support.DelegatingSubject | 72 | runAs in grails.plugins.crm.security.shiro.ShiroSecurityDelegate | 99 | runAs . . . . . . . . . . . . . in grails.plugins.crm.security.CrmSecurityService | 23 | doCall in BootStrap$_closure1_closure3 | 90 | doCall . . . . . . . . . . . . . in org.apache.shiro.subject.support.SubjectCallable | 83 | call in '' | 380 | execute . . . . . . . . . . . . in org.apache.shiro.subject.support.DelegatingSubject | 72 | runAs in grails.plugins.crm.security.shiro.ShiroSecurityDelegate | 79 | runAs . . . . . . . . . . . . . in grails.plugins.crm.security.CrmSecurityService | 20 | doCall in BootStrap$_closure1 | 308 | evaluateEnvironmentSpecificBlock in grails.util.Environment | 301 | executeForEnvironment in '' | 277 | executeForCurrentEnvironment . . in '' | 262 | run in java.util.concurrent.FutureTask | 1145 | runWorker . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor | 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker ^ 745 | run . . . . . . . . . . . . . . in java.lang.Thread

goeh commented 10 years ago

Are you running on Windows? Maybe there is some path related problem when it tries to load html pages from src/templates. I will see if I can find a windows machine to test on...

goeh commented 10 years ago

Yes, it looks like this code has never been tested on Windows. The forward slash here https://github.com/technipelago/grails-crm-content/blob/master/grails-app/services/grails/plugins/crm/content/CrmContentImportService.groovy#L65 must be replaced with something more platform independent. I can fix it in a few hours (tonight) and release a new version of crm-content plugin. Sorry for this.

goeh commented 10 years ago

I have no Windows PC to test on but I hope I have fixed the problem. Can you add the following to the plugins-section of your BuildConfig.groovy

compile ":crm-content:2.0.1"

That should download the fixed version of crm-content. Then try to start your application again.

Fixed by https://github.com/technipelago/grails-crm-content/commit/d867c3e052db054229f2702941344e7eb225a2f6

jakobklein commented 10 years ago

Thx for the quick help. It took me a step further but now I get:

Error | 2014-08-29 08:06:18,707 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: Cannot invoke method registerItem() on null object Message: Cannot invoke method registerItem() on null object Line | Method ->> 11 | doCall in BootStrap$_closure1


| 308 | evaluateEnvironmentSpecificBlock in grails.util.Environment | 301 | executeForEnvironment . . . . . in '' | 277 | executeForCurrentEnvironment in '' | 262 | run . . . . . . . . . . . . . . in java.util.concurrent.FutureTask | 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor | 615 | run . . . . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker ^ 745 | run in java.lang.Thread

Disconnected from the target VM, address: '127.0.0.1:50477', transport: 'socket'

Process finished with exit code 1

goeh commented 10 years ago

That's strange, you're missing the dependency on navigation plugin. But that plugin should be included automatically by crm-ui-bootstrap that are included by crm-content-ui.

Try to add this line to your BuildConfig.groovy (plugins section):

compile ":navigation:1.3.2"

That should force it to include navigation. (but you should really not have to do this if Grails dependency management works as expected)

jakobklein commented 10 years ago

Sorry, this was my fault. But thanks to your explanation I could figure it out: while adding ":crm-content:2.0.1" I've overridden ":crm-content-ui:2.0.0"

Fixed this plugins { build ":tomcat:$grailsVersion" runtime ":hibernate:$grailsVersion"

    compile ":jquery:1.10.2"
    compile ":resources:1.2.7"
    compile ":twitter-bootstrap:2.3.2"
    compile ":less-resources:1.3.3.2"

    compile ':cache:1.1.1'

    compile ":crm-security-shiro:2.0.0"
    compile ":crm-i18n:2.0.0"
    compile ":crm-content-ui:2.0.0"
    compile ":crm-content:2.0.1"
}

and still got stuck with the first error.

goeh commented 10 years ago

Ok, thank you for putting attention on these Windows problems.

Are you sure you are using version 2.0.1 of crm-content? You can look in %HOME%.grails\2.2.4\projects\gr8crm-web\plugins to see what plugin versions the application really are using.

I will get hold of a Windows PC this weekend and debug this.

jakobklein commented 10 years ago

It seems that Ivy is handling my dependencies. .\ivy-cache\org.grails.plugins holds both versions So I deleted everything related to crm-content:2.0.0 from the cache but still got the same problem.

goeh commented 10 years ago

That's the ivy-cache, it's not the same as your grails application "work" directory. Here are the contents of $HOME/.grails/2.2.4/projects/gr8crm-web/plugins on my Mac: This is the location where Grails stores all plugins it downloads for an application (in this case gr8crm-web).

cache-1.1.1 ckeditor-4.4.1.0 content-buffer-1.0.1 crm-content-2.0.1 crm-content-ui-2.0.0 crm-core-2.0.2 crm-feature-2.0.0 crm-i18n-2.0.0 crm-security-2.0.0 crm-security-shiro-2.0.0 crm-tags-2.0.0 crm-ui-bootstrap-2.0.0 decorator-1.1 famfamfam-1.0.1 fields-1.3 hibernate-2.2.4 jquery-1.10.2 less-resources-1.3.3.2 navigation-1.3.2 platform-core-1.0.0 recent-domain-0.6.0 resources-1.2.7 selection-0.9.7 shiro-1.1.4 simple-captcha-0.8.5 tomcat-2.2.4 twitter-bootstrap-2.3.2 user-tag-0.6 webxml-1.4.1

jakobklein commented 10 years ago

It's not listed here $HOME/.grails/2.2.4/projects or in any other grails-versions-subfolder.

goeh commented 10 years ago

Ok, see if you find them in your Grails application's "target" folder.

jakobklein commented 10 years ago

ok, found it. Exactly the content you as you listed it. Same version numbers.

goeh commented 10 years ago

Great! Thanks. Then is must be something windows/path related. I will debug this weekend. Thanks for your patience.

jakobklein commented 10 years ago

No problem. Thanks for the support. Looking forward to see it up and running.

goeh commented 10 years ago

Can you please upgrade to crm-content 2.0.2 and test again. All tests are now passing on my Windows PC.

jakobklein commented 10 years ago

Great, now it works! Thanks for your help, Jakob

Am 07.09.2014 22:27, schrieb Goran Ehrsson:

Can you please upgrade to crm-content 2.0.2 and test again. All tests are now passing on my Windows PC.

— Reply to this email directly or view it on GitHub https://github.com/gr8crm/gr8crm-web/issues/1#issuecomment-54759406.

Jakob Klein

IT-Beratung / Software-Entwicklung Lengmoos 27 83536 Gars am Inn +49 (0)8072 9587550 www.jakobklein.com

goeh commented 10 years ago

Awesome! Thank you for the feedback.