Coder Social home page Coder Social logo

java-ejb's Introduction

OpenTracing EJB Instrumentation

This library provides instrumentation for EJB modules in Java EE applications.

Development

./mvnw clean install

Release

Follow instructions in RELEASE

java-ejb's People

Contributors

jpkrohling avatar narimanab avatar pavolloffay avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

java-ejb's Issues

Component as class name

Currently using 'ejb' as the component name, with the invoked method name being the span's operation.

Wondering whether it would provide more useful information if the component tag was the class name? As this instrumentation is for internal use within the application, it may help users to understand the location in their code better if the combination of 'component' and 'operation' can be used to identify the class/method.

ctx.methodParams null cause NullPointerException

In our EJB example we added the Interceptors annotation as follow:

@Stateless
@Interceptors({ OpenTracingInterceptor.class})
public class PartyServiceImpl implements PartyService {

and then among the code we have the following method:

@Override
public Optional<Person> getOriginalPersonOfCurrentUser() {
	Optional<PersonEntity> entity = partyRepo.getOriginalPersonOfCurrentUser();
	return abstractionOrEmpty(entity);
}

and during the execution of the code we get this exception:

A system exception occurred during an invocation on EJB PartyServiceImpl, method: public java.util.Optional ch.ergon.taifun.commonentities.party.impl.PartyServiceImpl.getPersonOfCurrentUser()
....
Caused by: java.lang.NullPointerException
	at io.opentracing.contrib.ejb.OpenTracingInterceptor.wrap(OpenTracingInterceptor.java:34)
	at sun.reflect.GeneratedMethodAccessor370.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
	at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
	at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:64)
	at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
	at sun.reflect.GeneratedMethodAccessor189.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
	at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
	at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
	at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
	at sun.reflect.GeneratedMethodAccessor188.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)

Debugging the issue the error occurred when it tries to getParameters() on the following code part:

for(int i = 0; i < ctx.getParameters().length; ++i) {
  Object parameter = ctx.getParameters()[i];
  if (parameter instanceof SpanContext) {

Arquillian tests

This module lacks tests. The module java-cdi could be used as base for tests on this module.

Move to java-interceptor

This module would be more appropriately named java-interceptor instead of java-ejb. Once this is done, the java-cdi module could depend on this new module.

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.