Coder Social home page Coder Social logo

JavaPS eating Errors about javaps HOT 5 CLOSED

overbound avatar overbound commented on July 19, 2024
JavaPS eating Errors

from javaps.

Comments (5)

bpross-52n avatar bpross-52n commented on July 19, 2024

Can you give us some code examples? Logging errors seems to work for me, if using an annotated algorithm.

from javaps.

overbound avatar overbound commented on July 19, 2024

Its more accurate to say it eats the stacktraces. When I throw this error JavaPS's default behavior is to show the error code but the stacktrace is lost.

@Slf4j
@Algorithm(version = "1.0.0")
public class TestAlgorithm {

    private String input;
    private String output;

    @LiteralInput(
            identifier = "input")
    public void setInput(String param) {
        this.input= param;
    }

    @LiteralOutput(
            identifier = "output")
    public String getOutput() {
        return this.output;
    }

    @Execute
    public void runAlgorithm() throws Exception {
        throw new Exception("This is a test error");
    }
}

Error in javaps.log:

2020-06-25 09:27:57,645 ERROR o.n.j.e.i.EngineImpl [javaps-0] JobId{value=ea6044c0-145f-46d6-86ed-a7fc3ed853c7} failed: This is a test error

Desired stackstrace output in javaps.log:

Caused by: java.lang.Exception: This is a test error
	at com.apexxs.atlas.analytics.elevation.TestAlgorithm .runAlgorithm(ViewshedAlgorithm.java:54) ~[analytics-elevation-javaps-1.0.0.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at org.n52.javaps.algorithm.annotation.ExecuteBinding.execute(ExecuteBinding.java:59) ~[engine-1.6.0-SNAPSHOT.jar:?]
	... 8 more
09:34:43.110 [javaps-0] INFO  org.n52.javaps.engine.impl.EngineImpl - Job '72e15590-b2f0-4949-821b-52231dc09e10' execution finished. Status: Failed;
09:34:43.114 [http-nio-8081-exec-1] TRACE org.n52.iceland.config.spring.ProviderAwareListableBeanFactory - Returning cached instance of singleton bean 'engineExceptionAdvice'

from javaps.

overbound avatar overbound commented on July 19, 2024

Additionally logging doesn't seem to work unless an error is thrown from my algorithm.

@Slf4j
@Algorithm(version = "1.0.0")
public class TestAlgorithm {

private String input;
private String output;

@LiteralInput(
        identifier = "input")
public void setInput(String param) {
    this.input= param;
}

@LiteralOutput(
        identifier = "output")
public String getOutput() {
    return this.output;
}

@Execute
public void runAlgorithm() throws Exception {
    log.error("This does not log.");
}
}

from javaps.

autermann avatar autermann commented on July 19, 2024

The default log level for org.n52 loggers is trace and for all others (well, except for Spring) it is warn.

Unless you changed the default logging configuration, or if you're using Docker, which has a slightly different configuration, the stack trace of each and every exception should be logged on debug.

As the log level for the org.n52.javaps.engine.impl.EngineImpl logger is trace, the stack trace should definitely appear in your logfile...

Could you show us the log4j2.xml that is used?

from javaps.

overbound avatar overbound commented on July 19, 2024

The original log XML file was still overriding my attempts at configurations. I was able to replace the existing log XML and that fixed what I was seeing and makes good sense. So this is a non-issue and I will close. Thanks!

from javaps.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.