5

I'm beginning grails development with IntelliJ but just cannot make and deploy a newly created grails app to a local or external Tomcat following the procedure described in this answer

The manager app in Tomcat shows that the application is up and running but I always get http 404 when opening the index page. I noticed that it's possible to download the index.gsp file - it just seems that grails isn't initialized correctly:

enter image description here

These are the versions I tried:

  • IntelliJ IDEA 12.1.6 Ultimate
  • Grails 2.1.1, 2.2.4 and 2.3.2
  • Tomcat 7.0.47 and 6.

These are the detailed steps I took several times, even on different computers, always with same result:

  • create a new grails app in IntelliJ and launch default run configuration (grails) - so far that's working fine.

  • set up deployment to a local Tomcat server. I've configured the application server in IntelliJ, creating an artifact (Web Application: Archive or Web Application: Exploded) using the GrailsWeb facet and assigned it to be deployed.

  • start the local application server and IntelliJ would report that the artifact is deployed successfully

  • opening the browser will give 404

WHY? What am I doing wrong?

It must be something about the grails plugin in IntelliJ, because I was able to pull an example Java application (spring-petclinic) from github and simply run it in Tomcat without trouble...

Update:

I've noticed that I can manually deploy the war which is generated under target using "Make Grails Web archive". But when I do the same with the war of the artifact under out/... it won't work.

Obviously the latter one wasn't generated correctly: its missing MANIFEST.MF under META-INF and there's also no grails.xml and grails-app under WEB-INF!

directory comparison

Could you please have a look at the facets: Is there something wrong?

IntelliJ project structure

I tried many artifact configurations, e.g. this one:

Artifact configuration

Directory structure generated using the settings above:

Comparing this to the war file generated by grails shows many differences, e.g. the index.gsp is located in the root, not under WEB-INF/grails-app. And there's also no grails.xml under WEB-INF

C:\prj\gtest5\out\artifacts\gtest5_war_exploded>tree /f
Auflistung der Ordnerpfade
Volumeseriennummer : 2842-D2F0
C:.
│   error.gsp
│   index.gsp
│
├───css
│       errors.css
│       main.css
│       mobile.css
│
├───dbdoc
│       _globalnav.gsp
│       _index.gsp
│       _overview-summary.gsp
│       _stylesheet.gsp
│
├───images
│   │   apple-touch-icon-retina.png
│   │   apple-touch-icon.png
│   │   favicon.ico
│   │   grails_logo.jpg
│   │   grails_logo.png
│   │   leftnav_btm.png
│   │   leftnav_midstretch.png
│   │   leftnav_top.png
│   │   spinner.gif
│   │   springsource.png
│   │
│   └───skin
│           database_add.png
│           database_delete.png
│           database_edit.png
│           database_save.png
│           database_table.png
│           exclamation.png
│           house.png
│           information.png
│           shadow.jpg
│           sorted_asc.gif
│           sorted_desc.gif
│
├───js
│   │   application.js
│   │
│   └───jquery
│           jquery-1.8.0.js
│           jquery-1.8.0.min.js
│
├───layouts
│       main.gsp
│
└───WEB-INF
    │   applicationContext.xml
    │   sitemesh.xml
    │
    ├───classes
    │   │   JQueryResourceTagLib$_closure1.class
    │   │   JQueryResourceTagLib$_closure2.class
    │   │   JQueryResourceTagLib$_closure2_closure4.class
    │   │   JQueryResourceTagLib$_closure2_closure5.class
    │   │   JQueryResourceTagLib$_closure2_closure6.class
    │   │   JQueryResourceTagLib$_closure2_closure7.class
    │   │   JQueryResourceTagLib$_closure3.class
    │   │   JQueryResourceTagLib.class
    │   │   JQueryService$_closure1.class
    │   │   JQueryService$_closure2.class
    │   │   JQueryService$_closure3.class
    │   │   JQueryService$_closure4.class
    │   │   JQueryService.class
    │   │   JQueryTagLib$_closure1.class
    │   │   JQueryTagLib$_closure1_closure6.class
    │   │   JQueryTagLib$_closure2.class
    │   │   JQueryTagLib$_closure3.class
    │   │   JQueryTagLib$_closure4.class
    │   │   JQueryTagLib$_closure5.class
    │   │   JQueryTagLib.class
    │   │   messages.properties
    │   │   messages_cs_CZ.properties
    │   │   messages_da.properties
    │   │   messages_de.properties
    │   │   messages_es.properties
    │   │   messages_fr.properties
    │   │   messages_it.properties
    │   │   messages_ja.properties
    │   │   messages_nl.properties
    │   │   messages_pl.properties
    │   │   messages_pt_BR.properties
    │   │   messages_pt_PT.properties
    │   │   messages_ru.properties
    │   │   messages_sv.properties
    │   │   messages_th.properties
    │   │   messages_zh_CN.properties
    │   │
    │   ├───grails
    │   │   └───plugin
    │   │       ├───cache
    │   │       │   │   BlockingCache.class
    │   │       │   │   Cacheable.class
    │   │       │   │   CacheBeanPostProcessor.class
    │   │       │   │   CacheConfigArtefactHandler$CacheConfigGrailsClass.class
    │   │       │   │   CacheConfigArtefactHandler$DefaultCacheConfigGrailsClass.class
    │   │       │   │   CacheConfigArtefactHandler.class
    │   │       │   │   CacheConfiguration.class
    │   │       │   │   CacheEvict.class
    │   │       │   │   CachePut.class
    │   │       │   │   CacheTagLib$_closure1.class
    │   │       │   │   CacheTagLib$_closure2.class
    │   │       │   │   CacheTagLib.class
    │   │       │   │   ConfigBuilder.class
    │   │       │   │   ConfigLoader$_sortConfigs_closure1.class
    │   │       │   │   ConfigLoader.class
    │   │       │   │   GrailsAnnotationCacheOperationSource$DefaultCacheKey.class
    │   │       │   │   GrailsAnnotationCacheOperationSource.class
    │   │       │   │   GrailsCache.class
    │   │       │   │   GrailsCacheAdminService.class
    │   │       │   │   GrailsCacheManager.class
    │   │       │   │   GrailsConcurrentMapCache.class
    │   │       │   │   GrailsConcurrentMapCacheManager.class
    │   │       │   │   GrailsValueWrapper.class
    │   │       │   │   SerializableByteArrayOutputStream.class
    │   │       │   │   SerializableOutputStream.class
    │   │       │   │   Timer.class
    │   │       │   │
    │   │       │   ├───compiler
    │   │       │   │       CacheTransformation.class
    │   │       │   │
    │   │       │   ├───util
    │   │       │   │       ClassUtils.class
    │   │       │   │
    │   │       │   └───web
    │   │       │       │   AlreadyGzippedException.class
    │   │       │       │   ContentCacheParameters.class
    │   │       │       │   GenericResponseWrapper$1.class
    │   │       │       │   GenericResponseWrapper.class
    │   │       │       │   Header$Type.class
    │   │       │       │   Header.class
    │   │       │       │   HttpDateFormatter.class
    │   │       │       │   PageInfo.class
    │   │       │       │   ProxyAwareMixedGrailsControllerHelper.class
    │   │       │       │   SerializableCookie.class
    │   │       │       │
    │   │       │       └───filter
    │   │       │           │   AbstractFilter.class
    │   │       │           │   CacheExpressionRootObject.class
    │   │       │           │   CacheOperationContext.class
    │   │       │           │   DefaultWebKeyGenerator.class
    │   │       │           │   ExpressionEvaluator.class
    │   │       │           │   FilterServletOutputStream.class
    │   │       │           │   LazyParamAwareEvaluationContext.class
    │   │       │           │   NoOpFilter.class
    │   │       │           │   PageFragmentCachingFilter$1.class
    │   │       │           │   PageFragmentCachingFilter$2.class
    │   │       │           │   PageFragmentCachingFilter$CacheStatus.class
    │   │       │           │   PageFragmentCachingFilter.class
    │   │       │           │   WebKeyGenerator.class
    │   │       │           │
    │   │       │           └───simple
    │   │       │                   MemoryBlockingCache.class
    │   │       │                   MemoryCacheConfiguration.class
    │   │       │                   MemoryPageFragmentCachingFilter.class
    │   │       │
    │   │       ├───databasemigration
    │   │       │   │   ChangelogXml2Groovy$_appendAttrs_closure1.class
    │   │       │   │   ChangelogXml2Groovy$_appendWithIndent_closure2.class
    │   │       │   │   ChangelogXml2Groovy.class
    │   │       │   │   DbdocController$_closure1.class
    │   │       │   │   DbdocController.class
    │   │       │   │   DslBuilder$1.class
    │   │       │   │   DslBuilder$_expandExpressions_closure1.class
    │   │       │   │   DslBuilder$_extractZipFile_closure3.class
    │   │       │   │   DslBuilder$_handleIncludedChangeLog_closure7.class
    │   │       │   │   DslBuilder$_processIncludeAll_closure2.class
    │   │       │   │   DslBuilder$_processProperty_closure5.class
    │   │       │   │   DslBuilder$_processRollback_closure4.class
    │   │       │   │   DslBuilder$_setPropertiesFromAttributes_closure6.class
    │   │       │   │   DslBuilder.class
    │   │       │   │   GormDatabase.class
    │   │       │   │   GormDatabaseSnapshotGenerator$_createIdentifierGenerator_closure4.class
    │   │       │   │   GormDatabaseSnapshotGenerator$_createSnapshot_closure1.class
    │   │       │   │   GormDatabaseSnapshotGenerator$_createSnapshot_closure2.class
    │   │       │   │   GormDatabaseSnapshotGenerator$_isIdentityColumn_closure3.class
    │   │       │   │   GormDatabaseSnapshotGenerator.class
    │   │       │   │   GormDatabaseTypeConverter.class
    │   │       │   │   GrailsChange$1.class
    │   │       │   │   GrailsChange.class
    │   │       │   │   GrailsChangeLogParser$_setChangelogProperties_closure1.class
    │   │       │   │   GrailsChangeLogParser.class
    │   │       │   │   GrailsClassLoaderResourceAccessor.class
    │   │       │   │   GrailsDiffStatusListener.class
    │   │       │   │   GrailsPrecondition$1.class
    │   │       │   │   GrailsPrecondition.class
    │   │       │   │   GroovyAwareStringChangeLogSerializer.class
    │   │       │   │   Log4jLogger.class
    │   │       │   │   MigrationRunner$_autoRun_closure1.class
    │   │       │   │   MigrationRunner.class
    │   │       │   │   MigrationUtils$_getDatabase_closure1.class
    │   │       │   │   MigrationUtils.class
    │   │       │   │   MysqlAwareCreateTableGenerator.class
    │   │       │   │   ScriptUtils$_appendToChangelog_closure2.class
    │   │       │   │   ScriptUtils$_appendToChangelog_closure2_closure3.class
    │   │       │   │   ScriptUtils$_appendToChangelog_closure2_closure4.class
    │   │       │   │   ScriptUtils$_executeAndWrite_closure1.class
    │   │       │   │   ScriptUtils.class
    │   │       │   │
    │   │       │   └───dbdoc
    │   │       │           AuthorListWriter.class
    │   │       │           AuthorWriter.class
    │   │       │           ChangeLogListWriter.class
    │   │       │           ChangeLogWriter.class
    │   │       │           ColumnWriter.class
    │   │       │           HTMLListWriter.class
    │   │       │           HTMLWriter.class
    │   │       │           MemoryDocVisitor.class
    │   │       │           PendingChangesWriter.class
    │   │       │           PendingSQLWriter.class
    │   │       │           RecentChangesWriter.class
    │   │       │           TableListWriter.class
    │   │       │           TableWriter$_writeCustomHTML_closure1.class
    │   │       │           TableWriter.class
    │   │       │
    │   │       └───webxml
    │   │               FilterManager.class
    │   │
    │   └───org
    │       ├───codehaus
    │       │   └───groovy
    │       │       └───grails
    │       │           └───plugins
    │       │               └───jquery
    │       │                       JQueryConfig$_init_closure1.class
    │       │                       JQueryConfig$_init_closure2.class
    │       │                       JQueryConfig.class
    │       │                       JQueryProvider$_doRemoteFunction_closure1.class
    │       │                       JQueryProvider$_doRemoteFunction_closure2.class
    │       │                       JQueryProvider$_doRemoteFunction_closure3.class
    │       │                       JQueryProvider$_doRemoteFunction_closure4.class
    │       │                       JQueryProvider.class
    │       │
    │       └───grails
    │           └───plugin
    │               ├───resource
    │               │   │   AggregatedResourceMeta$_buildAggregateResource_closure3.class
    │               │   │   AggregatedResourceMeta$_buildAggregateResource_closure3_closure4.class
    │               │   │   AggregatedResourceMeta$_containsResource_closure1.class
    │               │   │   AggregatedResourceMeta$_isDirty_closure2.class
    │               │   │   AggregatedResourceMeta.class
    │               │   │   CSSBundleResourceMeta.class
    │               │   │   CSSLinkProcessor$_process_closure1.class
    │               │   │   CSSLinkProcessor.class
    │               │   │   DevModeSanityFilter.class
    │               │   │   JavaScriptBundleResourceMeta.class
    │               │   │   ProcessingFilter.class
    │               │   │   ResourceMeta$_reset_closure1.class
    │               │   │   ResourceMeta.class
    │               │   │   ResourceModule$_closure1.class
    │               │   │   ResourceModule$_getRequiredDispositions_closure3.class
    │               │   │   ResourceModule$_newResourceFromArgs_closure2.class
    │               │   │   ResourceModule.class
    │               │   │   ResourceProcessor$_afterPropertiesSet_closure5.class
    │               │   │   ResourceProcessor$_afterPropertiesSet_closure6.class
    │               │   │   ResourceProcessor$_canProcessLegacyResource_closure7.class
    │               │   │   ResourceProcessor$_canProcessLegacyResource_closure8.class
    │               │   │   ResourceProcessor$_defineModuleFromBuilder_closure16.class
    │               │   │   ResourceProcessor$_dumpResources_closure21.class
    │               │   │   ResourceProcessor$_dumpResources_closure21_closure35.class
    │               │   │   ResourceProcessor$_dumpResources_closure21_closure36.class
    │               │   │   ResourceProcessor$_dumpResources_closure22.class
    │               │   │   ResourceProcessor$_dumpStats_closure20.class
    │               │   │   ResourceProcessor$_dumpStats_closure20_closure34.class
    │               │   │   ResourceProcessor$_findSyntheticResourceById_closure9.class
    │               │   │   ResourceProcessor$_getConfigParamOrDefault_closure23.class
    │               │   │   ResourceProcessor$_getResourceMetaForURI_closure10.class
    │               │   │   ResourceProcessor$_getResourceMetaForURI_closure10_closure27.class
    │               │   │   ResourceProcessor$_getServletContext_closure24.class
    │               │   │   ResourceProcessor$_loadModules_closure17.class
    │               │   │   ResourceProcessor$_loadModules_closure18.class
    │               │   │   ResourceProcessor$_loadModules_closure18_closure30.class
    │               │   │   ResourceProcessor$_loadModules_closure18_closure31.class
    │               │   │   ResourceProcessor$_loadModules_closure18_closure31_closure32.class
    │               │   │   ResourceProcessor$_loadModules_closure18_closure31_closure33.class
    │               │   │   ResourceProcessor$_loadModules_closure19.class
    │               │   │   ResourceProcessor$_makeFileSystemPathFromURI_closure11.class
    │               │   │   ResourceProcessor$_prepareResourceBatch_closure13.class
    │               │   │   ResourceProcessor$_prepareResourceBatch_closure14.class
    │               │   │   ResourceProcessor$_prepareResourceBatch_closure14_closure28.class
    │               │   │   ResourceProcessor$_prepareResourceBatch_closure14_closure29.class
    │               │   │   ResourceProcessor$_prepareResourceBatch_closure15.class
    │               │   │   ResourceProcessor$_prepareSingleDeclaredResource_closure12.class
    │               │   │   ResourceProcessor$_updateDependencyOrder_closure1.class
    │               │   │   ResourceProcessor$_updateDependencyOrder_closure2.class
    │               │   │   ResourceProcessor$_updateDependencyOrder_closure3.class
    │               │   │   ResourceProcessor$_updateDependencyOrder_closure3_closure25.class
    │               │   │   ResourceProcessor$_updateDependencyOrder_closure4.class
    │               │   │   ResourceProcessor$_updateDependencyOrder_closure4_closure26.class
    │               │   │   ResourceProcessor.class
    │               │   │   ResourceProcessorBatch.class
    │               │   │   ResourceTagLib$_closure1.class
    │               │   │   ResourceTagLib$_closure10.class
    │               │   │   ResourceTagLib$_closure10_closure17.class
    │               │   │   ResourceTagLib$_closure1_closure15.class
    │               │   │   ResourceTagLib$_closure2.class
    │               │   │   ResourceTagLib$_closure3.class
    │               │   │   ResourceTagLib$_closure4.class
    │               │   │   ResourceTagLib$_closure5.class
    │               │   │   ResourceTagLib$_closure5_closure16.class
    │               │   │   ResourceTagLib$_closure6.class
    │               │   │   ResourceTagLib$_closure7.class
    │               │   │   ResourceTagLib$_closure8.class
    │               │   │   ResourceTagLib$_closure9.class
    │               │   │   ResourceTagLib$_resolveResourceAndURI_closure12.class
    │               │   │   ResourceTagLib$_writeAttrs_closure11.class
    │               │   │   ResourceTagLib$__clinit__closure13.class
    │               │   │   ResourceTagLib$__clinit__closure14.class
    │               │   │   ResourceTagLib.class
    │               │   │   URLUtils.class
    │               │   │
    │               │   ├───mapper
    │               │   │       MapperPhase.class
    │               │   │       ResourceMapper$_closure1.class
    │               │   │       ResourceMapper$_getDefaultExcludes_closure8.class
    │               │   │       ResourceMapper$_getDefaultIncludes_closure9.class
    │               │   │       ResourceMapper$_getExcludes_closure10.class
    │               │   │       ResourceMapper$_getExcludingPattern_closure2.class
    │               │   │       ResourceMapper$_getIncludes_closure11.class
    │               │   │       ResourceMapper$_getIncludingPattern_closure3.class
    │               │   │       ResourceMapper$_getName_closure7.class
    │               │   │       ResourceMapper$_getOperation_closure5.class
    │               │   │       ResourceMapper$_getPhase_closure4.class
    │               │   │       ResourceMapper$_getPriority_closure6.class
    │               │   │       ResourceMapper.class
    │               │   │       ResourceMappersFactory$_createResourceMappers_closure1.class
    │               │   │       ResourceMappersFactory$_createResourceMappers_closure2.class
    │               │   │       ResourceMappersFactory$_createResourceMappers_closure2_closure7.class
    │               │   │       ResourceMappersFactory$_createResourceMappers_closure3.class
    │               │   │       ResourceMappersFactory$_createResourceMappers_closure4.class
    │               │   │       ResourceMappersFactory$_createResourceMappers_closure5.class
    │               │   │       ResourceMappersFactory$_createResourceMappers_closure6.class
    │               │   │       ResourceMappersFactory.class
    │               │   │
    │               │   ├───module
    │               │   │       ModuleBuilder.class
    │               │   │       ModuleDeclarationsFactory$_getModuleDeclarations_closure1.class
    │               │   │       ModuleDeclarationsFactory$_getModuleDeclarations_closure2.class
    │               │   │       ModuleDeclarationsFactory$_getModuleDeclarations_closure3.class
    │               │   │       ModuleDeclarationsFactory.class
    │               │   │       ModulesBuilder$_invokeMethod_closure1.class
    │               │   │       ModulesBuilder.class
    │               │   │
    │               │   └───util
    │               │           HalfBakedLegacyLinkGenerator.class
    │               │           ResourceMetaStore$_addResource_closure1.class
    │               │           ResourceMetaStore.class
    │               │
    │               └───resources
    │                   └───artefacts
    │                           AbstractResourcesArtefactHandler.class
    │                           DefaultResourceMapperClass.class
    │                           DefaultResourcesClass.class
    │                           ResourceMapperArtefactHandler.class
    │                           ResourceMapperClass.class
    │                           ResourcesArtefactHandler.class
    │                           ResourcesClass.class
    │
    ├───lib
    │       ant-1.8.2.jar
    │       ant-junit-1.8.2.jar
    │       ant-launcher-1.8.2.jar
    │       ant-trax-1.7.1.jar
    │       antlr-2.7.7.jar
    │       aopalliance-1.0.jar
    │       asm-3.1.jar
    │       aspectjrt-1.6.10.jar
    │       aspectjweaver-1.6.10.jar
    │       bcmail-jdk14-138.jar
    │       bcpg-jdk15-1.45.jar
    │       bcprov-jdk15-1.45.jar
    │       cglib-2.2.jar
    │       commons-beanutils-1.8.3.jar
    │       commons-cli-1.2.jar
    │       commons-codec-1.5.jar
    │       commons-collections-3.2.1.jar
    │       commons-dbcp-1.4.jar
    │       commons-el-1.0.jar
    │       commons-fileupload-1.2.2.jar
    │       commons-io-2.1.jar
    │       commons-lang-2.6.jar
    │       commons-pool-1.5.6.jar
    │       commons-validator-1.3.1.jar
    │       concurrentlinkedhashmap-lru-1.2_jdk5.jar
    │       core-renderer-R8.jar
    │       dom4j-1.6.1.jar
    │       ecj-3.7.2.jar
    │       ehcache-core-2.4.6.jar
    │       gant_groovy1.8-1.9.6.jar
    │       grails-2.1.1.jar
    │       grails-bootstrap-2.1.1.jar
    │       grails-core-2.1.1.jar
    │       grails-crud-2.1.1.jar
    │       grails-datastore-core-1.1.0.RELEASE.jar
    │       grails-datastore-gorm-1.1.0.RELEASE.jar
    │       grails-datastore-simple-1.1.0.RELEASE.jar
    │       grails-docs-2.1.1.jar
    │       grails-gdoc-engine-1.0.1.jar
    │       grails-hibernate-2.1.1.jar
    │       grails-logging-2.1.1.jar
    │       grails-plugin-async-2.1.1.jar
    │       grails-plugin-codecs-2.1.1.jar
    │       grails-plugin-controllers-2.1.1.jar
    │       grails-plugin-converters-2.1.1.jar
    │       grails-plugin-datasource-2.1.1.jar
    │       grails-plugin-domain-class-2.1.1.jar
    │       grails-plugin-filters-2.1.1.jar
    │       grails-plugin-gsp-2.1.1.jar
    │       grails-plugin-i18n-2.1.1.jar
    │       grails-plugin-log4j-2.1.1.jar
    │       grails-plugin-mimetypes-2.1.1.jar
    │       grails-plugin-scaffolding-2.1.1.jar
    │       grails-plugin-services-2.1.1.jar
    │       grails-plugin-servlets-2.1.1.jar
    │       grails-plugin-testing-2.1.1.jar
    │       grails-plugin-tomcat-2.1.1.jar
    │       grails-plugin-url-mappings-2.1.1.jar
    │       grails-plugin-validation-2.1.1.jar
    │       grails-resources-2.1.1.jar
    │       grails-scripts-2.1.1.jar
    │       grails-spring-2.1.1.jar
    │       grails-test-2.1.1.jar
    │       grails-test-suite-base-2.1.1.jar
    │       grails-web-2.1.1.jar
    │       grails-webflow-2.1.1.jar
    │       grails-wrapper-support-2.1.1.jar
    │       groovy-all-1.8.8.jar
    │       h2-1.3.164.jar
    │       hamcrest-core-1.1.jar
    │       hibernate-commons-annotations-3.2.0.Final.jar
    │       hibernate-core-3.6.10.Final.jar
    │       hibernate-ehcache-3.6.10.Final.jar
    │       hibernate-jpa-2.0-api-1.0.1.Final.jar
    │       hibernate-validator-4.1.0.Final.jar
    │       hsqldb-1.8.0.10.jar
    │       itext-2.0.8.jar
    │       ivy-2.2.0.jar
    │       jansi-1.2.1.jar
    │       javassist-3.16.1-GA.jar
    │       javax.servlet-api-3.0.1.jar
    │       jcl-over-slf4j-1.6.2.jar
    │       jline-1.0.jar
    │       jna-3.2.3.jar
    │       json-simple-1.1.jar
    │       jsp-api-2.0.jar
    │       jsp-api-2.1.jar
    │       jstl-1.1.2.jar
    │       jta-1.1.jar
    │       jul-to-slf4j-1.6.2.jar
    │       junit-4.10.jar
    │       liquibase-core-2.0.5.jar
    │       log4j-1.2.16.jar
    │       ognl-2.7.3.jar
    │       org.springframework.uaa.client-1.0.1.RELEASE.jar
    │       oro-2.0.8.jar
    │       persistence-api-1.0.jar
    │       protobuf-java-2.4.1.jar
    │       serializer-2.7.1.jar
    │       servlet-api-2.4.jar
    │       sitemesh-2.4.jar
    │       slf4j-api-1.6.2.jar
    │       snakeyaml-1.8.jar
    │       spring-aop-3.1.2.RELEASE.jar
    │       spring-asm-3.1.2.RELEASE.jar
    │       spring-aspects-3.1.2.RELEASE.jar
    │       spring-beans-3.1.2.RELEASE.jar
    │       spring-binding-2.0.8.RELEASE.jar
    │       spring-context-3.1.2.RELEASE.jar
    │       spring-context-support-3.1.2.RELEASE.jar
    │       spring-core-3.1.2.RELEASE.jar
    │       spring-expression-3.1.2.RELEASE.jar
    │       spring-jdbc-3.1.2.RELEASE.jar
    │       spring-jms-3.1.2.RELEASE.jar
    │       spring-js-2.0.8.RELEASE.jar
    │       spring-orm-3.1.2.RELEASE.jar
    │       spring-test-3.1.2.RELEASE.jar
    │       spring-tx-3.1.2.RELEASE.jar
    │       spring-web-3.1.2.RELEASE.jar
    │       spring-webflow-2.0.8.RELEASE.jar
    │       spring-webmvc-3.1.2.RELEASE.jar
    │       springloaded-core-1.0.6.jar
    │       standard-1.1.2.jar
    │       tomcat-annotations-api-7.0.30.jar
    │       tomcat-api-7.0.30.jar
    │       tomcat-catalina-7.0.30.jar
    │       tomcat-catalina-ant-7.0.30.jar
    │       tomcat-coyote-7.0.30.jar
    │       tomcat-embed-core-7.0.30.jar
    │       tomcat-embed-jasper-7.0.30.jar
    │       tomcat-embed-logging-juli-7.0.30.jar
    │       tomcat-embed-logging-log4j-7.0.30.jar
    │       tomcat-juli-7.0.30.jar
    │       tomcat-servlet-api-7.0.30.jar
    │       tomcat-util-7.0.30.jar
    │       validation-api-1.0.0.GA.jar
    │       xpp3_min-1.1.4c.jar
    │
    └───tld
            c.tld
            fmt.tld
            grails.tld
            spring.tld
Community
  • 1
  • 1
HAL 9000
  • 3,877
  • 1
  • 23
  • 29
  • Couple of questions: 1. Are you using the correct context when going to the URL? 2. What happens if you do a 'grails war' and deploy that to Tomcat outside of IntelliJ? – Gregg Nov 18 '13 at 17:47
  • Thanks Gregg. 1. Yes. It happens also when clicking the Link in the manager app. I can even download a Javascript file that belongs to my app. 2. Its working. – HAL 9000 Nov 18 '13 at 18:46
  • Facets just tell IntelliJ stuff about your project, what is the artifact configuration? (Artifacts is right under Facets in the side bar) – Steven Benitez Nov 19 '13 at 19:35
  • added artifact configuration and directory structure. – HAL 9000 Nov 19 '13 at 21:12

1 Answers1

8

It's actually a known issue:

  • IDEA-72093 Allow to deploy in run configuration war created by "grails war"

You should use workaround from the first comment:

When you run server, you need to do two things: run Build | Make Grails Web Archive, and then run server's run configuration with created war added as external source.

In case you are not aware of the external source option, check this screenshot.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • Thanks - but that sounds cumbersome and I can't do hot-swapping. Is there any chance that will be implemented in IntelliJ IDEA? – HAL 9000 Nov 20 '13 at 20:07
  • Is there any other way to hot swap using a local or external Tomcat configuration? – HAL 9000 Nov 20 '13 at 22:15
  • @HAL9000 No, for development and hotswap you should be using the standard `grails run-app` Run/Debug configuration in IDEA. Exporting grails war feature is designed for production deployment, not for development. At the moment there is no way to quickly test and hotswap Grails application on Tomcat server. – CrazyCoder Nov 22 '13 at 14:03
  • Yes you're right. But IntelliJ just seemed to be capable of building a grails war. Maybe it shouldn't allow to create a war artifact using "GrailsWeb" resources, or at least it should say that it won't work. I'll still try to optimize your workaround for exploded war generation and enabling GSP editing... – HAL 9000 Nov 22 '13 at 17:48