0

我目前正在尝试启动并运行 Tomcat。看起来好像 Spring 出了问题。环顾四周,似乎我的 common-* 文件或类似文件有问题。但是,我没有发现任何东西似乎很有希望。

我理解的一些事情是我的 WEB-INF/ 文件夹中可能缺少 .jar 文件,或者我没有正确的 DBCP 版本。其他任何事情都超出了我的范围。

May 07, 2012 5:48:45 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.VerifyError: Expecting a stackmap frame at branch target 249 in method com.expertwebdev.tribe.auth.AuthServiceImpl.loadUserByUsername(Ljava/lang/String;)Lorg/springframework/security/core/userdetails/UserDetails; at offset 0
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getDeclaredConstructors(Unknown Source)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:227)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:930)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:903)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
    at     org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

May 07, 2012 5:48:45 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
May 07, 2012 5:48:45 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/utero] startup failed due to previous errors
May 07, 2012 5:48:45 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
May 07, 2012 5:48:45 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
May 07, 2012 5:48:45 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
May 07, 2012 5:48:45 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 8901 ms
4

1 回答 1

3

似乎您正在尝试在 JRE 7 JVM 上运行使用 java 6(spring 框架)编译的代码。

VerifyError明显,该类Class希望找到 JRE 中不存在的一些本机方法getDeclaredConstructors0(Native Method)Class因此, Spring 框架 jar 调用的实际类与 JVM 中可用的本机方法之间存在矛盾。

另外,请参阅此答案,该答案在同一类Class方法中显示了类似的问题。这也是那里的问题。

简而言之,检查您的 spring jar 是否与您使用的 JRE 兼容。

于 2012-05-08T01:32:35.860 回答