I am currently attempting to run a very simple Spring application in RAD 9, on the local Websphere 8.5 Liberty profile. The code is from this site: http://ift.tt/1yJE2ow
I'm using Maven. Here's my pom.xml:
<project xmlns="http://ift.tt/IH78KX" xmlns:xsi="http://ift.tt/ra1lAU"
xsi:schemaLocation="http://ift.tt/IH78KX http://ift.tt/HBk9RF">
<modelVersion>4.0.0</modelVersion>
<groupId>com.pncbank.cdd</groupId>
<artifactId>cddsample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>cddsample Maven Webapp</name>
<url>http://ift.tt/19pvvEY;
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.1.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.1.5.RELEASE</version>
<exclusions>
<exclusion>
<artifactId>spring-aop</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.5.RELEASE</version>
<exclusions>
<exclusion>
<artifactId>spring-aop</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.1.5.RELEASE</version>
</dependency>
</dependencies>
<build>
<finalName>cddsample</finalName>
</build>
<packaging>war</packaging>
</project>
There is a very simple view in WEB-INF/views. The controller is defined in the Java classes The Spring DispatcherServlet is configured in web.xml as described in the tutorial mentioned above:
HelloWorldController.java
package com.programcreek.helloworld.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class HelloWorldController {
String message = "Welcome to Spring MVC!";
public HelloWorldController(){
int i = 5;
}
@RequestMapping("/hello")
public ModelAndView showMessage(
@RequestParam(value = "name", required = false, defaultValue = "World") String name) {
System.out.println("in controller");
ModelAndView mv = new ModelAndView("helloworld");
mv.addObject("message", message);
mv.addObject("name", name);
return mv;
}
}
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://ift.tt/HeF78r">
<web-app>
<display-name>Archetype Created Web Application</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/dispatcher-servlet.xml</param-value>
<description/>
</context-param>
<servlet>
<servlet-name>DispatcherServlet</servlet-name>
<display-name>DispatcherServlet</display-name>
<description/>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>DispatcherServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
I have arrived at a point where the application will run, and I can visit a simple index.jsp. However, any other route leads to the error below.
I have found many questions and posts dealing with this particular error, but no real help diagnosing or resolving it. I have reviewed all the dependencies of the DispatcherServlet and, as far as I can tell, they're all present in the jar file that is deployed. Any guidance would be greatly appreciated!! TIA!
Error 404: javax.servlet.UnavailableException: SRVE0203E: Servlet [DispatcherServlet]: org.springframework.web.servlet.DispatcherServlet was found, but is missing another required class. SRVE0206E: This error typically implies that the servlet was originally compiled with classes which cannot be located by the server. SRVE0187E: Check your class path to ensure that all classes required by the servlet are present.SRVE0210I: This problem can be debugged by recompiling the servlet using only the classes in the application's runtime class path SRVE0234I: Application class path=[C:\Program Files\IBM\WebSphere\AppServer\java\lib;C:\Program Files\IBM\WebSphere\AppServer\java\lib\dt.jar;C:\Program Files\IBM\WebSphere\AppServer\java\lib\htmlconverter.jar;C:\Program Files\IBM\WebSphere\AppServer\java\lib\ibmorbtools.jar;C:\Program Files\IBM\WebSphere\AppServer\java\lib\jconsole.jar;C:\Program Files\IBM\WebSphere\AppServer\java\lib\tools.jar;C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv1\classes;C:\Program Files\IBM\WebSphere\AppServer\classes;C:\Program Files\IBM\WebSphere\AppServer\lib;C:\Program Files\IBM\WebSphere\AppServer\lib\COBOLCallStubGenerator.zip;C:\Program Files\IBM\WebSphere\AppServer\lib\EJBCommandTarget.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\IVTClient.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\OTiSConvertTime.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\activation-impl.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\admin.config.jobcl.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\admin.config.rules.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\admin.config.sched.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\aspectjrt.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\batch.wccm.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\batchpmi.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\batchprops.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\batchutilsfep.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\batfepapi.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\bootstrap.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\bsf-engines.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\com.ibm.rls.jdbc.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\commandlineutils.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\commons-discovery.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\databeans.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\ffdcSupport.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\htmlshell.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\iscdeploy.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\j2ee.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\jNative2ascii.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\jacl.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\jrom.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\launchclient.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\lmproxy.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\mail-impl.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\openwebbeans.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\pc-appext.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\pmirm4arm.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\rrd-appext.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\rsadbutils.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\rsahelpers.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\serviceadapter.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\setup.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\startup.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\tcljava.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\urlprotocols.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\wasservicecmd.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\wses_dynaedge.jar;C:\Program Files\IBM\WebSphere\AppServer\lib\wsif-compatb.jar;C:\Program Files\IBM\WebSphere\AppServer\installedChannels;C:\Program Files\IBM\WebSphere\AppServer\web\help;C:\Program Files\IBM\WebSphere\AppServer\deploytool\itp\plugins\com.ibm.etools.ejbdeploy\runtime;C:\Program Files\IBM\WebSphere\AppServer\deploytool\itp\plugins\com.ibm.etools.ejbdeploy\runtime\batch.jar;C:\Program Files\IBM\WebSphere\AppServer\deploytool\itp\plugins\com.ibm.etools.ejbdeploy\runtime\ejbdeploy.jar;C:\Program Files\IBM\WebSphere\AppServer\deploytool\itp\plugins\com.ibm.etools.ejbdeploy\runtime\ejbmapvalidate.jar;C:\Program Files\IBM\WebSphere\AppServer\derby\lib\derby.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\sib.api.jmsra.rar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.commonservices.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.connector.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.headers.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.jmqi.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.jmqi.local.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.jmqi.remote.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.jmqi.system.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.jms.admin.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.pcf.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mqjms.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.msg.client.commonservices.j2se.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.msg.client.commonservices.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.msg.client.jms.internal.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.msg.client.jms.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.msg.client.matchspace.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.msg.client.provider.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.msg.client.ref.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.msg.client.wmq.common.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.msg.client.wmq.factories.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.msg.client.wmq.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.msg.client.wmq.v6.jar;C:\Program Files\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\dhbcore.jar;C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv1/properties;C:\Program Files\IBM\WebSphere\AppServer/properties;C:\Program Files\IBM\WebSphere\AppServer/lib/startup.jar;C:\Program Files\IBM\WebSphere\AppServer/lib/bootstrap.jar;C:\Program Files\IBM\WebSphere\AppServer/lib/jsf-nls.jar;C:\Program Files\IBM\WebSphere\AppServer/lib/lmproxy.jar;C:\Program Files\IBM\WebSphere\AppServer/lib/urlprotocols.jar;C:\Program Files\IBM\WebSphere\AppServer/deploytool/itp/batchboot.jar;C:\Program Files\IBM\WebSphere\AppServer/deploytool/itp/batch2.jar;C:\Program Files\IBM\WebSphere\AppServer/java/lib/tools.jar;C:\Users\PT35330\IBM\rationalsdp\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp1\cddsample\WEB-INF\classes;C:\Users\PT35330\IBM\rationalsdp\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp1\cddsample\WEB-INF\lib\aopalliance-1.0.jar;C:\Users\PT35330\IBM\rationalsdp\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp1\cddsample\WEB-INF\lib\commons-logging-1.2.jar;C:\Users\PT35330\IBM\rationalsdp\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp1\cddsample\WEB-INF\lib\spring-beans-4.1.5.RELEASE.jar;C:\Users\PT35330\IBM\rationalsdp\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp1\cddsample\WEB-INF\lib\spring-context-4.1.5.RELEASE.jar;C:\Users\PT35330\IBM\rationalsdp\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp1\cddsample\WEB-INF\lib\spring-core-4.1.5.RELEASE.jar;C:\Users\PT35330\IBM\rationalsdp\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp1\cddsample\WEB-INF\lib\spring-expression-4.1.5.RELEASE.jar;C:\Users\PT35330\IBM\rationalsdp\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp1\cddsample\WEB-INF\lib\spring-webmvc-4.1.5.RELEASE.jar;C:\Users\PT35330\IBM\rationalsdp\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp1\cddsample]
Aucun commentaire:
Enregistrer un commentaire