websphere4 配置过程中遇到的问题
1.admin.config 中配置oracle driver 的classpath
-Dws.ext.dirs=
连接不上oracle数据库,报java.sql.SQLException: ORA-01453: SET TRANSACTION 必须是事务处理的第一个语句错误
[08.06.06 15:50:48:622 CST] 7a4489 EJBEngine X WSVR0062E:未能启动 EJB,admin#repository.jar#Node:org.omg.CORBA.portable.UnknownException: minor code: 0 completed: Maybe
[08.06.06 15:50:50:554 CST] 7a4489 EJBEngine I WSVR0037I:正在启动 EJB jar:Tasks
[08.06.06 15:50:51:329 CST] 7a4489 Helpers W NMSV0610I: NamingException 从javax.naming.Context 实现中抛出。详细信息请参照:
上下文实现:com.ibm.ejs.ns.jndi.CNContextImpl
上下文方法:lookup
上下文名:domainRoots/UnspecifiedDomainName/legacyRoot
目标名:ejsadmin/homes/NodeHome
其它数据:
异常堆栈跟踪:javax.naming.NamingException: Error during resolve. Root exception is org.omg.CORBA.portable.UnknownException: minor code: 0 completed: Maybe
使用合适的oracle driver,比如4.0需要用oracle8的class12.jar才行
2.websphere能够启动后,通过/bin/adminclient.sh配置应用和datasource
1)资源配置jdbc 供应商
2)企业应用程序-》右键安装企业应用=》选择一个空的ear文件
webspherejvm设置
adminclient->节点->avgg1->应用服务器->Default Server
-Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Dclient.encoding.override=UTF-8 -Duser.language=zh -Duser.region=CN
3.解析get/post参数时报错:
[08.06.11 14:32:38:143 CST] 24ed99 SRTServletRes W Failed to create a writer with encoding: GB2312. The default encoding will be used.
[08.06.11 14:32:44:328 CST] 24ed99 WebGroup X Servlet Error: : java.lang.IllegalArgumentException
at com.ibm.servlet.engine.webapp.RequestUtils.parseQueryString(RequestUtils.java:256)
通过反编译websphere源代码找到问题原因,代码在WS_HOME/lib/webcontainer.jar中
com.ibm.servlet.engine.srt.STRRequestUtils 装在converter.properties文件
负责获取编码
public static String getJvmConverter(String s)
{
String s1 = _jvmProps.getProperty(s);
if(s1 != null)
return s1;
else
return s;
}
STRServletRequest#
public String getReaderEncoding()
{
String s = getCharacterEncoding();
if(s == null)
s = SRTRequestUtils.getEncodingFromLocale(getLocale());
if(s == null)
s = System.getProperty("default.client.encoding");
if(s == null)
s = "ISO-8859-1";
return SRTRequestUtils.getJvmConverter(s);
}
需要配置/properties/converter.properties
GB2312=Cp1386 改为GB2312=Gb2312