2012-10-23 80 views
1

我创建了一个Grails应用程序,这是很好的道路上完成,我一直在与各种云服务提供商测试它,例如Cloud Foundry的,Heroku的,应用程序引擎等。在我去Jelastic因为这是结束似乎完全支持使用本地插件,因为我只需要上传用于部署的“战争”文件。将Grails部署到云(Jelastic)Bootstrap问题?

直到今天,我有这个,一切都没有问题很好,但是我已经做了一些修改,并添加到我的应用程序的一些关系,我然后填充使用引导。这种引导工作之前,但它现在已经停了,下面你可以看到我的自举的一个例子:

def init = { servletContext -> 

def adminRole = new SecRole(authority: 'ADMIN').save(flush: true) 
def userRole = new SecRole(authority: 'USER').save(flush: true) 

def Admin = new SecUser(username: 'admin', email:'[email protected]', enabled: true, password: 'password') 

def SuperUser = new Areas(name:"SuperUser") 
.addToUsers(Admin) 
.save(flush:true) 

SecUserSecRole.create Admin, adminRole, true 

assert SecUser.count() == 1 
assert SecRole.count() == 2 
assert SecUserSecRole.count() == 1 
    } 

当我与这个数据引导工作正常本地运行的应用程序,但是当我在Jelastic运行它,我得到以下错误信息:

SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener 
org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; SQL 

这是发生错误,但即时通讯在亏损,为什么它发生的只是一个局部堆栈的跟踪,可以有人请帮助?

感谢

编辑.....

我也曾尝试用相同的错误消息自举数据显示:S

def init = { servletContext -> 

def adminRole = new SecRole(authority: 'ADMIN').save(flush: true) 

def SuperAdmin = new Areas(name: 'Super Admin') 

SuperAdmin.save(flush: true) 

def area = Areas.findByName('SuperAdmin') 

def SuperAdmin = new SecUser(username: 'admin', email:'[email protected]', area: area, enabled: true, password: 'admin') 

SuperAdmin.save() 

SecUserSecRole.create SuperAdmin, adminRole, true 

assert SecUser.count() == 1 
assert SecRole.count() == 2 
assert SecUserSecRole.count() == 1 
    } 

我得到的错误信息是如下:

SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener 
org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; SQL [select this_.id as id3_0_, this_.version as version3_0_, this_.account_expired as account3_3_0_, this_.account_locked as account4_3_0_, this_.area_id as area5_3_0_, this_.email as email3_0_, this_.enabled as enabled3_0_, this_."password" as password8_3_0_, this_.password_expired as password9_3_0_, this_.username as username3_0_ from sec_user this_ where this_.username=?]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query 

我已经删除了BootStrap数据,应用程序启动很好,任何人都可以摆脱这种情况,因为它本地运行良好,只是不在云端?在此先感谢

+0

任何人都可以在这方面帮助? – user723858

+0

我已经更新了这个问题,任何人都可以帮忙吗? – user723858

+0

有没有人可以用这个? bootstrap文件错了? – user723858

回答

1

我想您所提供的信息是不够的,帮助你。

为了调试这一点,我建议你删除了引导代码,以便您的应用程序将启动。

接下来,我将安装控制台插件(http://grails.org/plugin/console)。这将让你在控制台中测试你的引导代码。也许它可以帮助你跟踪问题。

希望帮助

0

你用同样的环境拓扑当地人称为你在Jelastic云? 您能否提供您的Jelastic环境名称? 另外,确保您的Jelastic安装不会错过数据库连接库,并且版本与您在本地使用的版本相同。