airbrake / javabrake Goto Github PK
View Code? Open in Web Editor NEWAirbrake notifier for Java
Home Page: https://docs.airbrake.io/docs/platforms/java/
License: MIT License
Airbrake notifier for Java
Home Page: https://docs.airbrake.io/docs/platforms/java/
License: MIT License
Technically, not all 429 responses from our API will be because of IP rate limiting. If an account runs out of errors or hits a cap, then that would also be a 429 response. Javabrake should report the actual error message or at least not report an incorrect error message. Reporting all 429 responses as IP rate limited
is incorrect in some cases.
Details are at https://github.com/airbrake/airbrake-java/issues/51
ServletInitializer
private final
for fields, use constructor dependency injection, don't use short names for fields @Autowired
WeatherService svc;
Becomes
private final WeatherService weatherService;
@Autowired
public WeatherController(WeatherService weatherService)
String weather1(@PathVariable String location)
GetLocations()
@Service
annotation, if you don't need it@Service("WeatherService")
becomes
@Service
https://github.com/airbrake/javabrake/tree/master/examples/springboot
I updated Javabrake from 0.1.6 to 0.2.0, changed new Notifier(projectId, projectKey);
to new Notifier(config);
and ran my application. I got this:
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226)
at com.google.gson.Gson.fromJson(Gson.java:932)
at com.google.gson.Gson.fromJson(Gson.java:897)
at com.google.gson.Gson.fromJson(Gson.java:846)
at com.google.gson.Gson.fromJson(Gson.java:817)
at io.airbrake.javabrake.PollTask.run(PollTask.java:65)
at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
at java.base/java.util.TimerThread.run(Timer.java:506)
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:386)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215)
... 7 common frames omitted
Any ideas?
Hello,
I just tried upgrading to the latest version of javabrake (0.2.3) and am encountering the error below.
I did some googling and discovered that the problem is because the code was compiled with Java 11, but we are still using Java 8.
Can I obtain a version of Airbrake that was compiled with Java 8?
If not, we could pull your code and compile our own WAR, provided that the code does not depend on Java 11. Do you know the answer to that?
Thanks.
The old Java notifier showed something like:
/RequestScope.java:289 → org.glassfish.jersey.process.internal.RequestScope.runInScope
/ServerRuntime.java:916 → org.glassfish.jersey.server.ServerRuntime$AsyncResponder.resume
/ServerRuntime.java:872 → org.glassfish.jersey.server.ServerRuntime$AsyncResponder.resume
/SourceFile:147 → com.my_company.SomeClass
While with javabrake
the stacktrace is like:
/sun.reflect.NativeConstructorAccessorImpl:-2 → newInstance0
/sun.reflect.NativeConstructorAccessorImpl:62 → newInstance
/sun.reflect.DelegatingConstructorAccessorImpl:45 → newInstance
/java.lang.reflect.Constructor:423 → newInstance
/home/user/apache-tomcat/webapps/ROOT/WEB-INF/classes/com/my_company/SomeClass.class:37 → someMethod
I'm not sure I would call this a "security" issue but I think the old way was better.
Hi,
I notice this NPE in version 0.1.6 and also noticed that the fix is already in the master branch, my question is, why isn't that released yet? Are there any plans to make a new release with that fix soon?
Thanks!
Replace things like this
try {
RemoteConfigJSON json_data = gson.fromJson(response, RemoteConfigJSON.class);
this.data.merge(json_data);
} catch(JsonSyntaxException e) {
System.out.printf("parse error on: %s\n", response);
System.out.println(e.getMessage());
e.printStackTrace();
return;
}
This is likely to be okhttp pool, but I can't figure out what is wrong. Only happens with async sending. jstack shows threads doing garbage collection and finalizers.
Hallo!
How can I use Javabrake behind a proxy? Is there a way to configure the proxy setting of OkSender.okhttp?
Best regards,
Simon.
In the old library I used to do
`
protected void setRequest(String url, String component) {
super.setRequest(url, component);
}
@Override
protected void request(Map<String, Object> request) {
super.request(request);
}
`
How do I do that here?
In the Airbrake API docs, I see no mention of X-Airbrake-Token, but instead the key is called out as part of the query string: https://airbrake.io/docs/api/#authentication.
I'd be interested to know why this OkSender class:
javabrake/src/main/java/OkSender.java
Line 53 in 9953317
Hi. Inside of io.airbrake.javabrake.RemoteSettings Timer instantiation happens using no-arg constructor. As a result timer uses non daemon threads. Such Timer instances prevent application to stop even if main thread is stopped and such behavior can be dangerous if app restart is expected
So in my opinion
this.timer = new Timer();
Should be replaced by
this.timer = new Timer(true);
in io.airbrake.javabrake.RemoteSettings
Thanks
On this line:
https://github.com/airbrake/javabrake/blob/master/src/main/java/OkSender.java#L53
The projectKey
is being sent via a header X-Airbrake-Token
instead of the "normal" way - with a query parameter:
http://aibrake.io/api/v3/projects/0/notices?key=aaaaaaaaaaa
Why is this? Is this supposed to work?
When sending an error to airbrake, I am receiving the following warning (using OpenJDK 14.0.2):
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.gson.internal.reflect.UnsafeReflectionAccessor (file:/home/keelerm/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson
/2.8.6/9180733b7df8542621dc12e21e87557e8c99b8cb/gson-2.8.6.jar) to field java.lang.Throwable.detailMessage
WARNING: Please consider reporting this to the maintainers of com.google.gson.internal.reflect.UnsafeReflectionAccessor
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Are there any known solutions to this issue?
More details in https://github.com/airbrake/airbrake-java/issues/46
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.