Results 1 to 5 of 5

Thread: Mysterious Spring Configuration Errors

  1. #1
    Join Date
    Dec 2004
    Location
    Asheville, NC
    Posts
    82

    Default 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. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Dec 2004
    Location
    Asheville, NC
    Posts
    82

    Default

    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

  4. #4
    Join Date
    May 2005
    Posts
    13

    Default 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

  5. #5
    Join Date
    Apr 2005
    Location
    Philippines
    Posts
    35

    Default

    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.

Similar Threads

  1. Replies: 5
    Last Post: Aug 9th, 2008, 05:30 AM
  2. Gaijin Studio for Spring MVC 0.9.2 Released
    By dadams in forum Announcements
    Replies: 8
    Last Post: May 30th, 2007, 10:48 PM
  3. A Spring Class Loader?
    By azzoti in forum Architecture
    Replies: 8
    Last Post: May 7th, 2005, 04:02 AM
  4. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  5. Replies: 5
    Last Post: Aug 27th, 2004, 07:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •