2009年6月23日

在IBM的JDK环境下进行JVM内存监控的问题

错误信息如下:
java.lang.NoClassDefFoundError: sun.management.ManagementFactory

处理:

sun.management.ManagementFactory替换成java.lang.management.ManagementFactory  

因为ibmjdk没有sun.management.ManagementFactory这个对象

posted @ 2010-11-25 12:01 JGAO编程随笔 阅读(535) | 评论 (0)编辑 收藏

oracel PreparedStatement的setString问题

错误信息如下:

超过最大长度限制

处理:

只能插入666个中文字符。


或者更新到最新的
oracle驱动包

posted @ 2010-11-25 12:00 JGAO编程随笔 阅读(244) | 评论 (0)编辑 收藏

servicemix部署到websphere中,需注意的问题

1derby.jar包可能冲突,需删除项目中的该包

2MBean调用问题

   Websphere的MBean注册路径包括cell,nodeName和processName,具体可以铜鼓jconsole连接来查看MBean注册的全路径。这三个值可以通过Websphere的com.ibm.websphere.management.AdminServiceFactory这个对象来获取,spring中的配置如下:
<!-- 用于获取websphereMBean名称的cell,node,process -->

<bean id="adminService" class="com.ibm.websphere.management.AdminServiceFactory" factory-method="getAdminService"/>

<bean id="adminService.cellName" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/>

<bean id="adminService.nodeName" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/>

<bean id="adminService.processName" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/>

<bean id="websphereNamingStrategy" class="com.des.engine.mbean.WebsphereNamingStrategy">

<property name="cellName" ref="adminService.cellName"/>

<property name="nodeName" ref="adminService.nodeName"/>

<property name="processName" ref="adminService.processName"/>

</bean>

WebsphereNamingStrategy为自己创建的对象就包括那三个属性

3:安全问题

出现如下错误,Caused by: javax.management.JMRuntimeException: ADMN0022E: 由于凭证不足或凭证为空,无法对 org.apache.servicemix:Name=ServiceMgtImpl,cell=dvpbNode02Cell,Type=SystemService,ContainerName=ServiceMix,node=dvpbNode02,process=server1 MBean  retrieveServiceList 操作进行访问。

    该问题是因为设置了安全控制,把控制台的【安全性->安全管理、应用程序和基础结构】里面的所以安全配置都去掉,然后重新启动服务器主机(注意是重启主机,不然安全设置不起作用),再启动websphere服务应该就可以了,还有就是servicemix的应用要跟websphere一起启动,不要等websphere启动后再到控制台启动

posted @ 2010-11-25 11:58 JGAO编程随笔 阅读(872) | 评论 (2)编辑 收藏

ResultSet内存溢出OutOfMemory问题

错误信息如下:

jdbc在操作oracle海量数据的时候用ResultSet获取所有的返回数据出现内存溢出

处理:
出错的原因是ResultSet用的是可滚动结果集,正常情况下ResultSet是指针指向数据库的数据,本身是不存储数据库的数据的,默认情况下就算是提交的sql能查询处上亿条的数据也是不消耗内存的,但是如果用的是可滚动结果集的ResultSet情况就不一样了,ORACLE 是不支持可滚动结果集的,那么我们用JDBC得到一个可滚动的结果集就是由JDBC自己支持的,也就是说结果集是要存放在内存中的,所以在海量数据的情况下也就是要消耗大量内存的,因此造成内存溢出也就是正常的了,所以如果是海量数据的话就不要用可滚动结果集就可以了。

posted @ 2009-06-23 21:19 JGAO编程随笔 阅读(2056) | 评论 (0)编辑 收藏

com.ibm.websphere.ce.cm.StaleConnectionException: [ibm][db2][jcc][t4][2030][11211] 检测到了通信错误

错误信息如下:

com.ibm.websphere.ce.cm.StaleConnectionException: [ibm][db2][jcc][t4][2030][11211]

检测到了通信错误。所使用的通信协议:TCP/IP"n所使用的通信 APISOCKETS

检测到错误的位置:Reply.fill()"n用于检测错误的通信功能:InputStream.read()

特定于协议的错误代码数据不足、 0。消息:null"n   

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)"n     

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)"n    at

sun.reflect.DelegatingConstructorAccessorImpl.newInstance

(DelegatingConstructorAccessorImpl.java:45)"n

at java.lang.reflect.Constructor.newInstance(Constructor.java:522)"n  

at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapExceptionHelper

(GenericDataStoreHelper.java:523)"n   

at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapException(GenericDataStoreHelper.java:578)"n      

at com.ibm.ws.rsadapter.jdbc.WSJdbcUtil.mapException(WSJdbcUtil.java:909)"n 

at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.executeQuery(WSJdbcStatement.java:898)"n   

at com.newland.bi.util.db.DBUtil.executeQuery(Unknown Source)"n

at com.newland.bi.util.db.DBUtil.executeSql(Unknown Source)"n     

at com.newland.bi.dao.jdbc.DaoImpl.executeQuery(DaoImpl.java:64)"n   

at com.newland.bi.service.report.exp.dao.ReportExpDao.getExpList(ReportExpDao.java:72)"n 

at com.newland.bi.service.report.exp.manage.ReportExpMgt.runExport(ReportExpMgt.java:91)"n   

at com.newland.bi.service.report.exp.servlet.ReportExp1Servlet$1.run(ReportExp1Servlet.java:97)"n      

at java.util.TimerThread.mainLoop(Timer.java:537)"n       at java.util.TimerThread.run(Timer.java:487)"n

处理:

出错的原因可能是防火墙问题,websphere应用服务器和数据库服务器之间是否存在防火墙

防火墙是否会设置多久没活动的连接就自动断开掉,如果是这样的话就会有问题,因为websphere上面的数据库连接池可能有一段时间没连接而被防火墙断掉了

但对于连接池本身根本就不知道该连接是否还可用,所以web应用从连接池获取的连接可能就是已经断开的了,所以就可能会出现日记中的错误问题


 

posted @ 2009-06-23 21:14 JGAO编程随笔 阅读(7350) | 评论 (1)编辑 收藏

Timer.schedule和Timer.scheduleAtFixedRate的区别

schedulescheduleAtFixedRate的区别在于,如果指定开始执行的时间在当前系统运行时间之前,scheduleAtFixedRate会把已经过去的时间也作为周期执行,而schedule不会把过去的时间算上。

posted @ 2009-06-23 21:13 JGAO编程随笔 阅读(984) | 评论 (0)编辑 收藏

cxf找不到类org.apache.axis.soap.MessageFactoryImpl出错

 

错误信息如下:

Caused by: java.lang.ClassNotFoundException: org.apache.axis.soap.MessageFactoryImpl

    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

    at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:50)

    ... 10 more

处理:

原因是调用了axis soap.MessageFactoryImpl,cxf应该用的是sun
     在注册安全拦截器之前执行下面代码就可以了

System.setProperty("javax.xml.soap.MessageFactory", "com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl");

posted @ 2009-06-23 21:10 JGAO编程随笔 阅读(1211) | 评论 (0)编辑 收藏

<2009年6月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

导航

统计

常用链接

留言簿(1)

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜