1、调整JVM在bin.bat或bin/run.cfg文件里。
-Xms<size>设置堆的最小值;-Xmx<size>设置堆的最大值;-XX:Newsize=<size>设置年轻代的最小值;-XX:MaxNewsize=<size>设置年轻代的最大值;-XX:MaxPermSize=size设置永久代的大小。
2、配置数据源:在*-ds.xml里<min-pool-size>最小连接数;<max-pool-size>最大连接数。
3、配置HTTP请求线程池deployer/jbossweb.sar/server.xml:maxTreads最大线程;minSpareThreads超过现在用线程的数量;maxSpareThreads超过这个数量的空闲数量的线程将被关闭;accpetCount排除等待一个线程空闲的最大请求数。
4、调整jspservlet/jbossweb.deployer/web.xml里development为true应用服务器会查看jsp是否使用修改文本间隔进行更新了,为false,修改的jsp会使用检查间隔在后台被编译。checkInterval查看jsp是否需要被重新编译的检查间隔秒数,如果为0里,jsp不会因为修改或重新编译而被查看。
5、删除不需要的服务。
邮件服务:server/xxx/deply/mail-service.xml,server/xxx/lib/mail*.jar
调试程序服务:service server/xxx/deploy/scheduler-service.xml,server/xxx/deploy/schedule-manager-service.xml,server/xxx/lib/cheduler-plugin*.jar
监视服务:service server/xxx/deploy/monitoring-service.xml,server/xxx/lib/Jboss-monitoring.jar
消息发送(JMS):server/xxx/deploy/meassaging,server/xxx/deploy/jms-ra.jar,server/xxx/lib/jboss-message*.jar
唯一ID键生成器:server/xxx/deploy/uuid-key-generator.sar,server/xxx/lib/automumber-plugin.jar
HTTP调用程序服务:server/xxx/deploy/http-invoker.sar,server/xxx/httpha-invoker.sar(仅在all配置中)
主页:server/xxx/deploy/root.war
JMX控制台:server/xxx/deploy/jmx-console.war
Web控制台:server/xxx/deploy/management
Quartz调试程序服务:server/xxx/deploy/quartz-ra.rar
问题描述:WAS 8.5在AIX上因缺少相应的组件包,而无法启动图形化概要管理工具WCT或PMT
错误信息:在执行 $WAS_HOME/bin/ProfileManagement/ 目录下的 wct.sh 或 pmt.sh 时,报如下错误:
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
/.ibm/WebSphere/AppServer/configurations/WCT85/org.eclipse.osgi/bundles/51/1/.cp/libswt-pi-gtk-3659.a (A file or directory in the path name does not exist.)
swt-pi-gtk (Not found in java.library.path)
/tmp/swtlib-64/libswt-pi-gtk-3659.a (A file or directory in the path name does not exist.)
/tmp/swtlib-64/libswt-pi-gtk.a (A file or directory in the path name does not exist.)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:267)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:174)
at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:228)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:132)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:228)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:687)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
at com.ibm.ws.pmt.tools.WasToolApplication.run(WasToolApplication.java:190)
at com.ibm.ws.pmt.views.standalone.StandAloneToolApplication.run(StandAloneToolApplication.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
执行ldd验证所需要的类库是否存在
ldd /.ibm/WebSphere/AppServer/configurations/WCT85/org.eclipse.osgi/bundles/55/1/.cp/libswt-pi-gtk-3659.a
/.ibm/WebSphere/AppServer/configurations/WCT85/org.eclipse.osgi/bundles/55/1/.cp/libswt-pi-gtk-3659.a needs:
Cannot find libgdk-x11-2.0.a(libgdk-x11-2.0.so.0)
Cannot find libglib-2.0.a(libglib-2.0.so.0)
Cannot find libgtk-x11-2.0.a(libgtk-x11-2.0.so.0)
/usr/lib/libc.a(shr_64.o)
Cannot find libgobject-2.0.a(libgobject-2.0.so.0)
Cannot find libpango-1.0.a(libpango-1.0.so.0)
Cannot find libgdk_pixbuf-2.0.a(libgdk_pixbuf-2.0.so.0)
Cannot find libgthread-2.0.a(libgthread-2.0.so.0)
/usr/X11R6/lib/libX11.a(shr_64.o)
/usr/X11R6/lib/libXtst.a(shr_64.o)
/unix
/usr/lib/libcrypt.a(shr_64.o)
/usr/lib/libiconv.a(shr4_64.o)
/usr/lib/libIM.a(shr_64.o)
/usr/lib/libpthreads.a(shr_xpg5_64.o)
/usr/X11R6/lib/libXext.a(shr_64.o)
/usr/lib/libgaimisc.a(shr_64.o)
/usr/lib/libgair4.a(shr_64.o)
/usr/lib/libodm.a(shr_64.o)
问题所在:于是,可以明确知道是缺少类包导致的。
通过rpm查看相关安装类包情况
rpm -qa
cdrecord-1.9-7
mkisofs-1.13-4
AIX-rpm-6.1.6.0-1
tcl-8.4.7-3
tk-8.4.7-3
expect-5.42.1-3
wget-1.9.1-1
少了不少相关所需要的组件包,下载之
ftp://public.dhe.ibm.com/aix/fre ... .3-2.aix5.2.ppc.rpm
ftp://public.dhe.ibm.com/aix/fre ... .8-1.aix5.2.ppc.rpm
ftp://public.dhe.ibm.com/aix/fre ... .1-1.aix5.2.ppc.rpm
ftp://public.dhe.ibm.com/aix/fre ... .2-1.aix5.2.ppc.rpm
ftp://public.dhe.ibm.com/aix/fre ... .9-1.aix5.2.ppc.rpm
ftp://public.dhe.ibm.com/aix/fre ... 40-6.aix5.1.ppc.rpm
ftp://public.dhe.ibm.com/aix/fre ... .4-2.aix5.2.ppc.rpm
ftp://public.dhe.ibm.com/aix/fre ... .6-4.aix5.2.ppc.rpm
ftp://public.dhe.ibm.com/aix/fre ... 6b-6.aix5.1.ppc.rpm
ftp://public.dhe.ibm.com/aix/fre ... 32-2.aix5.2.ppc.rpm
ftp://public.dhe.ibm.com/aix/fre ... .2-1.aix5.2.ppc.rpm
ftp://public.dhe.ibm.com/aix/fre ... .5-4.aix5.2.ppc.rpm
ftp://public.dhe.ibm.com/aix/fre ... .7-3.aix5.2.ppc.rpm
ftp://public.dhe.ibm.com/aix/fre ... .6-5.aix5.1.ppc.rpm
这两天追一个bug是因为onActivityResult没有被回调,所以把startActivityForResult和onActivityResult的理解简单总结下。
Intent intent = new Intent();
intent.putExtra(ActivityManagerMemoryClassLaunchActivity.MEMORY_CLASS_EXTRA,memoryClass);
setActivityIntent(intent);
ActivityManagerMemoryClassLaunchActivity activity = getActivity();(调用这个函数之后会启动该activity)
就会调用ActivityManagerMemoryClassLaunchActivity的onCreate函数,如下:
public classActivityManagerMemoryClassLaunchActivity extends Activity {
public static final StringMEMORY_CLASS_EXTRA = "activityMemoryClass";
private static final int TEST_ACTIVITY_REQUEST_CODE= 1337;
private final CountDownLatch mLatch = newCountDownLatch(1);
private int mChildResult = RESULT_CANCELED;
private static final String TAG ="ActivityManagerMemoryClassLaunchActivity";
@Override
protected void onCreate(BundlesavedInstanceState) {
super.onCreate(savedInstanceState);
// Start the activity that runs in aseparate process to do the actual testing,
// since the test itself cannot startan activity in a separate process. A separate
// process is used to avoid includingthe overhead of the test instrumentation process.
Intent intent = getIntent();
int memoryClass =intent.getIntExtra(MEMORY_CLASS_EXTRA, -1);
Intent testIntent = new Intent(this,ActivityManagerMemoryClassTestActivity.class);
testIntent.putExtra(MEMORY_CLASS_EXTRA,memoryClass);
Log.d(TAG, "onCreate-------> resultCode="+ TEST_ACTIVITY_REQUEST_CODE);
startActivityForResult(testIntent,TEST_ACTIVITY_REQUEST_CODE);(执行该语句会调用ActivityManagerMemoryClassTestActivity)
}
@Override
protected void onActivityResult(intrequestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode,resultCode, data);
if (requestCode == 1337) {
synchronized (this) {
Log.d(TAG," onActivityResult-------> resultCode="+ resultCode);
mChildResult = resultCode;
}
} else {
throw newIllegalStateException("Request code: " + requestCode);
}
}
ActivityManagerMemoryClassTestActivity:
/**
* {@link Activity} that allocates arrays of256k until reaching 75% of the specified memory class.
*/
public classActivityManagerMemoryClassTestActivity extends Activity {
private static final String TAG ="ActivityManagerMemoryClassTest";
private static final doubleFREE_MEMORY_PERCENTAGE = 0.75;
private static final int ARRAY_BYTES_SIZE =256 * 1024;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
Intent intent = getIntent();
int memoryClass =
intent.getIntExtra(ActivityManagerMemoryClassLaunchActivity.MEMORY_CLASS_EXTRA,-1);
new AllocateMemoryTask(memoryClass).execute();
}
private class AllocateMemoryTask extendsAsyncTask<Void, Void, Void> {
private final int mMemoryClass;
AllocateMemoryTask(int memoryClass) {
this.mMemoryClass = memoryClass;
}
@Override
protected Void doInBackground(Void...params) {
int targetMbs = (int) (mMemoryClass* FREE_MEMORY_PERCENTAGE);
int numArrays = targetMbs * 1024 *1024 / ARRAY_BYTES_SIZE;
Log.i(TAG, "Memory class:" + mMemoryClass + "mb Target memory: "
+ targetMbs + "mbNumber of arrays: " + numArrays);
byte[][] arrays = newbyte[numArrays][];
for (int i = 0; i <arrays.length; i++) {
Log.i(TAG, "Allocatingarray " + i + " of " + arrays.length
+ " (" + (i *ARRAY_BYTES_SIZE / 1024 / 1024) + "mb)");
arrays[i] = newbyte[ARRAY_BYTES_SIZE];
}(我遇到的问题是在这里new空间的时候fail了,所以一直没有return,导致没有执行finish(),所以没有回调onActivityResult。而这里之所以new失败了,是因为vm.heapsize的设置不太对,关于修改vm.heapsize,可见我的另一篇博文http://blog.csdn.net/holdrise/article/details/8476352)
Log.i(TAG,"doInBackground ");
return null;
}
@Override
protected void onPostExecute(Voidresult) {
Log.i(TAG, "onPostExecutecome in come in come in ");
super.onPostExecute(result);
setResult(RESULT_OK);
Log.i(TAG, "onPostExecutefinish-------------------- ");
finish();(执行完finish之后,会跳回执行之前activity的onActivityResult函数)
}
}
}
第二个activity起来的时候前一个activity的状态会变成paused。
关于onActivityResult的理解我也参考了如下的博文:
http://blog.csdn.net/ghd2000/article/details/5716894
http://elvajxw.iteye.com/blog/883612