weblogic summing-up for SIT

[color=blue]1.Cannot contain comments in tag-class when describe a tag.[/color]
<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.

[color=blue]2.Remote debug(weblogic/eclipse)[/color]
(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.

[color=blue]3. the usage of html:multibox in weblogic environment[/color]
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.

[color=blue]4.java.util.ConcurrentModificationException[/color]
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.

[color=blue]5. weblogic bundling an old version of Rhino inside weblogic.jar[/color]
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!!

[color=blue]6.java.sql.Timestamp.compareTo(java.util.Date) the parameter is not a instance of java.sql.Timestamp.[/color]
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

[color=blue]7. the usage of getRealPath(String)[/color]
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. [color=blue]Caused by: weblogic.descriptor.BeanAlreadyExistsException: Bean already exists:[/color]
"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>


[color=blue]9.Weblogic cannot support el properly.[/color]
<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.
發佈了31 篇原創文章 · 獲贊 0 · 訪問量 1164
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章