Я использую Simple XML Framework в приложении REST Джерси, и я неожиданно получаю множество странных исключений:
at org.simpleframework.xml.stream.PrefixResolver.getPrefix(PrefixResolver.java:123)
at org.simpleframework.xml.stream.PrefixResolver.resolvePrefix(PrefixResolver.java:183)
at org.simpleframework.xml.stream.PrefixResolver.getPrefix(PrefixResolver.java:123)
at org.simpleframework.xml.stream.PrefixResolver.resolvePrefix(PrefixResolver.java:183)
at org.simpleframework.xml.stream.PrefixResolver.getPrefix(PrefixResolver.java:123)
(ошибка, описанная выше, повторяется сто раз ... и продолжаетсяэто ниже)
SEVERE: Exception mapper com.sun.jersey.server.impl.ejb.EJBExceptionMapper@da1be4 for Throwable javax.ejb.EJBException threw a RuntimeException when attempting to obtain the response
SEVERE: Mapped exception to response: 500 (Internal Server Error)
java.lang.ClassCastException: java.lang.StackOverflowError cannot be cast to java.lang.Exception
at javax.ejb.EJBException.getCausedByException(EJBException.java:91)
at com.sun.jersey.server.impl.ejb.EJBExceptionMapper.toResponse(EJBExceptionMapper.java:63)
at com.sun.jersey.server.impl.ejb.EJBExceptionMapper.toResponse(EJBExceptionMapper.java:54)
at com.sun.jersey.spi.container.ContainerResponse.mapException(ContainerResponse.java:452)
at com.sun.jersey.spi.container.ContainerResponse.mapMappableContainerException(ContainerRespo nse.java:400)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1404)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
Это XML, который он пытается проанализировать (но иногда это работает, иногда нет):
<shoppinglistItem>
<id>0</id>
<article>
<id>17</id>
<name>Brunch</name>
<price>0.99</price>
<description>Brunch Brotaufstrich...</description>
<picture>...</picture>
<ean>125</ean>
<substances class="java.util.ArrayList"/>
<comments class="java.util.ArrayList"/>
<ratings class="java.util.ArrayList"/>
<stores class="java.util.ArrayList"/>
</article>
<count>1</count>
</shoppinglistItem>
Я был бы рад, если бы кто-нибудь мог дать мне подсказку!= / Я действительно схожу с ума от этого ...