Announcement Announcement Module
Collapse
No announcement yet.
Mysterious Spring Configuration Errors Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mysterious Spring Configuration Errors

    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:

    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
    When I deploy the WAR on WebLogic I get the following error message:

    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]
    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.

    The configuration for this bean in the application context configuration file looks like so:
    Code:
        <!-- Bean used for verifying the GetHubClliDetails web service -->
        <bean id="getHubClliDetailsVerifier"
              class="com.level3.gets.diagnostics.webservices.verifiers.GetHubClliDetailsVerifier"/>
    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:
    org.springframework.beans.FatalBeanException&#58; Could not instantiate class &#91;com.level3.gets.diagnostics.webservices.verifiers.GetHubClliDetailsVerifier&#93;; constructor threw exception; nested exception is java.lang.NoClassDefFoundError&#58; weblogic/xml/xmlnode/XMLNode
    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.

    If anyone can give me any insight as to what is happening here Iíll certainly appreciate your help!


    --James

  • #2
    Your package structure look okay. Make sure there are no weblogic/your classes packed in a different jar somewhere else in your classpath or in a different webapps that might confuse the container.
    Make sure you have the approapriate ownerships and rights over the jar (especially in Linux) and place them from WEB-INF inside shared/lib (in Tomcat).
    Take it step by step - for sure you have some classpath problems.

    Comment


    • #3
      I'm using Java 1.4 to run Weblogic and I was using Java 1.5 to build the Spring MVC project in Eclipse. After rebuilding the project in Eclipse using Java 1.4 I am having better luck.

      I still can't figure out why Tomcat can't find the XMLNode class, since it is included in the in WEB-INF/lib/weblogic.jar, but I don't really need to deploy in Tomcat so that is a non-issue now that the WebLogic deployment is working.


      --James

      Comment


      • #4
        Mysterious Spring Configuration Errors

        I've also had problems with class not found using weblogic--no idea why it's happening, yet. As to Tomcat, later versions (not sure when this came 5??) won't load a jar file which contains standard APIs (javax.servlet.*) as weblogic.jar does. HTH

        mike

        Comment


        • #5
          The first exception:

          Code:
          Error&#58; weblogic.management.DeploymentException&#58; Error registering bean with name 'getHubClliDetailsVerifier' defined in ServletContext resource &#91;/WEB-INF/gets-diagnostics.appcontext-service.xml&#93;&#58; Bean class &#91;com.level3.gets.diagnostics.webservices.verifiers.GetHubClliDetailsVerifier&#93; not found; nested exception is java.lang.ClassNotFoundException&#58; com.level3.gets.diagnostics.webservices.verifiers.GetHubClliDetailsVerifier - with nested exception&#58; &#91;java.lang.ClassNotFoundException&#58; com.level3.gets.diagnostics.webservices.verifiers.GetHubClliDetailsVerifier&#93;


          is NOT because the class com.level3.gets.diagnostics.webservices.verifiers. GetHubClliDetailsVerifier is NOT found. It is because your code inside this class is accessing some other class that is NOT found.

          I suggest you review this class and check if you are not refering to any other class that may not be in the classpath.

          Comment

          Working...
          X