我在网上找了许多资料,大多数都让使用更改应用中模块管理,使父类最后加载的方式,但我的应用尝试后,可以正常启动,但程序没有被运行(我在程序初始化时打印了日志),并且我也尝试了过以下解决办法
1、删除 IBM \ WebSphere \ AppServer \ plugins \ org.apache.axis2.jar(出现was无法启动问题)
2、将modules目录下的mar包都拷贝一份到lib下,然后都重新命名扩展名为jar的方法(仍出出现该异常)
3、接口本身使用的是commons-fileupload-1.2.jar,将其改成与was相同的1.3版本,或者删除war包中的该文件,都没有任何效果
4、使用共享库,让接口调用的jar包放到共享库,让指定应用进行引用,并删除war包中的jar文件,该方式也不可行
这几种方式都没有解决该jar冲突的问题,求高手指点,还有哪些办法可以解决的。
下面详细异常日志:
org.apache.axis2.deployment.DeploymentException: org.apache.commons.fileupload.FileUploadException
at org.apache.axis2.deployment.AxisConfigBuilder.processMessageBuilders(AxisConfigBuilder.java:741)
at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:202)
at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:641)
at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:116)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:68)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:184)
at com.carrefour.tplinux.client.AccountManagement.request(AccountManagement.java:28)
at com.carrefour.integrate.thread.ResetPasswordTh.callInterface(ResetPasswordTh.java:189)
at com.carrefour.integrate.thread.ResetPasswordTh.queryAndCallInterface(ResetPasswordTh.java:135)
at com.carrefour.integrate.thread.ResetPasswordTh.run(ResetPasswordTh.java:61)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:736)
Caused by:
java.lang.NoClassDefFoundError: org.apache.commons.fileupload.FileUploadException
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:72)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:134)
at java.lang.Class.newInstancePrototype(Class.java:1356)
at java.lang.Class.newInstance(Class.java:1345)
at org.apache.axis2.deployment.DescriptionBuilder.processMessageBuilders(DescriptionBuilder.java:230)
at org.apache.axis2.deployment.AxisConfigBuilder.processMessageBuilders(AxisConfigBuilder.java:738)
... 12 more
Caused by:
java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileUploadException
at java.lang.Throwable.<init>(Throwable.java:80)
at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:76)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:351)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
... 19 more
把commons-fileupload-1.2.jar放到webspher jdk的lib目录下,让他先加载,就保证你希望的class首先初始化了
websphere jar的加载顺序 JDK;WAS LIB; WEB LIB
这种方法之前已经尝试,出现问题,如果WebSphere 的lib下多了commons-fileupload-1.2.jar这个包后,WebSphere服务器就无法重启了