2015-04-01 54 views
0

我在Grails 2.4.5,Weceem 1.3和Java 1.8u40中使用GGTS 3.6.4。 我使用weceem插件在Grails中創建了一個Web應用程序,當我使用命令grails run-app啓動應用程序時,一切正常。使用weceem插件在Grails中創建可展開的戰爭

我試圖從這個項目創建一個可部署的戰爭,但每次我安裝戰爭時只顯示一個空白頁。這場戰爭甚至沒有包含index.html等。

然後,我嘗試創建一個新的Grails項目,其中包括weceem 1.3插件並執行命令grails run war。結果是一樣的。我只顯示了一個空白頁面。當我使用命令run-app一切工作正常.....

|Done creating WAR target\NaturlichWeb-0.1.war 
|Running Grails application 
Error | 
SLF4J: Class path contains multiple SLF4J bindings. 
Error | 
SLF4J: Found binding in [jar:file:/C:/Users/Xeno/Desktop/GGTS_new/grails-2.4.5/dist/grails-plugin-log4j-2.4.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
Error | 
SLF4J: Found binding in [jar:file:/C:/Users/Xeno/Desktop/GGTS_new/workspace/NaturlichWeb/target/work/tomcat/webapps/NaturlichWeb/WEB-INF/lib/grails-plugin-log4j-2.4.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
Error | 
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 
Error | 
SLF4J: Actual binding is of type [org.slf4j.impl.GrailsSlf4jLoggerFactory] 
Weceem: Initializing ehcache with default weceem ehcache.xml from plugin resource: class path resource [weceem-default-ehcache.xml] 
Configuring Spring Security Core ... 
... finished configuring Spring Security Core 
2015-04-02 11:21:13,986 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table tag_links drop constraint FK_lmil1jg72pjc8ei5p6kk5g9un if exists 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - Tabelle "TAG_LINKS" nicht gefunden 
Table "TAG_LINKS" not found; SQL statement: 
alter table tag_links drop constraint FK_lmil1jg72pjc8ei5p6kk5g9un if exists [42102-176] 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table user_role drop constraint FK_it77eq964jhfqtu54081ebtio if exists 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - Tabelle "USER_ROLE" nicht gefunden 
Table "USER_ROLE" not found; SQL statement: 
alter table user_role drop constraint FK_it77eq964jhfqtu54081ebtio if exists [42102-176] 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table user_role drop constraint FK_apcc8lxk2xnug8377fatvbn04 if exists 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - Tabelle "USER_ROLE" nicht gefunden 
Table "USER_ROLE" not found; SQL statement: 
alter table user_role drop constraint FK_apcc8lxk2xnug8377fatvbn04 if exists [42102-176] 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table wcm_content drop constraint FK_1i8ibd0dm67mut0hh09oqt452 if exists 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - Tabelle "WCM_CONTENT" nicht gefunden 
Table "WCM_CONTENT" not found; SQL statement: 
alter table wcm_content drop constraint FK_1i8ibd0dm67mut0hh09oqt452 if exists [42102-176] 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table wcm_content drop constraint FK_9c59e0m1eb1xaeoy5h95xlyme if exists 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - Tabelle "WCM_CONTENT" nicht gefunden 
Table "WCM_CONTENT" not found; SQL statement: 
alter table wcm_content drop constraint FK_9c59e0m1eb1xaeoy5h95xlyme if exists [42102-176] 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table wcm_content drop constraint FK_c9u6eo21g7eku09byvrsjjm0s if exists 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - Tabelle "WCM_CONTENT" nicht gefunden 
Table "WCM_CONTENT" not found; SQL statement: 
alter table wcm_content drop constraint FK_c9u6eo21g7eku09byvrsjjm0s if exists [42102-176] 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table wcm_content drop constraint FK_sgkk9pe0yu0f2brjsl8j20svy if exists 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - Tabelle "WCM_CONTENT" nicht gefunden 
Table "WCM_CONTENT" not found; SQL statement: 
alter table wcm_content drop constraint FK_sgkk9pe0yu0f2brjsl8j20svy if exists [42102-176] 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table wcm_content drop constraint FK_qs79ql67napbqpkvni2tw6ha0 if exists 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - Tabelle "WCM_CONTENT" nicht gefunden 
Table "WCM_CONTENT" not found; SQL statement: 
alter table wcm_content drop constraint FK_qs79ql67napbqpkvni2tw6ha0 if exists [42102-176] 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table wcm_content drop constraint FK_8duair0heuk4lw83fsp2arsce if exists 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - Tabelle "WCM_CONTENT" nicht gefunden 
Table "WCM_CONTENT" not found; SQL statement: 
alter table wcm_content drop constraint FK_8duair0heuk4lw83fsp2arsce if exists [42102-176] 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table wcm_related_content drop constraint FK_gunqv3de4a2aowjtox5l10ug4 if exists 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - Tabelle "WCM_RELATED_CONTENT" nicht gefunden 
Table "WCM_RELATED_CONTENT" not found; SQL statement: 
alter table wcm_related_content drop constraint FK_gunqv3de4a2aowjtox5l10ug4 if exists [42102-176] 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table wcm_related_content drop constraint FK_oxph3lt0u4eteq81gnh2dljrd if exists 
2015-04-02 11:21:14,002 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - Tabelle "WCM_RELATED_CONTENT" nicht gefunden 
Table "WCM_RELATED_CONTENT" not found; SQL statement: 
alter table wcm_related_content drop constraint FK_oxph3lt0u4eteq81gnh2dljrd if exists [42102-176] 
2015-04-02 11:21:30,296 [localhost-startStop-1] ERROR export.SimpleSpaceImporter - Unable to import Weceem ZIP file C:\Users\Xeno\AppData\Local\Temp\weceem-space-import4655006495072954442.tmp 
: The following error occurred while executing this line: 
jar:file:/C:/Users/Xeno/Desktop/GGTS_new/grails-2.4.5/lib/org.apache.ant/ant/jars/ant-1.8.4.jar!/org/apache/tools/ant/antlib.xml:37: Problem: failed to create task or type componentdef 
Cause: The name is undefined. 
Action: Check the spelling. 
Action: Check that any custom tasks/types have been declared. 
Action: Check that any <presetdef>/<macrodef> declarations have taken place. 
    at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508) 
    at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:434) 
    at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:281) 
    at org.apache.tools.ant.ComponentHelper.checkNamespace(ComponentHelper.java:790) 
    at org.apache.tools.ant.ComponentHelper.getDefinition(ComponentHelper.java:260) 
    at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:237) 
    at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:216) 
    at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:414) 
    at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160) 
    at org.weceem.export.SimpleSpaceImporter.execute(SimpleSpaceImporter.groovy:34) 
    at org.weceem.services.WcmImportExportService$_importSpace_closure1.doCall(WcmImportExportService.groovy:24) 
    at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:815) 
    at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:715) 
    at org.weceem.services.WcmImportExportService.importSpace(WcmImportExportService.groovy:20) 
    at org.weceem.services.WcmContentRepositoryService.importSpaceTemplate(WcmContentRepositoryService.groovy:430) 
    at org.weceem.services.WcmContentRepositoryService$_createSpace_closure7.doCall(WcmContentRepositoryService.groovy:384) 
    at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:815) 
    at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:715) 
    at org.weceem.services.WcmContentRepositoryService.createSpace(WcmContentRepositoryService.groovy:364) 
    at org.weceem.services.WcmContentRepositoryService$_createDefaultSpace_closure3.doCall(WcmContentRepositoryService.groovy:210) 
    at org.weceem.services.WcmContentRepositoryService.withPermissionsBypass(WcmContentRepositoryService.groovy:1606) 
    at org.weceem.services.WcmContentRepositoryService.createDefaultSpace(WcmContentRepositoryService.groovy:209) 
    at WeceemGrailsPlugin$_closure2.doCall(WeceemGrailsPlugin.groovy:117) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 
Caused by: jar:file:/C:/Users/Xeno/Desktop/GGTS_new/grails-2.4.5/lib/org.apache.ant/ant/jars/ant-1.8.4.jar!/org/apache/tools/ant/antlib.xml:37: Problem: failed to create task or type componentdef 
Cause: The name is undefined. 
Action: Check the spelling. 
Action: Check that any custom tasks/types have been declared. 
Action: Check that any <presetdef>/<macrodef> declarations have taken place. 
    at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:484) 
    at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:416) 
    at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160) 
    at org.apache.tools.ant.taskdefs.Antlib.execute(Antlib.java:146) 
    at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:432) 
    ... 25 more 
--- Nested Exception --- 
jar:file:/C:/Users/Xeno/Desktop/GGTS_new/grails-2.4.5/lib/org.apache.ant/ant/jars/ant-1.8.4.jar!/org/apache/tools/ant/antlib.xml:37: Problem: failed to create task or type componentdef 
Cause: The name is undefined. 
Action: Check the spelling. 
Action: Check that any custom tasks/types have been declared. 
Action: Check that any <presetdef>/<macrodef> declarations have taken place. 
    at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:484) 
    at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:416) 
    at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160) 
    at org.apache.tools.ant.taskdefs.Antlib.execute(Antlib.java:146) 
    at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:432) 
    at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:281) 
    at org.apache.tools.ant.ComponentHelper.checkNamespace(ComponentHelper.java:790) 
    at org.apache.tools.ant.ComponentHelper.getDefinition(ComponentHelper.java:260) 
    at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:237) 
    at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:216) 
    at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:414) 
    at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160) 
    at org.weceem.export.SimpleSpaceImporter.execute(SimpleSpaceImporter.groovy:34) 
    at org.weceem.services.WcmImportExportService$_importSpace_closure1.doCall(WcmImportExportService.groovy:24) 
    at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:815) 
    at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:715) 
    at org.weceem.services.WcmImportExportService.importSpace(WcmImportExportService.groovy:20) 
    at org.weceem.services.WcmContentRepositoryService.importSpaceTemplate(WcmContentRepositoryService.groovy:430) 
    at org.weceem.services.WcmContentRepositoryService$_createSpace_closure7.doCall(WcmContentRepositoryService.groovy:384) 
    at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:815) 
    at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:715) 
    at org.weceem.services.WcmContentRepositoryService.createSpace(WcmContentRepositoryService.groovy:364) 
    at org.weceem.services.WcmContentRepositoryService$_createDefaultSpace_closure3.doCall(WcmContentRepositoryService.groovy:210) 
    at org.weceem.services.WcmContentRepositoryService.withPermissionsBypass(WcmContentRepositoryService.groovy:1606) 
    at org.weceem.services.WcmContentRepositoryService.createDefaultSpace(WcmContentRepositoryService.groovy:209) 
    at WeceemGrailsPlugin$_closure2.doCall(WeceemGrailsPlugin.groovy:117) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 
Error | 
org.weceem.export.ImportException: Uploaded file can't be unpacked. Check it and try again. 
Error | 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
Error | 
+0

日誌文件中的任何有趣內容? – 2015-04-01 23:33:15

+0

戰爭的創作無縫。我現在添加了部署過程中引發的異常。 – Moprotz 2015-04-02 09:38:13

回答

0

這似乎是核心問題是:

無法創建任務或鍵入componentdef

如果您谷歌與您最喜愛的搜索引擎,你會看到一個常見的原因是在戰爭文件中同時擁有Ant 1.7.x和1.8.x的jar文件。 Grails 2.4.5使用Ant 1.8.4,但是Ant的jar被包含在戰爭中 - 您是否在BuildConfig.groovy中添加了顯式依賴項?

我的猜測是Weceem或它依賴的其中一個插件具有Ant 1.7依賴性。如果這是問題,一旦確定哪個插件導致它被包含,您應該能夠爲Ant 1.7添加排除項。或者,您可以使用grails.war.resources在將所有文件添加到戰爭之前從暫存目錄中刪除額外的jar。這在文檔和this Marc Palmer blog post中進行了描述,並且可能類似於

grails.war.resources = { stagingDir -> 
    delete(file:"$stagingDir/WEB-INF/lib/ant-1.7.???.jar") 
} 
+0

謝謝,這似乎是問題所在!當我運行run-war命令時,戰爭被創建並且正在工作,但是當我嘗試將其部署到Web服務器上時,我收到錯誤消息:無法獲取節點鎖定,以下位置是可寫的嗎?:[/ etc/init.d/elasticsearch]我也嘗試更改elasticsearch.path.data變量,但它不會更改任何內容。你是否也有一個想法可能是什麼問題? – Moprotz 2015-04-02 19:08:10

+0

您可以嘗試在weceem-app中完成的elasticsearch配置示例,請查看https://github.com/jCatalog/weceem-app/blob/master/grails-app/conf/Config.groovy(從行171); – 2015-04-05 11:18:07