Steve
Steve

Reputation: 2720

How can I disable WebSphere 8.5 classpath scanning completely?

Is there some way that I can tell a WebSphere 8.5 server to not scan the classpath of my web app as it loads? We're migrating an app from WAS version 6.1 to WAS 8.5. In the 6.1 version, WAS did not scan the classpath, and perform resource injection. We used Spring to do the resource injection for our app in 6.1. Now, we get to 8.5, and the WAS server is trying to scan the classes as they're loaded, which causes problems with our app configuration.

I'd really like a way to disable WAS from doing the scanning, and let our Spring configuration continue to handle resource injection for our app. Does anyone know how to go about this?

I've tried the following:

  1. Use the "Ignore-Scanning-Packages" setting in the EAR manifest to disable scanning for our packages (this seems to have no effect)
  2. Use the "UseEJB61FEPScanPolicy" setting on the server (and in the EAR manifest) to get WAS to do things the old way (this also has no effect)

Any clues or other things I might try?

Thanks

Upvotes: 3

Views: 2045

Answers (1)

Minh Khoi
Minh Khoi

Reputation: 115

I'm not sure this one can work in your case or not, but actually, scanning resource injection is only available from server version 2.5. So a quick way to avoid Websphere to scan your project is in the web.xml file, you set the root tag like this

<web-app version="2.4">

In case you still want to use server version 3.0, you also can add metadata-complete="true" into the root tag, this one will tell Websphere to not scan your project at all.

Example:

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" metadata-complete="true" version="3.0">

Upvotes: 1

Related Questions