[乐意黎原创] glassfish里抛出Note: string:///XXX_jsp.java from uses unchecked or unsafe operations.

glassfish里抛出如下错误:

org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP

PWC6199: Generated servlet error:
string:///XXXX_jsp.java:169: constant string too long

PWC6199: Generated servlet error:
Note: string:///XXXX_jsp.java from  uses unchecked or unsafe operations.

折腾了好久,始终找不到原因。
最后,经老大指点,并实际测试。终于发现原因
是由于glassfish里 把genStrAsCharArray 项设为 true 导致的。

解决办法:


具体为:
把 $GLASSFISH_HOME/domains/domain1/config/default-web.xml 里的
<param-name>genStrAsCharArray</param-name><param-value>true</param-value>

修改为:
<param-name>genStrAsCharArray</param-name><param-value>false</param-value>



genStrAsCharArray false If set to true, generates text strings as char arrays, which improves performance in some cases.
The default-web.xml file defines features such as filters and security constraints that apply to all web applications.  The parameter, development=true, (the default value for developer profile) enables changes made to JSPTM – code to be  instantly visible to the clients. However, there is a cost associated with this. To avoid the cost of checking whether the JSP code  has been modified and hence its recompilation, the first parameter, development=false, can be used to set development to false since this scenario is unlikely in a production system.  This check affects application scalability when multiple users request the same JSP class. The second parameter, genStrAsCharArray=true, changes the way the JSPs are generated by generating char arrays for every static strings in the JSP class like for example, the HTML tags.  By default, the JSPcode  writer must call the toCharArray() on every String on every invocation of the JSPclass. Settings in  default-web.xml.  ($GLASSFISH_HOME/domains/domain1/config/default-web.xml)<init-param><param-name>development</param-name><param-value>false</param-value></init-param><init-param><param-name>genStrAsCharArray</param-name><param-value>true</param-value> #-> 此处上面应该修改为false </init-param> The more  configuration optimization can be done using the document from SUN you can download it 参考网址: http://docs.oracle.com/cd/E19879-01/820-4343/abedw/index.html http://www.binbert.com/blog/2010/04/glassfish-performance-tunning/


作者: 乐意黎,原创。禁止转载

原文地址: http://blog.csdn.net/aerchi/article/details/45394231
时间: 2024-09-29 16:08:56

[乐意黎原创] glassfish里抛出Note: string:///XXX_jsp.java from uses unchecked or unsafe operations.的相关文章

[乐意黎原创] php 和 apache 的配置

1.  E:\PHPCMS\Apache2.2\conf\httpd.conf 增加 php 设置,大概在130行,#LoadModule vhost_alias_module modules/mod_vhost_alias.so 后面增加 LoadModule php5_module "E:/PHPCMS/PHP5/php5apache2_2.dll" PHPIniDir "E:/PHPCMS/PHP5" 修改默认站点:大概在184 行左右, #DocumentR

[乐意黎原创] PHP的增加时间

//增加10分钟 echo date('H:i:s',strtotime("+10 minute")); //增加30分钟 $startTime ="10:30"; echo date("H:i", strtotime("$startTime +30 min")); //加上2个小时 date("Y-m-d H:i:s",time()+7200); -----------------------------

[乐意黎原创] php 页面提示 Fatal error: Call to undefined function curl_init()

调用到 curl_init()的php页面提示: Fatal error: Call to undefined function curl_init() in E:\PHPCMS\Cms\www.aerchi.com\kuaiji\weixin.php on line 196 如图: 首先, 在 php.ini 文件中开启 extension=php_curl.dll , 即把把前面的分号(;)注释划掉. 如果是 windows 7 系统(需要openssl),还需要把 extension=ph

【乐意黎原创】MIUI6 MIUI 5.4.17 开发版 无法读写到外置存储卡上(SD)

本人前几天用红米1 刷 了MIUI6  MIUI 5.4.17 开发版 [[乐意黎原创]红米1刷MIUI 6 系统  http://blog.csdn.net/aerchi/article/details/45102013], 近期出现了一个问题,无法读写到外置存储卡上(SD). 下面介绍下该问题的解决方法: 首先, 确保你的手机已经ROOT了.[可使用ROOT大师] 其次,修改权限. 1) 将你的手机下载安装好RE管理器: 2)使用文本编辑器打开/system/etc/permissions目

【乐意黎原创】chrome 显示 &quot;a plugin (shockwave flash) isn&#39;t responding&quot; 并停止响应的解决

在Chrome 使用过种中,会出现 "a plugin (shockwave flash) isn't responding" 的提示,并且当前的选项卡假死,无响应了.经过一番研究,解决方法如下: 1. Google chrome 在使用过程中会出现 "a plugin (shockwave flash) isn't responding" 并停止响应: 2. 解决办法: 1).在 Chrome 地址栏, 输入chrome://plugins 并找到 "A

【乐意黎原创】2014年全国和云南省中级会计师成绩段、过关率及年龄段统计分析

2014年全国会计资格考试报名人数达214万人,比2013年度增长3.88%. 作者: aerchi, 乐意黎,http://www.aerchi.com, http://www.aerchi.com/kuaiji/ 其中:初级资格为137.1万人,比去年增长了1.89%:中级资格为72.4万人,比去年增长了7.27%:高级资格为4.8万人,比去年增长了12.92%:初级.中级.高级资格考试报名人数比例为28:15:1(2013年为31:16:1)经过 aerchi 近半年的努力,对近69.6万

[乐意黎原创] 使用Selenium webdriver+Firefox浏览器来登录新浪微博

有个需求测试,需要用webdriver 登录到新浪微博,由于个人比较善长 Webdriver,于是采取了Webdriver+FireFox来实现. 配置环境 a. 必须首先在Eclipse里加载 selenium webdriver 包[[此处我导入的是 selenium-server-standalone-2.45.0.jar] b. 以及安装了 firefox 浏览器. 此篇文章中我用了本人的新浪微博地址来做测试,大家 可以更换为自己的新浪微博帐号和密码. 文中为部分主要的Java 代码.

有时候在操作Session时,系统会抛出如下异常:java.lang.IllegalStateException: Cannot create a session after the response has been committed

有时候在操作Session时,系统会抛出如下异常 java.lang.IllegalStateException: Cannot create a session after the response has been committed 原因1: Session 的创建语句: HttpSession seesion = request.getSession(); 之前有Response的输出语句. 应该把HttpSession seesion = request.getSession(); 放

[乐意黎原创] java里classpath在引入编译文件路径时加星号(*)引起的错误

一不小心,在引入编译java文件路径下加了个星号(*), 如下图: 启动后,页面在抛: 并且后台日志在抛: E-C-*-A0FF0001-run_jsp._jspService [Thread-50][FATAL][10:06:39,244] com.jinfonet.web.WRException: NullPointerException at run_jsp.java:134 at org.apache.jsp.run_jsp._jspService(run_jsp.java:151) a