Need to catch and display the Stack overflow error message - wicket

I am fetching some 17,500 records from DB and getting below stack overflow error exactly at the resultset execution step.
Query query = dbConnect
.createQuery("select nitem from NItem nitem where nitem.id in ("+nitemIdStr+")");
nitemList = query.getResultList();
Stack overflow error
Root cause:
java.lang.StackOverflowError
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:98)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
Complete stack:
org.apache.wicket.WicketRuntimeException: Method onRequest of interface org.apache.wicket.behavior.IBehaviorListener targeted at com.rambutan.test.ExportNew$3#17adeb on component [Form [Component id = ajaxexample]] threw an exception
at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:268)
at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:247)
at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:226)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:854)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:254)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:211)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:282)
at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258)
at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:247)
at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:226)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:854)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:254)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:211)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:282)
at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
I need to catch this error and display it in UI with a message saying "The file export exceeding the stack limit, Please use filter conditions" instead of getting in stack overflow error in the browser. is this possible?

The example below worked for me on a testpage:
getRequestCycleListeners().add(new AbstractRequestCycleListener() {
#Override
public IRequestHandler onException(RequestCycle cycle, Exception e) {
return new RenderPageRequestHandler(new PageProvider(SomePage.class));
}
});
Add this in you Application and it will redirect you in case of an exception to SomePage.class.
But catching a stack overflow is bad practice. There are many ways to prevent this like limiting the query, limit input size, keep track of records processed or keep track of actual stack and finish it yourself.
So my suggestion is prevent the stack overflow instead of catching it in wicket.

As a general rule, catching errors is a bad idea because they usually mean that something was left in a severely inconsistent state.
Catching SOEs is particularly problematic, as there's no guarantee you'll be in a position to act on them. Although in your specific case, the stack will probably be empty enough when you catch it to allow you further calls, but it is possible that you trigger another SOE.
As an aside, you MUST NEVER EVER DO THIS:
Query query = dbConnect
.createQuery("select nitem from NItem nitem where nitem.id in ("+nitemIdStr+")");
Seriously, don't.

Related

Kafka Consumer Connecting to MongoDB

I have a Kafka Consumer service
#KafkaListener(
topics = "topic1",
groupId = "cluster1",
containerFactory = "KafkaListenerContainerFactory")
public void consume(Message message) {
logger.info(String.format("Message recieved -> %s", message.getMsg()));
Long id = message.getId()
RepoDetail repoDetail = testRepo.findByID(id);
logger.info(
String.format(
"Message -> %s", repoDetail.getMessage()));
}
but when it tries to hit the mongo repo i get the following error:
No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
Any way I can call a mongoDB from Kafka Consumer?
full log stack:
org.springframework.kafka.listener.ListenerExecutionFailedException: Listener method 'public void com.kafka.api.service.ConsumerService.consume(...)' threw exception; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.decorateException(KafkaMessageListenerContainer.java:2188) ~[spring-kafka-2.6.9.jar:2.6.9]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeOnMessage(KafkaMessageListenerContainer.java:2159) ~[spring-kafka-2.6.9.jar:2.6.9]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeOnMessage(KafkaMessageListenerContainer.java:2120) ~[spring-kafka-2.6.9.jar:2.6.9]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeRecordListener(KafkaMessageListenerContainer.java:2039) ~[spring-kafka-2.6.9.jar:2.6.9]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeWithRecords(KafkaMessageListenerContainer.java:1967) ~[spring-kafka-2.6.9.jar:2.6.9]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeRecordListener(KafkaMessageListenerContainer.java:1853) ~[spring-kafka-2.6.9.jar:2.6.9]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeListener(KafkaMessageListenerContainer.java:1543) ~[spring-kafka-2.6.9.jar:2.6.9]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.pollAndInvoke(KafkaMessageListenerContainer.java:1190) ~[spring-kafka-2.6.9.jar:2.6.9]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.run(KafkaMessageListenerContainer.java:1087) ~[spring-kafka-2.6.9.jar:2.6.9]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_212]
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) ~[?:1.8.0_212]
at java.util.concurrent.FutureTask.run(FutureTask.java) ~[?:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Caused by: java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
at org.springframework.web.context.request.RequestContextHolder.currentRequestAttributes(RequestContextHolder.java:131) ~[spring-web-5.3.8.jar:5.3.8]
at org.springframework.web.context.support.WebApplicationContextUtils.currentRequestAttributes(WebApplicationContextUtils.java:313) ~[spring-web-5.3.8.jar:5.3.8]
at org.springframework.web.context.support.WebApplicationContextUtils.access$400(WebApplicationContextUtils.java:66) ~[spring-web-5.3.8.jar:5.3.8]
at org.springframework.web.context.support.WebApplicationContextUtils$RequestObjectFactory.getObject(WebApplicationContextUtils.java:329) ~[spring-web-5.3.8.jar:5.3.8]
at org.springframework.web.context.support.WebApplicationContextUtils$RequestObjectFactory.getObject(WebApplicationContextUtils.java:324) ~[spring-web-5.3.8.jar:5.3.8]
at org.springframework.beans.factory.support.AutowireUtils$ObjectFactoryDelegatingInvocationHandler.invoke(AutowireUtils.java:292) ~[spring-beans-5.3.8.jar:5.3.8]
at com.sun.proxy.$Proxy156.getHeader(Unknown Source) ~[?:?]
at com.repository.BaseRepository.getTemplate(BaseRepository.java:57) ~[repo-5.3.008.jar:?]
at com.kafka.api.repository.impl.ProductDetailRepositoryImpl.findByID(ProductDetailRepositoryImpl.java:21) ~[classes/:?]
at com.kafka.api.repository.impl.ProductDetailRepositoryImpl$$FastClassBySpringCGLIB$$824634c2.invoke(<generated>) ~[classes/:?]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.8.jar:5.3.8]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779) ~[spring-aop-5.3.8.jar:5.3.8]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.8.jar:5.3.8]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750) ~[spring-aop-5.3.8.jar:5.3.8]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137) ~[spring-tx-5.3.8.jar:5.3.8]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.8.jar:5.3.8]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750) ~[spring-aop-5.3.8.jar:5.3.8]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692) ~[spring-aop-5.3.8.jar:5.3.8]
at com.kafka.api.repository.impl.ProductDetailRepositoryImpl$$EnhancerBySpringCGLIB$$ee673ffc.findByID(<generated>) ~[classes/:?]
at com.kafka.api.service.ConsumerService.consume(ConsumerService.java:35) ~[classes/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_212]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_212]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_212]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_212]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:171) ~[spring-messaging-5.3.8.jar:5.3.8]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:120) ~[spring-messaging-5.3.8.jar:5.3.8]
at org.springframework.kafka.listener.adapter.HandlerAdapter.invoke(HandlerAdapter.java:48) ~[spring-kafka-2.6.9.jar:2.6.9]
at org.springframework.kafka.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:330) ~[spring-kafka-2.6.9.jar:2.6.9]
at org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(RecordMessagingMessageListenerAdapter.java:87) ~[spring-kafka-2.6.9.jar:2.6.9]
at org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(RecordMessagingMessageListenerAdapter.java:52) ~[spring-kafka-2.6.9.jar:2.6.9]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeOnMessage(KafkaMessageListenerContainer.java:2139) ~[spring-kafka-2.6.9.jar:2.6.9]
... 11 more
Yes you can. Using a BSON Document and a perfect Write Model, you can upsert data into Mongo DB through BulkWriteResult interface.
BulkWriteResult result = getMongoClient()
.getDatabase(config.getNamespace().getDatabaseName())
.getCollection(config.getNamespace()
.getCollectionName(),BsonDocument.class)
.bulkWrite(writeModels, BULK_WRITE_OPTIONS);
Declare the below bean in your config class,
#Bean public RequestContextListener requestContextListener(){
return new RequestContextListener();
}

Spring WebClient reactor.netty.internal.shaded.reactor.pool.PoolAcquireTimeoutException

I am using Spring WebClient to call a rest service. The code for the post call as mentioned below.
Mono<ClientResponse> response = client.post()
.uri(uriBuilder -> uriBuilder.build())
.headers(httpHeaders -> httpHeaders.setAll(getHeaders()))
.body(BodyInserters.fromPublisher(Mono.just(message), String.class))
.exchange();
response.subscribe(clientResponse -> {
System.out.println(clientResponse.statusCode());
});
I am getting the following exception after posting continuously for a while (after posting 2-3 million requests in 5 mins).
[ parallel-3] r.c.s.Schedulers : Scheduler worker in group main failed with an uncaught exception
reactor.core.Exceptions$ErrorCallbackNotImplemented: reactor.netty.internal.shaded.reactor.pool.PoolAcquireTimeoutException: Pool#acquire(Duration) has been pending for more than the configured timeout of 45000ms
Caused by: reactor.netty.internal.shaded.reactor.pool.PoolAcquireTimeoutException: Pool#acquire(Duration) has been pending for more than the configured timeout of 45000ms
at reactor.netty.internal.shaded.reactor.pool.AbstractPool$Borrower.run(AbstractPool.java:317) ~[reactor-netty-0.9.0.RELEASE.jar!/:0.9.0.RELEASE]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
|_ checkpoint ⇢ Request to POST https://myrest-service-c12-1-lb-125370128.us-west-2.elb.amazonaws.com/antenna [DefaultWebClient]
Stack trace:
at reactor.netty.internal.shaded.reactor.pool.AbstractPool$Borrower.run(AbstractPool.java:317) ~[reactor-netty-0.9.0.RELEASE.jar!/:0.9.0.RELEASE]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) [reactor-core-3.3.0.RELEASE.jar!/:3.3.0.RELEASE]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) [reactor-core-3.3.0.RELEASE.jar!/:3.3.0.RELEASE]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
It looks like the pool is exhausted and I need to limit the number of requests. Could some one help me in solving this issue. Thanks in advance.
Seems to be a bug in reactor-netty that has recently been fixed: https://github.com/reactor/reactor-netty/issues/1012

ASP.NET Page with ReportViewer Gives the Error below

I am having this error when I opening page with Reportviewer, and ideas
Server Error in '/' Application.
Index was outside the bounds of the array.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[IndexOutOfRangeException: Index was outside the bounds of the array.]
AjaxControlToolkit.MaskedEditExtender.set_CultureName(String value) +708
AjaxControlToolkit.MaskedEditExtender.OnPreRender(EventArgs e) +326
System.Web.UI.Control.PreRenderRecursiveInternal() +88
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +985

What is the ideal way to handle a RESTful service request with no resource identification

I have a RESTful service which is developed using Spring. The service tries to find a resource using a Identification string with Request method as GET.
The request pattern is : https://api.rest.com/resource/RESOURCEID
The method defined for the same is
#RequestMapping(
value = "/{RESOURCEID}",
method = RequestMethod.GET,
produces = "application/json")
public #ResponseBody String retrieve(
#PathVariable String resourceID,
HttpServletRequest request,
HttpServletResponse response)
throws AbstractBaseAppException,
JsonGenerationException,
JsonMappingException,
IOException
Now when I try to make a request like: https://api.rest.com/resource/, I get exception below:
[6/10/14 17:48:56:942 IST] 00000018 PmiRegistry W CWPMI0023W: Unable to register PMI module due to duplicate name: SimpleFileServlet
[6/10/14 17:48:56:982 IST] 00000018 StatsFactoryU W CWPMI0103W: Unable to register custom PMI module due to duplicate name under the same parent or invalid PMI tree path: SimpleFileServlet
[6/10/14 17:48:57:015 IST] 00000018 stats E com.ibm.ws.wswebcontainer.stats.ServletPmiModule ServletPmiModule error creating stats instance
com.ibm.wsspi.pmi.factory.StatsFactoryException: CWPMI0103W: Unable to register custom PMI module due to duplicate name under the same parent or invalid PMI tree path: SimpleFileServlet
at com.ibm.ws.pmi.factory.StatsFactoryUtil.registerModule(StatsFactoryUtil.java:92)
at com.ibm.ws.pmi.factory.StatsInstanceImpl._register(StatsInstanceImpl.java:81)
at com.ibm.ws.pmi.factory.StatsInstanceImpl.createGroupInstance(StatsInstanceImpl.java:126)
at com.ibm.wsspi.pmi.factory.StatsFactory.createStatsInstance(StatsFactory.java:354)
at com.ibm.wsspi.pmi.factory.StatsFactory.createStatsInstance(StatsFactory.java:319)
at com.ibm.ws.wswebcontainer.stats.ServletPmiModule.<init>(ServletPmiModule.java:91)
at com.ibm.ws.wswebcontainer.stats.WebAppModule.onServletStartInit(WebAppModule.java:241)
at com.ibm.ws.webcontainer.WebAppPmiListener.onServletStartInit(WebAppPmiListener.java:178)
at com.ibm.ws.webcontainer.webapp.FireOnServletStartInit.fireEvent(FireOnEventListenerVisitors.java:85)
at com.ibm.ws.webcontainer.util.EventListeners.fireEvent(EventListeners.java:53)
at com.ibm.ws.webcontainer.webapp.WebAppEventSource.onServletStartInit(WebAppEventSource.java:121)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:314)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:168)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.load(ServletWrapper.java:1267)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:970)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1370)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:179)
at org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler.handleRequest(DefaultServletHttpRequestHandler.java:119)
at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.metlife.gsp.tenancy.TenantDispatcherServlet.service(TenantDispatcherServlet.java:103)
at com.metlife.gsp.tenancy.TenantDispatcherServletProxy.service(TenantDispatcherServletProxy.java:82)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1131)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:706)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:433)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:125)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:191)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:916)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1005)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:903)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1593)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:192)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1574)
I'm not familiar with the framework you are using, but two things stick out that might be causing issues.
You are making a request to https://api.rest.com/resource/ but the method is 'listening' to URIs the match /{RESOURCEID} which I would expect (unless there are other, 'better' matches) to mean this function will be called with "resource" passed in as the resource ID.
You also do not appear to have a method that is specifically listening to /resource/.
I don't understand how that error message links to back to this problem though. I suggest you look up what exactly those exceptions you are seeing mean and what causes them.

Parcel error in actionbarsherlock

I am getting a crash with below crash log..i cannot reproduce it ...anyone with the knowledge why its happening?
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.qz.XXXX/com.qz.XXXX.XXXXStartActivity}: java.lang.RuntimeException: Parcel android.os.Parcel#410839c0: Unmarshalling unknown type code -38 at offset 1124
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2351)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$600(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1331)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5485)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Parcel android.os.Parcel#410839c0: Unmarshalling unknown type code -38 at offset 1124
at android.os.Parcel.readValue(Parcel.java:2037)
at android.os.Parcel.readSparseArrayInternal(Parcel.java:2260)
at android.os.Parcel.readSparseArray(Parcel.java:1692)
at android.os.Parcel.readValue(Parcel.java:2027)
at android.os.Parcel.readMapInternal(Parcel.java:2231)
at android.os.Bundle.unparcel(Bundle.java:223)
at android.os.Bundle.getSparseParcelableArray(Bundle.java:1232)
at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1728)
at android.app.Activity.onRestoreInstanceState(Activity.java:957)
at com.actionbarsherlock.app.SherlockActivity.onRestoreInstanceState(SherlockActivity.java:127)
at android.app.Activity.performRestoreInstanceState(Activity.java:929)
at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1162)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2329)
Steps to reproduce:
Enable developer option "Don't keep activities"
Run application
Start other package activity
Press back -> crash
I have fixed it this way:
#Override
protected void onSaveInstanceState(Bundle outState) {
//super.onSaveInstanceState(outState);
}
If you don't need to save an activity state, it is quite a good solution.