简体   繁体   中英

WebSphere classloader is it different then in tomcat?

我有使用classloader在纯Java中正常工作的代码现在在Websphere 8中安装相同的应用程序时,相同的代码给我例外

It appears that the Google code is assuming a URLClassLoader as its input (despite the fact that it takes a more general ClassLoader argument). That may be an appropriate assumption for Tomcat, but it is not an appropriate assumption for WebSphere - its application class loaders are a ClassLoader implementation that does not extend URLClassLoader.

Tomcat is a light webcontainer server, it will accept nearly every Java application and run it just fine.

WebSphere on the other hand, is a much more advanced product, an enterprise solution. WebSphere includes many libraries, often optimized by IBM, and offers many plugins.

It means that your application has to be compatible with it and not every Tomcat Java application will be running on WebSphere without making changes to the App, or choosing right Classloader policies, or both.

To get more help you need to post more details: error logs, code examples, steps to replicate etc.

Here is a free ebook from IBM, on Websphere classloaders: http://www.redbooks.ibm.com/redpapers/pdfs/redp4581.pdf

This ebook refers to Websphere7 but it is fine for Websphere8 also.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM