Hi maybe try removing properties from initial context.
A sample example would be welcomed too to go deeper (but for this case you can pass the principal directly to your callable which would be cleaner IMHO) Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/ LinkedIn: http://fr.linkedin.com/in/rmannibucau Github: https://github.com/rmannibucau 2014-07-04 12:22 GMT+02:00 hwaastad <[email protected]>: > Hi, > I'm testing a few scenarios using the concurrentutils and TomEE. > > I was wondering if this would work (not working now) > > Singleton > > // Injecting runnable instance > @Inject > Instance<DeltaCustomerRetriever> myRetrieverInstance; > . > . > ArrayList<Callable<DeltaCustomer>> retrieverTasks = new ArrayList<>(); > DeltaCustomerRetriever myRetriever = myRetrieverInstance.get(); > myRetriever.setCustomer(c); > retrieverTasks.add(myRetriever); > ses.invokeAll(retrieverTasks); > > And my Callable: > call() > p.put("java.naming.factory.initial", > "org.apache.openejb.core.LocalInitialContextFactory"); > final EJBContext ejbContext; > final InitialContext ctx = new InitialContext(p); > ejbContext = (EJBContext) ctx.lookup("java:comp/EJBContext"); > LOG.info(ejbContext.getCallerPrincipal().toString()); > > this results in NPE > > Would it be possible to use @resource sessioncontext? (not sure about the > spec here) > > br hw > > > > > > -- > View this message in context: > http://tomee-openejb.979440.n4.nabble.com/TomEE-Managedexecutorservice-and-context-lookup-tp4670305.html > Sent from the TomEE Users mailing list archive at Nabble.com.
