javax.swing.tree.TreeNode是一个受限类

在Google App Engine (GAE) 的本地开发环境中使用Struts2和Freemarker时,遇到javax.swing.tree.TreeNode报错。然而,该问题在部署到GAE生产环境时自行消失。解决方法是在本地环境中创建TextBlock.java的重载类,编译后放入WEB-INF/classes目录,以覆盖原有的受限类。
摘要由CSDN通过智能技术生成

问题

在以下环境中在Google App Engine上开发Struts2。

  1. 支撑杆2.3.1.2
  2. Freemaker 2.3.18
  3. JDK 1.6
  4. Eclipse 3.7 + Eclipse的Google插件
  5. Google App Engine Java SDK 1.6.3.1

GAE抱怨javax.swing.tree.TreeNode是本地开发中的受限类,如果部署在实际的GAE生产环境中,则错误消息将消失。

Caused by:
java.lang.NoClassDefFoundError: javax.swing.tree.TreeNode is a restricted class. 
	Please see the Google  App Engine developer's guide for more details.
	at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
	at freemarker.core.TextBlock.isIgnorable(TextBlock.java:375)
	at freemarker.core.TextBlock.heedsTrailingWhitespace(TextBlock.java:337)

不知道为什么它可以在GAE生产环境中工作,对于本地GAE环境,您可以重载TextBlock类,编译以下代码并将其移至WEB-INF / classes ,以便它可以重载原始的TextBlock类。

treenote is restricted class

文件:TextBlock.java

/* 
 * Copyright (c) 2003 The Visigoth Software Society. All rights 
 * reserved. 
 * 
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions 
 * are met: 
 * 
 * 1. Redistributions of source code must retain the above copyright 
 *    notice, this list of conditions and the following disclaimer. 
 * 
 * 2. Redistributions in binary form must reproduce the above 
copyright 
 *    notice, this list of conditions and the following disclaimer in 
 *    the documentation and/or other materials provided with the 
 *    distribution. 
 * 
 * 3. The end-user documentation included with the redistribution, if 
 *    any, must include the following acknowledgement: 
 *       "This product includes software developed by the 
 *        Visigoth Software Society (http://www.visigoths.org/)." 
 *    Alternately, this acknowledgement may appear in the software 
itself, 
 *    if and wherever such third-party acknowledgements normally 
appear. 
 * 
 * 4. Neither the name "FreeMarker", "Visigoth", nor any of the names 
of the 
 *    project contributors may be used to endorse or promote products 
derived 
 *    from this software without prior written permission. For written 
 *    permission, please contact visigo...@visigoths.org. 
 * 
 * 5. Products derived f
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值