I tried clj-airbrake but it doesn't seem to log errors in errbit. Is there any errbit client for clojure?
errbit is designed to be compatible with the airbrake API, so this should work: https://github.com/bmabey/clj-airbrake
Related
My logs are getting full of exceptions like this:
8884902 [qtp1075738627-4458] WARN o.eclipse.jetty.server.HttpChannel - /upload
java.lang.NullPointerException: null
78884902 [qtp1075738627-4458] WARN o.e.j.u.t.strategy.EatWhatYouKill -
java.lang.IllegalStateException: s=IDLE rs=COMPLETED os=ABORTED is=READY awp=false se=false i=false al=0
at org.eclipse.jetty.server.HttpChannelState.unhandle(HttpChannelState.java:416)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:538)
even though the system seems to be working normally. It's a bit concerning that "normal" operation would include a flood of such logs. I can't find anyone else getting exceptions like this.
This is all on the current version of Jetty, with a Spring Boot 2.3.1 application, using the http2 connector. It happens on a few different URIs in the application with no clear pattern.
Any ideas on this? I don't want to accept having non-stop exceptions as normal behavior of this system.
Looking through the source of HttpChannelState I can see that the exception is formed from:
("s=%s i=%b a=%s",_state,_initial,_async);
But I can't trace much further what this means.
Your usage of Servlet Async Processing or Servlet Async I/O could be the cause.
The output stream being aborted like that is very odd as well.
The origin (in the code) for the 8884902 [qtp1075738627-4458] WARN o.eclipse.jetty.server.HttpChannel - /upload java.lang.NullPointerException: null
is https://github.com/eclipse/jetty.project/blob/jetty-9.4.31.v20200723/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java#L600
But why it doesn't have a stacktrace is also bizarre.
You should file this as an issue at the Eclipse Jetty issue tracker https://github.com/eclipse/jetty.project/issues and work with us to get to the bottom of your issue.
If you can replicate easily enough that would make things easier to troubleshoot.
Since you are using HTTP2, make sure you upgrade both your version of Java and Eclipse Jetty.
I'm using AmazonSQSClient to interact with the SQS service and using the default client configuration which means it already is using the DEFAULT_RETRY_POLICY.
Let's say I make a call in my Java code to the "sendMessage" method.
As per the doc, the method can throw 2 types of Exceptions: InvalidMessageContentsException & UnsupportedOperationException.
Now let's say that the SQS service was unavailable due to whatever reason, and even after retries the SQSClient could not perform the sendMessage operation. I'm trying to understand how would I get to know that in my Java code. I can catch the aforementioned exceptions but I don't think these exceptions would have the info I need. They seem more related to an invalid message or an unsupported operation.
Am I missing something? Thoughts?
This looks like the relevant Java SDK code. This section leads me to believe you'll receive a SdkClientException with the causal exception inside of it.
I'm writing a clojure cli and would like to know if there is a way to test if the out (i.e. println) is being written to a console or is being piped to another program?
This is similar to this question but for clojure.
Clojure is hosted language, so system interaction related stuff is more or less equivalent to Java. For Java there exists only partial solution described in this answer. You can of course implement isatty() using JNI and then interop from Clojure.
However, from ClojureScript hosted on Node.js it's easily achievable using process.stdin.isTTY (in ClojureScript would be (-> process .-stdin .-isTTY)). More details are in this answer.
You could use jnr-posix Java library
[com.github.jnr/jnr-posix "3.0.10"]
to call native posix methods directly from Clojure (using Java Interop):
(import 'jnr.posix.POSIXFactory)
(def posix (POSIXFactory/getPOSIX))
(.isatty posix java.io.FileDescriptor/out)
N.B. If you'll run you Clojure application using lein run command, Clojure will not be able to identify TTY terminal since lein will internally pipe stdio between two java processes. You could avoid internal piping by using lein trampoline run command or compiled jar file.
When using Spring-WS as a SOAP client, I have a hard time converting incoming faults to their specific Java Exceptions.
For example, if the web service operation I am calling can return a ClientNotFoundFault and let's say, an InvalidAmountFault, can I make Spring-WS throw either a ClientNotFoundException or an InvalidAmountException?
Can Spring-WS throw something different than SoapFaultClientException?
I can do this the other way around when writting the web service myself. There, using the SoapFaultMappingExceptionResolver, I can easily convert Exceptions into their equivalent fault. I just couldn't find anything about doing it when writting the client...
I am using Spring-WS 2.1.0.RELEASE with JDK 1.7.6
Thanks and let me know if I am not clear enough or if you need some code example.
There is no equivalent resolver on the client side. The resolver interface is there all ready for someone to write a similar mapper. Should be very straight forward to hold a map of fault codes vs exception classes.
See org.springframework.ws.client.core.FaultMessageResolver
This is implemented by SoapFaultMessageResolver at the moment which simply wraps the fault message in the SoapFaultClientException that you are seeing.
I have some 'spaghetti'-style code that is generously saused with Custom tags and Stored procedures calls. Templates include each other, custom tags nested and stored procedures are callind other stored procedures in their place.
Problem is that one template call is hanging somewhere in between. I cannot get any error out and cannot see debug output. What is best way to debug such 'hanging' request with as much detail as possible ?
Thanks!
If you are using CF 8+, you can use the Step Debugging tools in Eclipse to step through the code: http://www.adobe.com/devnet/coldfusion/articles/debugger.html
If you are using an earlier version, you can use a 3rd party product like Fusion Debug ( http://www.fusion-debug.com/fd/ ) to do the same thing.
If you are using CF8, you can also use the CF Admin Server Monitor to see where a thread is hanging as well: http://www.adobe.com/devnet/coldfusion/articles/monitoring_pt1.html
If the built-in debugger is of no use cause the request just hang the other quick way is to just start with a cfabort at the top and keep moving it down until you hit the file causing the request to hang.
CFTrace is a great tool for this. It is native and reports time information as well.
Have you looked at the standard coldfusion server log files to see what might be in there?
Have you run the server in a console window so you can see what is appearing in the console as the templates are running (or not as the case might be)?
You could Take jvm thread dumps. You can do from command line or via server monitoring if you have Enterprise 8+