aspose file tools*
The moose likes Other Application Frameworks and the fly likes ClassNotFoundException : org springframework web servlet DispatcherServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "ClassNotFoundException : org springframework web servlet DispatcherServlet" Watch "ClassNotFoundException : org springframework web servlet DispatcherServlet" New topic
Author

ClassNotFoundException : org springframework web servlet DispatcherServlet

Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
Hello All,

I have included most of the jar files during build. Any one in particular which I have missed out?

Rgds,

Seetesh
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

what are all those spaces ?
You didn't write "org springframework web servlet DispatcherServlet" did you ?


[My Blog]
All roads lead to JavaRanch
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Ddi you also add spring-webmvc.jar ? The DispatcherSerlvet is in there.
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
I have included spring.jar in the build.

Rgds,

seetesh
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
I cant post a thread with 30 characters continued and thats why I had to break up these words.

Yes I have included all jar files including spring-webmvc.

I believe this class is in Srping.jar too

Rgds,

Seetesh
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

You are using a web application, right ? Did you put the jars into WEB-INF/libs ?
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
Yes all these jar files are in the lib folder
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Can you post the part where you are using the DispatcherServlet ? Maybe you've got an extra space somewhere or something
And post the complete error dump too.
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
No where in the SpringappController.java is DispatcherServlet used.

springapp-servlet.xml has
<beans>
<bean id="springappController" class="SpringappController"/>
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/hello.htm">springappController</prop>
</props>
</property>
</bean>
</beans>

Stack Trace
===========

15:31:53,546 ERROR [STDERR] log4j:ERROR A "org.jboss.logging.util.OnlyOnceErrorHandler" object is not assignable to a "org.apache.log4j.spi.ErrorHandler" variable.
15:31:53,546 ERROR [STDERR] log4j:ERROR The class "org.apache.log4j.spi.ErrorHandler" was loaded by
15:31:53,546 ERROR [STDERR] log4j:ERROR [WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
java.net.FactoryURLClassLoader@1c3e3fb
] whereas object of type
15:31:53,546 ERROR [STDERR] log4j:ERROR "org.jboss.logging.util.OnlyOnceErrorHandler" was loaded by [org.jboss.system.server.NoAnnotationURLClassLoader@1833955].


Rgds,

Seetesh
sachin yadav
Ranch Hand

Joined: Nov 24, 2005
Posts: 156
Can you show me your web.xml and the directory structure of your application.
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
Hello

I reconfigured the path settings of log4j.xml and now there are no ERROR's displayed.

I use Jboss 4.0.4 GA App Server and the war file created is put in the deploy folder.

web.xml
=======

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
<web-app>
<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>

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

</web-app>

Structure is as follows

AProjSpring
===========
build.xml
build.properties
src
SpringappController.java
war
index.jsp
WEB-INF
index.jsp
springapp-servlet.xml
web.xml
classes
log4j.properties
SpringappController.class
lib
commons-logging.jar
spring.jar
log4j-1.2.13.jar
etc all other jar files

Not able to run the index.jsp page. 404 Error.

Rgds,

Seetesh
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
AProjSpring
===========
build.xml
build.properties
----src
-------SpringappController.java
----war
-------index.jsp
----WEB-INF
-------index.jsp
-------springapp-servlet.xml
-------web.xml
-------classes
-----------log4j.properties
-----------SpringappController.class
-------lib
-----------commons-logging.jar
-----------spring.jar
-----------log4j-1.2.13.jar
-----------etc all other jar files
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
Hello

Its working now.
Slight change in springapp-servlet.xml and now it works.

Thks,

Seetesh
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: ClassNotFoundException : org springframework web servlet DispatcherServlet