由于我的应用程序已升级到 grails 2.3.0,webflow 插件(版本 2.0.8.1)在 webflow 操作后触发 OutOfMemoryError 错误和“方法名称不得为空”。
堆栈错误:
2013-09-14 00:39:10,574 ERROR [ClosureInvokingAction] - Exception occured invoking flow action: GC overhead limit exceeded
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.Arrays.copyOfRange(Arrays.java:3209)
at java.lang.String.<init>(String.java:215)
at java.lang.StringBuilder.toString(StringBuilder.java:430)
2013-09-14 00:39:10,575 DEBUG [SessionBindingConversationManager] - Unlocking conversation 1
2013-09-14 00:39:10,584 ERROR [[grails]] - Servlet.service() for servlet grails threw exception
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.Arrays.copyOfRange(Arrays.java:3209)
at java.lang.String.<init>(String.java:215)
at java.lang.StringBuilder.toString(StringBuilder.java:430)
2013-09-14 00:39:10,585 DEBUG [HttpSessionSecurityContextRepository] - SecurityContext is empty or anonymous - context will not be stored in HttpSession.
2013-09-14 00:39:10,585 DEBUG [SecurityContextPersistenceFilter] - SecurityContextHolder now cleared, as request processing completed
2013-09-14 00:39:10,585 ERROR [[default]] - Servlet.service() for servlet [default] in context with path [/UbiCloud] threw exception [org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded] with root cause
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.Arrays.copyOfRange(Arrays.java:3209)
at java.lang.String.<init>(String.java:215)
at java.lang.StringBuilder.toString(StringBuilder.java:430)
其次是webflow错误:
Method name must not be null. Stacktrace follows:
java.lang.IllegalArgumentException: Method name must not be null
at grails.plugin.cache.web.ProxyAwareMixedGrailsControllerHelper.retrieveAction(ProxyAwareMixedGrailsControllerHelper.java:41)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)
网络流状态:
billingOrder {
on("requestPayment") {
// set local props
def profile = flow.profile
def pid = profile.id
def service = flow.service
def orders = flow.orders
def email = conversation.email
// subscription dates
def today = new Date()
def endOfSubscription = today + 365
// billing create
flow.billing = new Billing(
orders:orders,
profile:profile,
packcode:orders?.packcode,
creationdate:today,
name:profile?.name,
firstname:profile?.firstname,
address:params?.billing?.address,
postalcode:params?.billing?.postalcode,
town:params?.billing?.town,
country:params?.billing?.country, // TODO: check phone locale
tvanumber:params?.billing?.tvanumber,
paymentmode:PAY_MODE,
currency:CUR_MODE,
paymentterms:params?.billing?.paymentterms,
termsapproved:params?.billing?.termsapproved,
autorenewal:true,
newcontact:false,
active:false,
creditcardtype:params?.billing?.creditcardtype,
cardno:params?.billing?.cardno.trim(),
ed:params?.billing?.ed,
cvc:params?.billing?.cvc
)
// process amount terms
def billing = flow.billing
if (billing.paymentterms == MONTH_MODE) {
billing.amount = orders.amountmonth
} else if (billing.paymentterms == YEAR_MODE) {
billing.amount = orders.amountyear
} else {
log.error "[STORE] No payment terms defined"
}
// profile fields
profile.phone=params?.profile?.phone
profile.mobilephone=params?.profile?.mobilephone
profile.companyname=params?.profile?.companyname
profile.sirencode=params?.profile?.sirencode
// update technical contact
service.temail=params?.service?.temail
}
if (!billing.validate() || !profile.validate() || !orders.validate() || !service.validate()) {
if(!billing.creditcardtype){
flash.messagecc = "store.billing.cc"
} else if(!billing.termsapproved){
flash.message = "store.billing.approveterms"
}
[billing:billing,orders:orders,profile:profile,service:service,orders:orders,rpid:rpid]
error()
该错误来自用于验证计费对象的 grails 化学,这有时会导致溢出错误,并且无论如何“方法名称不得为空”。自从从 grails 2.2.4 迁移到 grails 2.3 以来,没有添加任何约束或字段,我想域验证对象或 webflow 过程中必须有变化。当然,计费域对象是可序列化的,而 beforeValidate() 是瞬态的。