设为首页 收藏本站
查看: 482|回复: 0

[经验分享] weblogic summing-up for SIT

[复制链接]

尚未签到

发表于 2017-2-14 11:58:56 | 显示全部楼层 |阅读模式
1.Cannot contain comments in tag-class when describe a tag.
<tag>
<name>collection</name>
<tag-class>
<!--  com.XXX.XXX.extensions.taglib.iflow.CollectionTag-->
com.XXX.iflow.tray.taglib.CollectionTag</tag-class>
<body-content>JSP</body-content>
<description>Defines the collection of task to retrieve.</description>
<attribute>
....
</attribute>
</tag>This comment will cause 'The tag handler class was not found ""' under weblogic.
2.Remote debug(weblogic/eclipse)
(i)Add debug option in the start script of an existed domain. Add this sentence below in startWebLogic.cmd(.sh)(in weblogic9.2, just find the default setting 'set JAVA_DEBUG=' in setDomainEnv.cmd, update it. )
set JAVA_DEBUG=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n
set JAVA_VM=%JAVA_VM% %JAVA_DEBUG% %JAVA_PROFILE%
Note:8453 is the debug port.
(ii). Add a remote Java Application,input the Host and Port.
3. the usage of html:multibox in weblogic environment
Right:
<html:multibox property="tableSelection"><c:out value="${item.tableName}"/></html:multibox>
<html:text name="resultrow" property="expiryDate" size="10" styleClass="form_field" maxlength="10" />
Error:
<html:multibox property="tableSelection" value="${item.tableName}"/>
<html:text name="resultrow" property="expiryDate" size="10" styleClass="form_field" maxlength="10" value='${resultrow.expiryDateAsString}' />
Cannot digest '${item.tableName}' and take it as a string.
Can get the real value of 'resultrow.expiryDateAsString' automaticly.
4.java.util.ConcurrentModificationException
Enumeration<?> attrNames = request.getAttributeNames();
while (attrNames.hasMoreElements()) {
String attrName = (String) attrNames.nextElement();
if (attrName
.endsWith(PaginationConstants.PAGINATION_SORT_ORDER)) {
request.setAttribute(attrName, null);
if (logger.isDebugEnabled()) {
logger.debug("[" + request.getServletPath()
+ "] PaginationSortOrderData cleared: "
+ attrName);
}
}
}java.util.ConcurrentModificationException
        at java.util.HashMap$HashIterator.nextEntry(HashMap.java:787)
        at java.util.HashMap$KeyIterator.next(HashMap.java:823)
        at weblogic.utils.enumerations.IteratorEnumerator.nextElement(IteratorEn
umerator.java:25)
        at com.XXX.XXX.extensions.taglib.pagination.PaginationFilterModule.ap
plyPagination(PaginationFilterModule.java:57)
        at com.XXX.XXX.extensions.taglib.pagination.PaginationFilterModule.ex
ecute(PaginationFilterModule.java:42)
Note:Seems this is OK. in tomcat,jboss,Sun application.
5. weblogic bundling an old version of Rhino inside weblogic.jar
java.lang.NoSuchMethodError: org.mozilla.javascript.Context.initStandardObjects()Lorg/mozilla/javascript/ScriptableObject;
This is caused by WebLogic bundling an old version of Rhino inside weblogic.jar (how horrible!!), and in this old version the org.mozilla.javascript.Context class does not have the method initStandardObjects().
The Rhino JAR used by Alfresco is currently rhino-js-1.6R4.jar (i.e. Rhino version 1.6R4).
It is not enough to place this JAR file inside your WebLogic domain's lib directory.
You have to force it on the front of WebLogic's CLASSPATH before it loads its own JARs. After trying a number of approaches, this was the only way I found to reliably fix the problem.
So, do the following to achieve this:
(i) Copy rhino-js-1.6R4.jar to your domain's lib directory (if it's not there already))
(ii) Change the following line in startWebLogic.cmd (in your WebLogic domain's bin directory) if you are using Windows ... similar idea if you are using Solaris
from ...
-------------
set CLASSPATH=%CLASSPATH%;%MEDREC_WEBLOGIC_CLASSPATH%
-------------
to ...
-------------
set CLASSPATH=C:\PROGRA~1\BEA\user_projects\domains\alfresco\lib\rhino-js-1.6R4.jar;%CLASSPATH%;%MEDREC_WEBLOGIC_CLASSPATH%
-------------
Note: C:\PROGRA~1\BEA\user_projects\domains\alfresco\lib\ is where my domain's lib directory is - yours will no doubt be different.
Stop and restart WebLogic using this modified script
The problem should go away as WebLogic should now be using Rhino 1.6R4 (the version required for Alfresco). Hooray!!
6.java.sql.Timestamp.compareTo(java.util.Date) the parameter is not a instance of java.sql.Timestamp.
java.sql.Timestamp.compareTo(java.util.Date)
It' OK under Tomcat+Sun JDK
But Bad under weblogic.
Caused by: java.lang.ClassCastException: java.util.Date
        at java.sql.Timestamp.compareTo(Timestamp.java:474)
        at com.XXX.iforge.timelog.service.AvWorkingHoursServiceImpl.prepareAvPer
iodList(AvWorkingHoursServiceImpl.java:65)
        at com.XXX.iforge.timelog.command.AvWorkingHoursCommand.getMonthlyTimelo
gPeriodList(AvWorkingHoursCommand.java:65)
        at com.XXX.iforge.timelog.command.AvWorkingHoursCommand.periodDisplay(Av
WorkingHoursCommand.java:43)
        ... 41 more
7. the usage of getRealPath(String)
event.getServletContext().getRealPath("WEB-INF/classes")
When I deploy my application as a folder, it'OK and retun 'D:\deploy package\codeadmin\WEB-INF\classes'. But it retuns null when deploying my application as a war packge.
There is no real Path concept for a packaged web application.
See API of ServletContext:
String getRealPath(String path)
Returns a String containing the real path for a given virtual path. For example, the path "/index.html" returns the absolute file path on the server's filesystem would be served by a request for "http://host/contextPath/index.html", where contextPath is the context path of this ServletContext..
The real path returned will be in a form appropriate to the computer and operating system on which the servlet container is running, including the proper path separators. This method returns null if the servlet container cannot translate the virtual path to a real path for any reason (such as when the content is being made available from a .war archive).
Parameters:
path - a String specifying a virtual path
Returns:
a String specifying the real path, or null if the translation cannot be performed
InputStream is = getServletContext().
getResourceAsStream("/WEB-INF/log4j.properties");
Properties props = new Properties();
try {
props.load(is);
} catch (IOException e) {
System.err.println("Load log4j configuration failed");
}
PropertyConfigurator.configure(props);
ServletContext.getResourceAsStream() is commendatory;

8. Caused by: weblogic.descriptor.BeanAlreadyExistsException: Bean already exists:
"weblogic.j2ee.descriptor.ServletMappingBeanImpl@e30790b(/ServletMappings[weblogic.descriptor.internal.CompoundKey@ea2c6ca])" when I received an error similar to this, I had to delete duplicate tag declaration as below.

<taglib>
<taglib-uri>/WEB-INF/tld/struts-html-el.tld</taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-html-el.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-html-el.tld</taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-html-el.tld
</taglib-location>
</taglib>

9.Weblogic cannot support el properly.
<html:text property='<%="sqlClause.select["+rownum+"].alias"%>' readonly="true"><c:out value="${selectList.alias}"/></html:text>
//-->
<input type="text" name="sqlClause.select[0].alias" value="" readonly="readonly">
<html:hidden property='<%="sqlClause.select["+rownum+"].attribute"%>' value="${selectList.attribute}"/>
//-->
<input type="hidden" name="sqlClause.select[0].attribute" value="${selectList.attribute}">
These codes also tell us, we can submit a arraylist.(I didn't know it before)
<html:hidden property="<%="sqlClause.select["+rownum+"].attribute"%>" value="${selectList.attribute}"/>The code above is OK. in tomcat, but bad in weblogic. Seems weblogic is strict.
Note: This may be a bug of weblogic and this code above is OK under weblogic 9.2 MP2.
See, http://edocs.bea.com/wls/docs92/issues/known_resolved.html#wp1143391
Change Request Number: CR300671 CR311505  
Expression Language (EL) was not getting substituted with values while using Struts-EL HTML tag.
This problem has been resolved.  
Foung in: 9.2  Fixed in: 9.2 MP2
Source: http://forums.bea.com/thread.jspa?threadID=400000764&start=15
Thank you. Although getting the MP2 upgrade took many calls and emails to tech support (broken links, misleading links), this fixed my problem (steps described below).
I don't know how reward points are awarded, but you deserve a whole bunch.
For anyone else who:
- has upgraded from WL8.x to WL9.2, and was using JSTL 1.0
- has WL9.2 installed but not WL9.2 MP2
- wants to make JSTL 1.0 work with WL 9.2 rather than upgrade to JSTL 1.1
here's what worked for me:
- login to bea.com. You will have to have a support level that allows you to download MP2.
- go to (tinyurl: http://tinyurl.com/3592vk) http://commerce.bea.com/support/supportversions.jsp?allversions=true&file=/managed_content/webapp/components/downloadcenter/products/weblogicserver/support/support.html
- click on "Maintenance Pack 2 Upgrade Installers for WebLogic Server 9.2"
- click the download link for your OS
- download the installer aka upgrader
- back up your commEnv.cmd if you've changed it (afaik that is the only file that is overwritten when you upgrade, but I'm not at all sure)
- run the upgrade program (this can take 30 mins)
- edit your web.xml and make the first two lines this (you may already have this):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
That's it. Now when you run weblogic, your *-el tag libraries should work as they did under WL8.x.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-342078-1-1.html 上篇帖子: 命令启动和停止weblogic 下篇帖子: weblogic JMX 中遇到的问题
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表