Failed to load application class

I am trying to run the form code given in vaadin sampler but it is giving me following error.
Anyone knows how to resolve it.

javax.servlet.ServletException: Failed to load application class: com.example.vaadin.MyApplication
com.vaadin.terminal.gwt.server.ApplicationServlet.init(ApplicationServlet.java:71)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:317)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:182)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
java.lang.Thread.run(Thread.java:722)

Double check that the application deployment succeeded and the MyApplication class is really in the right place in your servlet container.

thanks but still i am getting same error
you can check that i am giving my web.xml file

<?xml version="1.0" encoding="UTF-8"?> VaadinApplication com.vaadin.terminal.gwt.server.ApplicationServlet application com.example.vaadin.MyApplication VaadinApplication /vaadin/* VaadinApplication /VAADIN/* 30

Your web.xml seems little bit odd. I would change it something like this


<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
	<servlet>
		<servlet-name>VaadinApplication</servlet-name>
		<servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
		<init-param>
			<param-name>application</param-name>
			<param-value>com.example.vaadin.MyApplication</param-value>
		</init-param>
	</servlet>
	<servlet-mapping>
		<servlet-name>VaadinApplication</servlet-name>
		<url-pattern>/*</url-pattern>
	</servlet-mapping>
	<session-config>
		<session-timeout>30</session-timeout>
	</session-config>
</web-app> 

Check also that your project is fully compiled and there is not compilation errors.

I have followed the steps mentioned in the https://vaadin.com/book/-/page/getting-started.first-project.html
But still I am getting same exception.

SEVERE: Allocate exception for servlet Vaadinproject1
javax.servlet.ServletException: Failed to load application class: com.infor.vaadinproject1.Vaadinproject1Application
at com.vaadin.terminal.gwt.server.ApplicationServlet.init(ApplicationServlet.java:71)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:857)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

This is not a Vaadin specific problem but something wrong elsewhere in your environment, project structure or deployment - Google for “SEVERE: Allocate exception for servlet” (with the quotes). Could be an issue with capitalization of class names, invalid class path or something else.

I got the exception when I was using STS and Eclipse Indigo.
The application ran successfully when i used Eclipse ganymede. It worked just like that. I just followed the steps in
https://vaadin.com/book/-/page/getting-started.first-project.html

I didn’t understand why it didn’t work with STS. Actually we need to use STS as our IDE.
Can you please help me how i can make it as workable with STS.
Actually we need to use combination of Spring and vaadin.

Thanks,
Saritha.

I have used STS with Vaadin (and Spring in conjunction with Spring Roo) without problems.

The problem may be some small issue in your project structure (have you tried re-doing it from scratch?) or e.g. in the configuration of the server on which you are trying to run the servlet. Your exception is not quite the same as in the beginning of this thread and seems to point to some other problem but does not give much more specific information about it.