[
https://issues.jboss.org/browse/AS7-6877?page=com.atlassian.jira.plugin.s...
]
Eduardo Martins commented on AS7-6877:
--------------------------------------
The internal private API changed due to AS7-5746, here is the commit
https://github.com/jbossas/jboss-as/commit/af649d7d2ec032b60bdb3bca1ccaca...
In short, the bind at the MSC Service Based Naming Store needs to become a "soft
dependency" of an already existent deployable unit, to ensure that when the
deployable unit stops the bind is removed. In your case you just need to figure out and
obtain which deployable unit's your bind should be related, and pass its service name
to that WritableServiceBasedNamingStore.pushOwner() method.
By the way, I don't have enough knowledge about your code, but did you try to use
standard JNDI bind code, i.e. with no usage of our private api? I'm asking this
because several issues were corrected wrt setting the invocation context, and like some
people before, you may not need it anymore.
NoSuchMethodError pushOwner(ServiceTarget,ServiceName)
------------------------------------------------------
Key: AS7-6877
URL:
https://issues.jboss.org/browse/AS7-6877
Project: Application Server 7
Issue Type: Bug
Components: Naming
Affects Versions: EAP 6.1.0.Alpha (7.2.0.Final)
Reporter: Jeff Yu
Assignee: Eduardo Martins
In the JBoss AS-7.1.1.Final, I used the following code to do the JNDI binding/unbinding
from the modules (not deployed in the deployment folder).
public class JndiRegistry {
private static final Log LOG= LogFactory.getLog(JndiRegistry.class);
public static void bindToJndi(String name, Object object) {
ServiceTarget serviceTarget = CurrentServiceContainer.getServiceContainer();
if (serviceTarget != null) {
WritableServiceBasedNamingStore.pushOwner(serviceTarget);
try {
InitialContext context = new InitialContext();
context.bind(name, object);
} catch (NamingException e) {
LOG.error("Error in binding the object in JNDI.");
}
}
}
public static void unbindFromJndi(String name){
ServiceTarget serviceTarget = CurrentServiceContainer.getServiceContainer();
if (serviceTarget != null) {
WritableServiceBasedNamingStore.pushOwner(serviceTarget);
try {
InitialContext context = new InitialContext();
context.unbind(name);
} catch (NamingException e) {
LOG.error("Error in unbinding the object from JNDI.");
}
}
}
}
With the EAP 6.1.0.Alpha, I am getting the error of "
Caused by: java.lang.NoSuchMethodError:
org.jboss.as.naming.WritableServiceBasedNamingStore.pushOwner(Lorg/jboss/msc/service/ServiceTarget;[Lorg/jboss/msc/service/ServiceName;)V",
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira