I have written a Spring MVC application and I’m having trouble deploying the application on both WebLogic and Tomcat. In both containers the errors are happening when Spring is configuring beans declared in the application context configuration file. Maybe someone can give me some suggestions as to what’s going wrong, as it looks like it should work to me.
I have packaged the web application in a WAR file, the contents of which look like this:
When I deploy the WAR on WebLogic I get the following error message:Code:$ jar -tf gets-diagnostics.war META-INF/ META-INF/MANIFEST.MF WEB-INF/ WEB-INF/classes/ WEB-INF/classes/com/ WEB-INF/classes/com/level3/ WEB-INF/classes/com/level3/gets/ WEB-INF/classes/com/level3/gets/diagnostics/ WEB-INF/classes/com/level3/gets/diagnostics/controllers/ WEB-INF/classes/com/level3/gets/diagnostics/controllers/DiagnosticsHomeController.class WEB-INF/classes/com/level3/gets/diagnostics/controllers/RemoteServicesDiagnosticsController.class WEB-INF/classes/com/level3/gets/diagnostics/controllers/WebServicesDiagnosticsController.class WEB-INF/classes/com/level3/gets/diagnostics/remoteservices/ WEB-INF/classes/com/level3/gets/diagnostics/remoteservices/RemoteServicesDiagnosticsException.class WEB-INF/classes/com/level3/gets/diagnostics/remoteservices/RemoteServicesDiagnosticsService.class WEB-INF/classes/com/level3/gets/diagnostics/remoteservices/models/ WEB-INF/classes/com/level3/gets/diagnostics/remoteservices/models/RemoteServicesDiagnosticsResults.class WEB-INF/classes/com/level3/gets/diagnostics/remoteservices/verifiers/ WEB-INF/classes/com/level3/gets/diagnostics/remoteservices/verifiers/AmtVerifier.class WEB-INF/classes/com/level3/gets/diagnostics/remoteservices/verifiers/ClarifyVerifier.class WEB-INF/classes/com/level3/gets/diagnostics/remoteservices/verifiers/Ds9Verifier.class WEB-INF/classes/com/level3/gets/diagnostics/remoteservices/verifiers/LidVerifier.class WEB-INF/classes/com/level3/gets/diagnostics/remoteservices/verifiers/NidVerifier.class WEB-INF/classes/com/level3/gets/diagnostics/utils/ WEB-INF/classes/com/level3/gets/diagnostics/utils/DataAccessUtil.class WEB-INF/classes/com/level3/gets/diagnostics/webservices/ WEB-INF/classes/com/level3/gets/diagnostics/webservices/WebServicesDiagnosticsException.class WEB-INF/classes/com/level3/gets/diagnostics/webservices/WebServicesDiagnosticsService.class WEB-INF/classes/com/level3/gets/diagnostics/webservices/models/ WEB-INF/classes/com/level3/gets/diagnostics/webservices/models/WebServicesDiagnosticsResults.class WEB-INF/classes/com/level3/gets/diagnostics/webservices/verifiers/ WEB-INF/classes/com/level3/gets/diagnostics/webservices/verifiers/GetHubClliDetailsVerifier.class WEB-INF/classes/com/level3/gets/diagnostics/webservices/verifiers/GetHubClliListVerifier.class WEB-INF/classes/com/level3/gets/diagnostics/webservices/verifiers/GetSalesMarketListVerifier.class WEB-INF/classes/com/level3/gets/diagnostics/webservices/verifiers/GetSelectiveRouterListVerifier.class WEB-INF/classes/com/level3/gets/diagnostics/webservices/verifiers/GetSelectiveRouterTgDetailsVerifier.class WEB-INF/classes/com/level3/gets/diagnostics/webservices/verifiers/MemberUpdateVerifier.class WEB-INF/classes/com/level3/gets/diagnostics/webservices/verifiers/MigrationUpdateVerifier.class WEB-INF/classes/com/level3/gets/diagnostics/webservices/verifiers/NsrUpdateVerifier.class WEB-INF/classes/com/level3/gets/diagnostics/webservices/verifiers/RetrieveCircuitDataVerifier.class WEB-INF/classes/diagnostics.properties WEB-INF/gets-diagnostics.appcontext-mvc.xml WEB-INF/gets-diagnostics.appcontext-service.xml WEB-INF/lib/ WEB-INF/lib/commons-logging.jar WEB-INF/lib/internalClients.jar WEB-INF/lib/jaxrpc.jar WEB-INF/lib/servlet-api-5.5.9.jar WEB-INF/lib/spring-1.2.3.jar WEB-INF/lib/weblogic-8.1.3.jar WEB-INF/lib/webservices-8.1.4.jar jsp/ jsp/diagnosticsHome.jsp jsp/include.jsp jsp/remoteServicesDiagnosticsResults.jsp jsp/webServicesDiagnosticsResults.jsp WEB-INF/web.xml
So when Spring is configuring the beans declared in the configuration file it croaks at the first bean declared in the file, complaining that it can’t find the class file for GetHubClliDetailsVerifier. However the class file is present where it should be, under WEB-INF/classes. Maybe I’m mistaken in assuming that WebLogic knows to look in WEB-INF/classes for class files, my understanding is that this is the standard place to locate class files in a web application.Code:Exception:weblogic.management.ApplicationException: start() failed. Module: gets-diagnostics Error: weblogic.management.DeploymentException: Error registering bean with name 'getHubClliDetailsVerifier' defined in ServletContext resource [/WEB-INF/gets-diagnostics.appcontext-service.xml]: Bean class [com.level3.gets.diagnostics.webservices.verifiers.GetHubClliDetailsVerifier] not found; nested exception is java.lang.ClassNotFoundException: com.level3.gets.diagnostics.webservices.verifiers.GetHubClliDetailsVerifier - with nested exception: [java.lang.ClassNotFoundException: com.level3.gets.diagnostics.webservices.verifiers.GetHubClliDetailsVerifier]
The configuration for this bean in the application context configuration file looks like so:
When I deploy the web application on Tomcat I get a different error, this time Tomcat complains that it can’t find the class for the WebLogic class XMLNode, which is present in a JAR file included in the WEB-INF/lib directory. Again my understanding is that this is the standard location that a servlet container uses for locating JAR files used in a web application. The error message from Tomcat is below:Code:<!-- Bean used for verifying the GetHubClliDetails web service --> <bean id="getHubClliDetailsVerifier" class="com.level3.gets.diagnostics.webservices.verifiers.GetHubClliDetailsVerifier"/>
As you can see in the WAR listing above the JAR containing weblogic.xml.xmlnode.XMLNode is present as WEB-INF/lib/weblogic-8.1.3.jar, so I would assume that Tomcat should be able to find it without error, but unfortunately that’s not happening.Code:org.springframework.beans.FatalBeanException: Could not instantiate class [com.level3.gets.diagnostics.webservices.verifiers.GetHubClliDetailsVerifier]; constructor threw exception; nested exception is java.lang.NoClassDefFoundError: weblogic/xml/xmlnode/XMLNode
If anyone can give me any insight as to what is happening here I’ll certainly appreciate your help!
--James


Reply With Quote