tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Rosenberg ...@tabbysplace.org>
Subject Re: Class not Found, but it's in WEB-INF/classes
Date Sat, 25 Aug 2012 18:53:21 GMT
On Sat, Aug 25, 2012 at 2:45 PM, Konstantin Kolinko
<knst.kolinko@gmail.com> wrote:
> 2012/8/25 Jonathan Rosenberg <jr@tabbysplace.org>:
>> I'm learning Spring by working on a very small Sporing Hello World app
>> in Eclipse.  I know this isn;t a Spring list, but I don;t think this
>> is a Spring problem.

> You aren't saying Toncat version, so it's not a Tomcat problem either.

Eclipse tells me it's "v7.0".

> Do you have "Project -> Compile automatically" option turned on?

Do you mean "Project -> Build Automatically"?

>> Strangely, it seems to find the class every so often, for no apparent reason.

>> Where do I look next?

> Run with a debugger? (You need to attach source code to catalina.jar
> to be able to place a break point in its classes).

This is way beyond my skill set for now.

> Tell us the full stacktrace?

See here:

SEVERE: Context initialization failed
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot
find class [org.tabbysplace.catalog.HelloWorldController] for bean
with name '/hello.html' defined in ServletContext resource
[/WEB-INF/dispatcher-servlet.xml]; nested exception is
java.lang.ClassNotFoundException:
org.tabbysplace.catalog.HelloWorldController
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1262)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:897)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:590)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
	at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
	at javax.servlet.GenericServlet.init(GenericServlet.java:160)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1189)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1103)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1010)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4935)
	at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5262)
	at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5257)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	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)
Caused by: java.lang.ClassNotFoundException:
org.tabbysplace.catalog.HelloWorldController
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
	... 24 more
Aug 25, 2012 2:45:24 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot
find class [org.tabbysplace.catalog.HelloWorldController] for bean
with name '/hello.html' defined in ServletContext resource
[/WEB-INF/dispatcher-servlet.xml]; nested exception is
java.lang.ClassNotFoundException:
org.tabbysplace.catalog.HelloWorldController
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1262)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:897)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:590)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
	at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
	at javax.servlet.GenericServlet.init(GenericServlet.java:160)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1189)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1103)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1010)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4935)
	at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5262)
	at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5257)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	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)
Caused by: java.lang.ClassNotFoundException:
org.tabbysplace.catalog.HelloWorldController
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
	... 24 more
Aug 25, 2012 2:45:24 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /Catalog-Spring threw load() exception
java.lang.ClassNotFoundException: org.tabbysplace.catalog.HelloWorldController
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:897)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:590)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
	at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
	at javax.servlet.GenericServlet.init(GenericServlet.java:160)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1189)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1103)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1010)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4935)
	at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5262)
	at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5257)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	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)
Aug 25, 2012 2:45:24 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Aug 25, 2012 2:45:24 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Aug 25, 2012 2:45:24 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 41962 ms

> Best regards

--
Jonathan Rosenberg
Founder &  Executive Director
Tabby's Place, a Cat Sanctuary
http://www.tabbysplace.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message