Random Servlet UnavailableException - exception

My application is trying to connect to a third party website (url) and sometimes I get the javax.servlet.UnavailableException. If I try to connect again (click submit button), then it works. If I click submit again, it may or may not work. So it is inconsistent. The application is deployed in WebSphere.
The error message is:
Error page exception
The server cannot use the error page specified for your application to handle the Original Exception printed below. Please see the Error Page Exception below for a description of the problem with the specified error page.
Original Exception:
Error Message:
Error Code: 404
Target Servlet: action
Error Stack:
javax.servlet.UnavailableException
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:361)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:526)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3673)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:269)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:831)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:133)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:457)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:300)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:271)
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:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1593)
Is it a config issue or issue with my code or the 3rd party website?

Related

Autodesk-designautomation: Internal Server Error(Error Code 500): Missing parameter in WorkItem

I am using Autodesk Revit and have been trying to implement the Design Automation API. I have been successful in trying out the sample, modify-your-model tutorial where the dimensions of a window are altered. However the example code is not executing perfectly anymore and it displays an internal server error message(error code 500). The error console claims that some parameter in the workItem is missing. The code worked again on the morning of 14th March again, but by noon it started showing the same error. The error log on the web page and console are given below respectively.
My question is, has the Autodesk OSS server been down for some time now or is it some fault from my side? Please help me out.
P.S. The same code worked perfectly before. I have not edited anything. Yes, I did try changing the Client ID and Client Secret and also update the ngrok address every 2hours.
Sincerely
Error list
-Failed to load resource: the server responded with a status of 500 (Internal Server Error)
-No webpage was found for the web address: http://localhost:3000/api/forge/designautomation/workitems
error in debugger
-fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HM76OJJ532MV", Request id "0HM76OJJ532MV:00000002": An unhandled exception was thrown by the application.
System.Net.Http.HttpRequestException: The server returned the non-success status code 400 (Bad Request).
More error details:
{
"url": [
"Error converting value \"http://aa025317d1f2.ngrok.io /api/forge/callback/designautomation?id=76m1z2sw7uQi-jtAYzYvgA&outputFileName=20210314024133_output_revit_sample_file.rvt\" to type 'System.Uri'. Path 'url', line 1, position 2376."
],
"workItem": [
"A value for the 'workItem' parameter or property was not provided."
]
}
As suggested in the comments there is a space in the ngrok url posted to the workitem:
http://aa025317d1f2.ngrok.io /api/forge/callback/designautomation?id=76m1z2sw7uQi-jtAYzYvgA&outputFileName=20210314024133_output_revit_sample_file.rvt

Redirect to 404 when error occurred in YII2

I want to redirect to 404 custom page if any error occurred instead of custom error page with my code. I want to do this as I do not want to show my error stack trace to user. How to achieve this goal? So how can we turn off errors or notifications in YII2.
You need to set following in web/index.php or for advanced app browse to frontend/web/index.php
defined('YII_DEBUG') or define('YII_DEBUG', false);
OR
You can throw custom error with status code. For Example,
throw new \yii\web\NotFoundHttpException(status code);

Facebook sdk for windows phone LoginAsync method throws an Facebook.WebExceptionWrapper exception

I am making Windows Phone 8 application and it uses facebook login to identify users. When they first time log in they see facebook login dialog but next time when user starts application login happens on background. That works very well when phone is connected to internet but if i close network and try start application FacebookSessionClient.LoginAsync methdod returns my session normally and application continue it's normal flow. But suddenly i get unhandled exception on my App.cs class.
Here is my stack trace:
$exception {System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid. Check InnerException for exception details. ---> Facebook.WebExceptionWrapper: The remote server returned an error: NotFound. --->
System.Net.WebException: The remote server returned an error: NotFound.
at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClasse.<EndGetResponse>b__d(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass1.<BeginOnUI>b__0(Object sendState)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at Facebook.OpenReadCompletedEventArgs.get_Result()
at Facebook.Client.FacebookSessionClient.<SendAnalytics>b__0(Object o, OpenReadCompletedEventArgs e)
at Facebook.HttpHelper.OnOpenReadCompleted(OpenReadCompletedEventArgs args)
at Facebook.HttpHelper.ResponseCallback(IAsyncResult asyncResult, Object userToken)
at Facebook.HttpHelper.<>c__DisplayClass2.<OpenReadAsync>b__0(IAsyncResult ar)
at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClass1d.<InvokeGetResponseCallback>b__1b(Object state2)} System.Exception {System.Reflection.TargetInvocationException
I have tried try catch block many places in my code but i't doesn't stop there. Also when it breaks on app.cs it show that error comes from another thread.
This is how i call facebook login if user is logged before
FacebookSession facebookSession = await App.FacebookSessionClient.LoginAsync();
And it returns immediately and gives current session. But about ten seconds later app crashes. Can anyone give me a hint how i can handle that error correctly or how i can prevent that? I use 0.8 facebook sdk version.
Check this question: Facebook Wrap Exception Wrapper
This is the same bug already fixed in GitHub repo but not yet available via NuGet. The solution to your problem is to build Facebook.Client from source instead of downloading it with NuGet.

How to access exception/stacktrace in Velocity template resolved by web.xml's error-page?

I would like to print the cause of the HTTP Error 500 on my Velocity template but am having difficulty figuring out how this can be done.
My web.xml is configured with:
<error-page>
<error-code>500</error-code>
<location>/error/500</location>
</error-page>
The location is backed by a Spring controller. The 500.vm page is resolving as expected but how do I access the exception which resulted in this error page?
Thanks~
Is this an Avetti App? An http 500 is a 'catch all' type error that can't be determined by the application, so the server relays the message ("stuff is messed up"). This type of error usually happens when an application breaks or didn't properly handle an exception... so there is no exception to catch or present on the page.

Getting receive pipeline error information in BAM

I have two orchestrations One of them is used as an error handler for the other orchestration, and is getting failed messages from it. I have set this up in BAM. The problem is when a file fails in the receive port I don't get any useful information in the Activity Search. Only that something has been registered. Data ex from BAM:
ActivityID: 2738a492-04c7-4887-9ff3-6902f435bda4
ErrorCode:
ErrorDesc:
Filename:
Progress Error: Handled
TransactionId:
rcvPort:
sndPort:
In the tracking profiler I use the properties from the errorReporter. Ex ErrorReport.FailureCode. The file gets moved as it should by the Error handler orchestration.
Does someone now what I'm doing wrong?
Is it possible to get any information when a file fails in the receive stage?
Mostly I need the filename and the error code/desc. (the Progress Error is a progress activity I have created).
I worked it out. For some reason I couldn't trace it to bam if I made progress dimension for the messages. When I just stored the plain data it worked ok.