Script Engine JNDI Resources possible?

Hi,

I am trying to access JNDI resources from groovy script in a script task. I am using Tomcat and Camunda 7.8. I keep getting an exception;

Name [comp/env] is not bound in this Context. Unable to find [comp]

Script looks like;

def initialContext = new InitialContext();
def environmentContext = (Context) initialContext.lookup("java:comp/env");
def connectionURL = (String) environmentContext.lookup("XXX");

Hence should JNDI work in a script task, or has the script engine somehow got its own context separate from the Tomcat container?

(Note I am also deploying my bpmn file straight to the engine, there is no application/war file)

regards

Rob

Hi Rob,

Interesting question!

If there is no application/war file, I was wondering in what context the process instance itself is executing in?

Conor.

Im hoping I can get access to the global resources. As an example, the tomcat JDBC connection pool is a global resource. In my case, I want to get access to scalar values stored as an <environment> tag in the tomcat context…

regards

Rob

Hi,

Have you already tried using a JavaDelegate in the same process instance, just to ensure that the process instance execution context is not the root cause of the issue?

Cheers, Conor.