我在编写查询时遇到此错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationController' defined in ServletContext resource [/WEB-INF/controller-spring-beans.xml]: Cannot resolve reference to bean 'sessionDao' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionDao': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'emf' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: PermGen space
引起:
at org.mortbay.jetty.servlet.ServletHolder.makeUnavailable(ServletHolder.java:406)
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:449)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:676)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1239)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:466)
at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:124)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.plugin.AbstractJettyRunMojo.restartWebApp(AbstractJettyRunMojo.java:446)
at org.mortbay.jetty.plugin.AbstractJettyRunMojo$1.filesChanged(AbstractJettyRunMojo.java:407)
at org.mortbay.util.Scanner.reportBulkChanges(Scanner.java:486)
at org.mortbay.util.Scanner.reportDifferences(Scanner.java:352)
at org.mortbay.util.Scanner.scan(Scanner.java:280)
at org.mortbay.util.Scanner$1.run(Scanner.java:232)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
我试过了:
在spring-servlet.xml中更改<context:component-scan base-package="packageName" />
在spring-servlet.xml中添加<mvc:annotation-driven />
我很遗憾这个错误。
答案 0 :(得分:1)
nested exception is java.lang.OutOfMemoryError: PermGen space
异常消息的上一行表示由于PermGem空间不够高而导致内存不足。您可以使用如下的启动参数来增加它:
-XX:MaxPermSize=128m