JB 7 jndi name space
lindholm Jun 17, 2015 3:22 AMI'm currently on a project to upgrade our JBoss6/Java6 to to JBoss7/Java8 with JBoss EAP 6.4.
One of the issues I'm facing is having a JPA library/persistence.xml used by multiple ear/war files in one JBoss instance.
I've tried using the java:app/ and the java:module/ jndi name space in the datasource jndi name but the error I'm getting is
Caused by: java.lang.RuntimeException: JBAS011846: Illegal context in name: java:module/jdbc/ubcRegiDomainDS
at org.jboss.as.naming.deployment.ContextNames.bindInfoFor(ContextNames.java:298)
at org.jboss.as.connector.deployers.ds.processors.DsXmlDeploymentInstallProcessor.startDataSource(DsXmlDeploymentInstallProcessor.java:306)
at org.jboss.as.connector.deployers.ds.processors.DsXmlDeploymentInstallProcessor.deploy(DsXmlDeploymentInstallProcessor.java:136)
When I look at the source I see:
public static BindInfo bindInfoFor(final String jndiName) {
// TODO: handle non java: schemes
String bindName;
if (jndiName.startsWith("java:")) {
bindName = jndiName.substring(5);
} else if (!jndiName.startsWith("jboss") && !jndiName.startsWith("global") && !jndiName.startsWith("/")) {
bindName = "/" + jndiName;
} else {
bindName = jndiName;
}
final ServiceName parentContextName;
if(bindName.startsWith("jboss/exported/")) {
parentContextName = EXPORTED_CONTEXT_SERVICE_NAME;
bindName = bindName.substring(15);
} else if (bindName.startsWith("jboss/")) {
parentContextName = JBOSS_CONTEXT_SERVICE_NAME;
bindName = bindName.substring(6);
} else if (bindName.startsWith("global/")) {
parentContextName = GLOBAL_CONTEXT_SERVICE_NAME;
bindName = bindName.substring(7);
} else if (bindName.startsWith("/")) {
parentContextName = JAVA_CONTEXT_SERVICE_NAME;
bindName = bindName.substring(1);
} else {
throw MESSAGES.illegalContextInName(jndiName);
}
return new BindInfo(parentContextName, bindName);
}
Am I missing missing here?