Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deploying Simple Spring MVC webapp to Weblogic 9.2

 
Richard Ellison
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am trying to deploy a Simple Spring MVC based app to Weblogic 9.2.I am trying to deploy this application in an exploded format.I get an 404 error when I access the url.Following is the structure of this web app:
a)The name of the app is springapp.
b)Under springapp I have a folder-WEB-INF.
c)Under WEB-INF,I have 2 xml files-web.xml and springapp-servlet.xml.These are the contents of springapp-servlet.xml:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

<!-- the application context definition for the springapp DispatcherServlet -->

<bean name="/hello.htm" class="springapp.web.HelloController"/>

</beans>
d)I have a classes and a lib folder under WEB-INF.In the classes folder,I have a controller class called HelloController which implements the Controller interface.
I think I do have the required jar files in the lib folder.

e)I have a jsp called hello.jsp under the WEB-INF folder.

When I access the url "http://localhost:7001/springapp/hello.htm" I get a Error 404-not found.This implies that the server is not able to locate the resource.
This is a simple enough application.Not sure if the error is in the XML namespace defined in the springapp-servlet .xml.Not sure if it is compatible with Weblogic 9.2.

I look forward to hearing from you.

Thanks
Richard
 
Richard Ellison
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These are the contents of the web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID"
version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<welcome-file-list>

<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<servlet>
<servlet-name>springapp</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>springapp</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>



</web-app>



Thanks

Richard
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic