2017-05-26 20 views
-4

カートに製品を追加したり、カートから製品を取り外す際にこの例外が発生します。エラー:java.lang.StackOverflowError

org.springframework.web.util.NestedServletException:ハンドラーディスパッチ が失敗しました。ネストされた例外は org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)で org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:978)におけるによってjava.lang.StackOverflowError ありますjavax.servlet.http.HttpServletで org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)で org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) で.service(HttpServlet.java:635)at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)at org .apache.catalina org.apache.tomcat.websocket.server.WsFilter.doFilterで.core.ApplicationFilterChain.internalDoFilter org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)で(ApplicationFilterChain.java:230) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)で org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)で(WsFilter.java:53) at org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:317) at org.springframework.security.web.access.intercept.FilterSecurityI nterceptor.invoke(FilterSecurityInterceptor.java:127) でorg.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) org.springframework.security.web.FilterChainProxy $ VirtualFilterChainで。 org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxyでのdoFilter(FilterChainProxy.java:331) でorg.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114) 。 java:331) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) at org.springframeworkでorg.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:331) でorg.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) .security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:331) でorg.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) org.springframework.security.webで.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doF org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilterで org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:331) でILTER(RequestCacheAwareFilter.java:63) 。Javaの:200) org.springframework.security.web.authentication.logout.LogoutFilter.doFilterで org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:331) (LogoutFilter.javaで: org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:331) で116) でorg.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:100) で org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java :331) でorg.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ででorg.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:331) でorg.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) org.springframeworkで。 security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.context.request.async.WebAs org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxyでyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) でorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) 。ジャワ:331) org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177) でorg.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214) においてにおけるORG .springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.Del : org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.javaでegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) でorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) 165) でorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) でorg.apacheで.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) でorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) でorg.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624) org.apache.catalinaで org.apache.coyote.http11.Http11Processor.serviceで.core.StandardEngineValve.invoke org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341)で(StandardEngineValve.java:87) (Http11Processor .java:495) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol $ ConnectionHandler。 org.apache.tomcat.util.net.SocketProcessorBase.runで org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.doRun(NioEndpoint.java:1354) (のプロセス(AbstractProtocol.java:767) SocketProcessorBase.java:49) でjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) でjava.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617) 組織で.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61) (java.lang.Thread.run)(Thread.java:745)原因: java.lang.StackOverflowError at javaです。 util.AbstractCollection.toString(Abstr java.lang.String.valueOf(String.java:2994)at org.hibernate.collection.internal.PersistentBag.toString(PersistentBag.java:510) at java.lang.String.valueOf(String.java:2994) java.lang.StringBuilder。 append(StringBuilder.java:131)at com.sbk.shoppingbackend.dto.Cart.toString(Cart.java:82)at java.lang.String.valueOf(String.java:2994)at java.lang。 StringBuilder.append(StringBuilder.java:131)at com.sbk.shoppingbackend.dto.User.toString(User.java:182)at java.lang.String.valueOf(String.java:2994)at java。 lang.StringBuilder.append(StringBuilder.java:131)at com.sbk.shoppingbackend.dto.Cart.toString(Cart.java:82)at java.lang.String.valueOf(String.java:2994)at java.lang.StringBuilder.append(StringBuilder.java:131) com.sbk.shoppingbackend.dto.User.toString(User.java:182)at java.lang.String.valueOf(String.java:2994) ) で でjava.lang.StringBuilder.append(StringBuilder.java:131)com.sbk.shoppingbackend.dto.Cart.toString(Cart.java:82) でjava.lang.String.valueOf :2994)at com.bk.shoppingbackend.dto.User.toString(User.java:182)ののjava.lang.StringBuilder.append(StringBuilder.java:131)java.lang.String.valueOf(String .java:2994)at java.lang.StringBuilder.append(StringBuilder.java:131)at com.sbk.shoppingbackend.dto.Cart.toString(Cart.java:82)at java.lang .String.valueOf(String.java:2994)at java.lang.StringBuilder.append(StringBuilder.java:131)at com.sbk.shoppingbackend.dto.User.toString(User.java:182)at java .lang.String.valueOf(String.java:2994)at java.lang.StringBuilder.append(StringBuilder.java:131)at com.sbk.shoppingbackend.dto.Cart.toString(Cart.java:82)at のjava.lang.String.valueOf(String.java:2994) のjava.lang.StringBuilder.append(StringBuilder.java:131)com.sbk.shoppingbackend.dto.User.toString(User.java:182) ) の場合 のjava.lang.String.valueOf(String.java:2994) のjava.lang.StringBuilder.append(StringBuilder.java:131)com.sbk.shoppingbackend.dto.Cart.toString(Cart.java :82) java.lang.String.valueOf(String.java:2994)at java.lang.StringBuilder.append(StringBuilder.java:131)at com.sbk.shoppingbackend.dto.User.toString(User.java:182) ) の場合 のjava.lang.String.valueOf(String.java:2994) のjava.lang.StringBuilder.append(StringBuilder.java:131)com.sbk.shoppingbackend.dto.Cart.toString(Cart.java :82)at のjava.lang.String.valueOf(StringBuilder.java:131) にcom.sbk.shoppingbackend.dto.User.toString(User .java:182)at java.lang.String.valueOf(String.java:2994)at java.lang.StringBuilder.append(StringBuilder.java:131)at com.sbk.shoppingbackend。dt.Cart.toString(Cart.java:82)at java.lang.String.valueOf(String.java:2994)at java.lang.StringBuilder.append(StringBuilder.java:131)at com.sbk。 shoppingbackend.dto.User.toString(User.java:182)at java.lang.String.valueOf(String.java:2994)at java.lang.StringBuilder.append(StringBuilder.java:131)at com。 sbk.shoppingbackend.dto.Cart.toString(Cart.java:82)at java.lang.String.valueOf(String.java:2994)at java.lang.StringBuilder.append(StringBuilder.java:131)at com.sbk.shoppingbackend.dto.User.toString(User.java:182)at java.lang.String.valueOf(String.java:2994)at java.lang.StringBuilder.append(StringBuilder.java:131)にcom.sbk.shoppingbackend.dto.Cart.toString(Cart.java:82)at java.lang.String.valueOf(String.java:2994)at java.lang.StringBuilder.append(StringBuilder.java:131) ) でcom.sbk.shoppingbackend.dto.User.toString(User.java:182) でjava.lang.String.valueOf(String.java:2994) でjava.lang.StringBuilder.append(StringBuilder.java) :131)at com.sbk.shoppingbackend.dto.Cart.toString(Cart.java:82)at java.lang.String.valueOf(String.java:2994)at java.lang.StringBuilder.append(StringBuilder .java:131)at com.sbk.shoppingbackend.dto.User.toString(User.java:182)at java.lang.String.valueOf(String.java:2994)at java.lang.StringBuilder.append (StringB uck.java:131) com.sbk.shoppingbackend.dto.Cart.toString(Cart.java:82)at java.lang.String.valueOf(String.java:2994) java.lang.StringBuilder。 append(StringBuilder.java:131)at com.sbk.shoppingbackend.dto.User.toString(User.java:182)at java.lang.String.valueOf(String.java:2994)at java.lang。 StringBuilder.append(StringBuilder.java:131)at com.sbk.shoppingbackend.dto.Cart.toString(Cart.java:82)at java.lang.String.valueOf(String.java:2994)at java。 lang.StringBuilder.append(StringBuilder.java:131)at com.sbk.shoppingbackend.dto.User.toString(User.java:182)

+5

スタックダンプだけなので、この質問を議論の対象外とすることにしました。 – talex

+0

あなたは非常に長い例外とコードを投稿しました。これは、あなたが助けを得ることを非常に困難にします。 – Lexi

答えて

2

User.toStringCart.toStringを呼び出すと、 Cart.toStringが呼び出され、User.toStringが繰り返し呼び出されます。

これを解決するには、この方法の1つを変更する必要があります。

+0

ok私はちょうどカートのコントローラからtoStringメソッドを削除しました。 –

関連する問題