Announcement Announcement Module
Collapse
No announcement yet.
Error executing Pro Spring Sample Application Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error executing Pro Spring Sample Application

    Dear members,

    I wanted to run the Sample Application from the book Pro Spring but it doesn't work to me. I am using the following tools:
    Jre version: 1.4.2_08
    tomcat version: 5.5.9

    I am using compatibility package for the 1.4.* jre version, nevertheless I get the same problema for the 1.5.0_04 jdk version.

    I just put the spring.war on ${tomcat.home}/webapp directory, then invoking:

    http://localhost:8080/spring/index.html

    I get the following error:

    Code:
    javax.servlet.ServletException: Servlet.init() para servlet spring lanzó excepción
    	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
    	org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
    	org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    	org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    	org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    	java.lang.Thread.run(Unknown Source)
    
    
    causa raíz 
    
    java.lang.UnsupportedClassVersionError: com/apress/prospring/business/DefaultBlogManager (Unsupported major.minor version 49.0)
    	java.lang.ClassLoader.defineClass0(Native Method)
    	java.lang.ClassLoader.defineClass(Unknown Source)
    	java.security.SecureClassLoader.defineClass(Unknown Source)
    	org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1629)
    	org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:850)
    	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1299)
    	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
    	java.lang.ClassLoader.loadClassInternal(Unknown Source)
    	java.lang.Class.forName0(Native Method)
    	java.lang.Class.forName(Unknown Source)
    	org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition(BeanDefinitionReaderUtils.java:50)
    	org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinition(DefaultXmlBeanDefinitionParser.java:279)
    	org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinition(DefaultXmlBeanDefinitionParser.java:239)
    	org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinition(DefaultXmlBeanDefinitionParser.java:205)
    	org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:173)
    	org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:164)
    	org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:128)
    	org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:124)
    	org.springframework.context.support.AbstractXmlApplicationContext.refreshBeanFactory(AbstractXmlApplicationContext.java:64)
    	org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:239)
    	org.springframework.web.context.support.XmlWebApplicationContext.refresh(XmlWebApplicationContext.java:131)
    	org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:156)
    	org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:97)
    	org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:80)
    	javax.servlet.GenericServlet.init(GenericServlet.java:211)
    	org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:894)
    	org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:857)
    	org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
    	org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102)
    	org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    	org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    	org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	java.lang.reflect.Method.invoke(Unknown Source)
    	org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    	org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)


    Looking on the tomcat file, we get more detailed information:

    catalina*.log
    Code:
    05-ago-2005 16:07:46 org.springframework.web.servlet.HttpServletBean init
    INFO: Initializing servlet 'spring'
    05-ago-2005 16:07:46 org.springframework.web.servlet.FrameworkServlet initServletBean
    INFO: Framework servlet 'spring' init
    and the localhost*.log file:

    Code:
    05-ago-2005 16:07:46 org.apache.catalina.core.ApplicationContext log
    INFO: Initializing WebApplicationContext for servlet 'spring'
    05-ago-2005 16:07:46 org.apache.catalina.core.ApplicationContext log
    GRAVE: StandardWrapper.Throwable
    java.lang.UnsupportedClassVersionError: com/apress/prospring/business/DefaultBlogManager (Unsupported major.minor version 49.0)
    	at java.lang.ClassLoader.defineClass0(Native Method)
    	at java.lang.ClassLoader.defineClass(Unknown Source)
    	at java.security.SecureClassLoader.defineClass(Unknown Source)
    	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1629)
    	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:850)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1299)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
    	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Unknown Source)
    	at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition(BeanDefinitionReaderUtils.java:50)
    	at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinition(DefaultXmlBeanDefinitionParser.java:279)
    	at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinition(DefaultXmlBeanDefinitionParser.java:239)
    	at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinition(DefaultXmlBeanDefinitionParser.java:205)
    	at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:173)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:164)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:128)
    	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:124)
    	at org.springframework.context.support.AbstractXmlApplicationContext.refreshBeanFactory(AbstractXmlApplicationContext.java:64)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:239)
    	at org.springframework.web.context.support.XmlWebApplicationContext.refresh(XmlWebApplicationContext.java:131)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:156)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:97)
    	at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:80)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:211)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:925)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3857)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4118)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
    	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:894)
    	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:857)
    	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
    	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102)
    	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    05-ago-2005 16:07:46 org.apache.catalina.core.StandardWrapperValve invoke
    GRAVE: Excepción de reserva de espacio para servlet spring
    java.lang.UnsupportedClassVersionError: com/apress/prospring/business/DefaultBlogManager (Unsupported major.minor version 49.0)
    	at java.lang.ClassLoader.defineClass0(Native Method)
    	at java.lang.ClassLoader.defineClass(Unknown Source)
    	at java.security.SecureClassLoader.defineClass(Unknown Source)
    	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1629)
    	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:850)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1299)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
    	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Unknown Source)
    	at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition(BeanDefinitionReaderUtils.java:50)
    	at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinition(DefaultXmlBeanDefinitionParser.java:279)
    	at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinition(DefaultXmlBeanDefinitionParser.java:239)
    	at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinition(DefaultXmlBeanDefinitionParser.java:205)
    	at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:173)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:164)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:128)
    	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:124)
    	at org.springframework.context.support.AbstractXmlApplicationContext.refreshBeanFactory(AbstractXmlApplicationContext.java:64)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:239)
    	at org.springframework.web.context.support.XmlWebApplicationContext.refresh(XmlWebApplicationContext.java:131)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:156)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:97)
    	at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:80)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:211)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:925)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3857)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4118)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
    	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:894)
    	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:857)
    	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
    	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102)
    	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    Probably it is a conflict version problem, but I don't know how to proceed. Thanks in advance,

    David Leal

  • #2
    David,

    It looks like you have compiled for 1.5 but you are trying to run on 1.4. You need either, run Tomcat under 1.5 or recompile on 1.4.

    Rob

    Comment

    Working...
    X