exceptionless / exceptionless.java Goto Github PK
View Code? Open in Web Editor NEWExceptionless Java client
License: Apache License 2.0
Exceptionless Java client
License: Apache License 2.0
com.exceptionless.exceptionlessclient.exceptions.SubmissionClientException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class io.netty.buffer.ByteBufInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0]->com.exceptionless.exceptionlessclient.submission.EventRequest["data"]->java.util.HashMap["@ext"]->org.springframework.core.codec.CodecException["cause"]->com.fasterxml.jackson.databind.exc.InvalidDefinitionException["location"]->com.fasterxml.jackson.core.JsonLocation["sourceRef"])
at com.exceptionless.exceptionlessclient.submission.DefaultSubmissionClient.postSubmission(DefaultSubmissionClient.java:89) ~[exceptionless-client-1.0-beta1.jar:na]
at com.exceptionless.exceptionlessclient.submission.DefaultSubmissionClient.postEvents(DefaultSubmissionClient.java:52) ~[exceptionless-client-1.0-beta1.jar:na]
at com.exceptionless.exceptionlessclient.queue.DefaultEventQueue.process(DefaultEventQueue.java:140) ~[exceptionless-client-1.0-beta1.jar:na]
at com.exceptionless.exceptionlessclient.queue.DefaultEventQueue.onProcessQueue(DefaultEventQueue.java:80) ~[exceptionless-client-1.0-beta1.jar:na]
at com.exceptionless.exceptionlessclient.queue.DefaultEventQueue$1.run(DefaultEventQueue.java:65) ~[exceptionless-client-1.0-beta1.jar:na]
at java.base/java.util.TimerThread.mainLoop(Timer.java:556) ~[na:na]
at java.base/java.util.TimerThread.run(Timer.java:506) ~[na:na]
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class io.netty.buffer.ByteBufInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0]->com.exceptionless.exceptionlessclient.submission.EventRequest["data"]->java.util.HashMap["@ext"]->org.springframework.core.codec.CodecException["cause"]->com.fasterxml.jackson.databind.exc.InvalidDefinitionException["location"]->com.fasterxml.jackson.core.JsonLocation["sourceRef"])
at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1277) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:400) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:71) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:33) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:726) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeWithoutTypeInfo(MapSerializer.java:681) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:637) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:33) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4407) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3661) ~[jackson-databind-2.11.2.jar:2.11.2]
at com.exceptionless.exceptionlessclient.submission.DefaultSubmissionClient.postSubmission(DefaultSubmissionClient.java:70) ~[exceptionless-client-1.0-beta1.jar:na]
... 6 common frames omitted
Currently, we support methods such as submitLog
that submit events synchronously. Add corresponding methods to submit this asynchronously.
In the latest JavaScript rewrite (workspace branch). We've been talking about how we can simplify configuration in general. Here is a breakdown of that feedback which would cause some code to be deleted ๐๐ป .
On a platform like java I think we would know a lot of the defaults that wouldn't change often in terms of services and configuration. Seems like we could default all the items of the Configuration Manager and have a simple empty constructor. The ExceptionlessClient could have a startup method where we pass a Function/Predicate that contains a new configuration object and a user could set any properties on that. Thoughts?
Is there any reason we shouldn't combine these and move services into an aggregate root property?
The module collector, request info collector environment collector and error parser probably will never change in most implementations so it doesn't make sense defining services or interfaces for them. If we simply do the work in the plugin we can simplify services configuration all together. We also moved these into a services property to clean up configuration.
We try to load the configuration settings via submission client from a preconfigured config subdomain https://config.exceptionless.io
. I noticed this was missing.
Setting the server url should override the config and heartbeat server urls as well (So if you are self hosting it will set all the servers to the same).
error datetime in exceptionless-client 0.1.0 @niemyjski @pc9795
Can we rename com.prashantchaubey
to com.exceptionless
so the client namespace points to the right domain.
https://stackoverflow.com/questions/2125293/java-packages-com-and-org
In the codebase, we have used builders instead of traditional object creation using new
. Have to update docs with examples
I have a java-web application(springboot) and it build with maven,now i want to and Exceptionless support but i can't find it on Maven Central.
I had download Exceptionless.Java code and run "mvn build" command but get false.
my jdk version is 1.8.0_241
so what can i do to this
In the .NET clients we have we usually have a startup method on ExceptionlessClient that takes a function/predicate with a Configuration object or api key and allows configuration / setting api key and startups timers, applies configuration etc.. We then have multiple packages for different client technologies and we define Register Extension method to hook up any platform error handlers and calls startup.
In the new JavaScript client we just have startup that does the same thing but instead of Register extension methods we export a preconfigured exceptionless client (https://github.com/exceptionless/Exceptionless.JavaScript/blob/feature/workspaces/packages/browser/src/index.ts#L12) for each platform that wires up plugins that register to global error handlers: https://github.com/exceptionless/Exceptionless.JavaScript/blob/28f253ffb2e0b09b113a466860a76a0ddde4d152/packages/browser/src/BrowserExceptionlessClient.ts#L25
This brings me to the question: Do we feel like we'd have many different client technologies we'd support on java that that we'd be wiring up to different error handlers? If so what approach do we want to take? I kinda like the plugin approach but we need an easy way to add them (but it's not to much to ask or provide an easy way later to add default plugins based on the integration).
If we go the plugin route, we added support for startup and suspend to plugins (optional to implement). Here is an example plugin (We just gotta make sure we only wire up one handler if startup is called multiple times).
Since plugins are really dynamic, it might be nice to just store exception, unhandled error submission method and request in a data bag (dictionary<string,object>). This way users can add there own things to it. We don't have to do this but it seems like it would be nice.
For the error plugin the exclusions was extra properties that are stored on the Exception object that we didn't want to include in an errors extended data that we capture. We'd want to update this for java or remove it.
We should cache this as I'm guessing this is expensive to compute every time run is called.
The merged event hash isn't used (at least that's what vs code is telling me.
This plugin should be checking all event types and not just errors, but this is a good starting place!
It looks like the use of the hashes
list in the plugin is buggy. Have to review the implemenation
Remove the following snippet from the Show me the code section of the documentation
// Submit async events using submitXXXAsync methods
client.submitLogAsync("Test log");
We don't support async methods as events are processed asynchronously internally.
Would be nice if there was only one submission client instead of having one for settings too All of our current clients follow this pattern (doesn't mean we have to, but it's good to be consistent).
String requestJSON = Utils.JSON_MAPPER.writeValueAsString(data);
I don't know if we need to have a JSON_MAPPER in the utils class. It feels like we could just do the serialization inline or use a ISerializer service on configuration. We know our serialization format and I don't know if it needs to be exposed.
We reworked the js client a bit in this front, but it seems like it would be better to check response.isSuccessful
instead of response.code() / 100 != 2
. Unless you are running into some kind of issue. Again you are the domain expert :).
We'll return a 304 if settings are current and won't return a body. Otherwise if the status is a 200 it will contain the configuration. This would simplify some checks :)
We typically return a model from the submission client to give the status (again not required), we do this because we don't want to throw exceptions that might go unhandled. Our goals in the client is to never blow up a clients application ever, just log out a failure happened. Would be good to ensure we are ensuring the exceptions we do throw are caught at the call sites.
In .NET and previous version of JavaScript client we have a fully sync client. For both of these we did this because at the time we wrote it async wasn't prevalent in the languages. When we rewrote the JavaScript client we made it async but it had a cascading virus affect to the code base. Since submissions happen in a background thread (queue timer) I still think it's fine being sync. I added this section only to consider it if it's gained main stream adoption in Java and if we feel like it's worth doing as it will be a breaking change later. But I feel if we do this we should do the whole api (queue processing, plugins etc). Is it worth it? Is it even possible... do timers support async safely (async over sync)?
The Java client was based on the javascript client (real world
Java client would probably would be closer to the .NET implementation) which has been going a major update / refactoring (https://github.com/exceptionless/exceptionless.javascript/tree/feature/workspaces).
One of the things we did was simplify storage greatly. We got rid of the storage providers and just have a simple storage implementation that reflects local storage apis (it's what makes sense in java but maybe not necessarily here in terms to the local storage api). This took some reworking of the queue to maintain storage but resulted in some really nice changes with tons of deletions. It didn't make sense to store items by timestamp and caused a lot of extra parsing of storage keys that wasn't needed. Here is the link to the new storage implementation https://github.com/exceptionless/Exceptionless.JavaScript/tree/feature/workspaces/packages/core/src/storage (here is the .NET one https://github.com/exceptionless/Exceptionless.Net/blob/master/src/Exceptionless/Storage/IObjectStorage.cs) Feel free to do what makes sense I just wanted to let you know why we changed.
We also simplified the Submission as well and got rid of the submission adaptors to a more simplified approach like what you did.
It would be great to have a getting started to the readme. This would give some steps of required software to get going and work with the project. We try to have docs for VS Code but that isn't required (I'm also not sure what editor you use or recommend :)).
Also is there a min java version we support?
Why can't I get the data for @request? RequestInfo is Null
That's how I use it.
client.submitException(e);
Lombok provides @Slf4j
annotation which creates a logger by default.
where can i find the excptionless-spring-boot-starter?
I'm really need this component @niemyjski @pc9795
@pc9795 I hope all is well. We recently just added support for HTTP Headers exceptionless/Exceptionless@d58797d
Right now we have this method signature to add data once an Event object is created
public void addData(Map<String, Object> data, Set<String> dataExclusions) {
It explicitly asks for data exclusions with the data and doesn't take the configuration default data exclusion into consideration
Following should be better suited for debug mode:
2021-04-20 09:11:04.858 INFO 13084 --- [-settings-timer] c.e.e.settings.SettingsManager : Checking for updated settings from v1
2021-04-20 09:11:04.863 INFO 13084 --- [-settings-timer] c.e.e.settings.SettingsManager : No need to update, settings are not modified
Ref: exceptionless/Exceptionless#123
๐ After going through the above issue and a quick google search I don't think we have any official client library for Java or I am missing something. I think the repository created for the Java client in the above issue is now deleted.
My background:
I am currently working on a Java app and need a self-hosting error monitoring solution. I worked with sentry before in a professional setting but want to try exceptionless for my current project.
I installed latest JDK 11 (not the OJDK) and maven latest and I can't verify or run any of the tests. Is there something I need to do? I can't verify or click around in VS Code very easily because the builder methods don't exist.
> Executing task: mvn -B verify <
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< com.exceptionless:exceptionless-client >---------------
[INFO] Building exceptionless-client 1.0-beta1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.22.0/maven-surefire-plugin-2.22.0.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.22.0/maven-surefire-plugin-2.22.0.pom (5.0 kB at 15 kB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.22.0/surefire-2.22.0.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.22.0/surefire-2.22.0.pom (27 kB at 414 kB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/31/maven-parent-31.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/31/maven-parent-31.pom (43 kB at 723 kB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/apache/19/apache-19.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/apache/19/apache-19.pom (15 kB at 298 kB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom (5.8 kB at 102
kB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom (13 kB at 256 kB/s)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ exceptionless-client ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\Code\Exceptionless.Java\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ exceptionless-client ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 78 source files to D:\Code\Exceptionless.Java\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.662 s
[INFO] Finished at: 2021-04-18T08:39:04-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project exceptionless-client: Fatal error
compiling: invalid target release: 11 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command mvn -B verify" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
Loggers provide a method to submit an exception with a message like log.error(message, e)
. The client can surface such a method to easily work with this kind of situation when used as an appender for other logging frameworks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.