New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MBean for read cache cannot be registered / unregistered #4967
Comments
same issue for me with wildfly 9.0.1 |
@laa could we check if the bean is already registered and remove the previous one? Or is this the case of multiple Orient instances on the same JVM? |
As a workaround I am removing shutdown hook at app startup and shutting down Orient manually at app shutdown. However I haven't tested it enought to claim that there won't be any issues. Example @ApplicationScoped
public class AppInit {
@PostConstruct
public void init() {
Orient.instance().removeShutdownHook();
}
@PreDestroy
public void shutdown() {
Orient.instance().shutdown();
}
} |
Hi, |
Yes, problem occures consistently. As I stated I use standalone WildFly 8.2.0 Final server (using standalone-full.xml configuration without any modifications). About the steps, thats a little bit tricky - I use NetBeans 8.0.2 to handle deploy/redeploy/undeploy, but I quess NetBeans simply calls jboss-cli commands. Nevertheless, I think the issue might be related with a problem described in sources of JCA Plugin from OPS4J: @Override
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
log.debug("starting OrientResourceAdapter");
// The VM running the app server may live longer than this adapter,
// so we cannot use the default shutdown hook.
// shutdown() is called directly in stop().
Orient.instance().removeShutdownHook();
} I don't use that plugin, I was just interested about the implementation and this is where I got and inspiration for my workaround. Btw, official JTA support from Orient would be very much appreciated. |
I quess the whole problem is that OrientDB is not shutted down properly between deploys, because default shutdown hook is "hooked" on JVM shutdown, but it needs to be "hooked" on App shutdown. |
Yes , do you run shutdown on servlet context listener onShutdown and start On Mon, Oct 19, 2015, 18:17 urugator notifications@github.com wrote:
|
I use CDI container to handle my app lifecycle. https://docs.oracle.com/javaee/7/api/javax/enterprise/context/ApplicationScoped.html |
As I think about it, you should require the user to call shutdown (possibly even start) manually in any environment and keep JVM shutdown hook only as non standard, last resort way of releasing resources.
So I really believe that managing Orient instance lifecycle is a user responsibility and in that case, it needs to be well documented somewhere. However there is a question which needs to be answered: Should I be able to call start and shutdown multiple times on a single JVM instance? |
Hey, I'm uploading a basic Eclipse importable project, as well as the built, deployable war. To see the error, visit: http://localhost:8080/rest/myapp/MyResource then check the log of the server. |
I'm experiencing the same exception being thrown/logged. But my scenario is that it is thrown/logged when deploying multiple applications in the same tomcat each instantiating a OPartitionedDatabasePoolFactory. I'm saying logged, because the applications works fine anyway. But I haven't dug into it deeper into it since it still works and cleaning the log haven't been top priority. |
I too see same issue, especially when multiple apps deployed on same app server (e.g. tomcat). And like others said, apps seems to be working though not sure any further issue. Jan 04, 2016 10:59:27 PM com.orientechnologies.common.log.OLogManager log
Caused by: javax.management.InstanceAlreadyExistsException: com.orientechnologies.orient.core.storage.cache.local:type=O2QCacheMXBean |
Yes , you may do it several times . We do this in our tests without problems.
Yes, sorry but that is answer on issue, we can not manage every lifecycle of every container so users should do this manually. Also I have added warning that system probably was not shutdown correctly if MBean is already registered inside of JVM |
OrientDB 2.1.1
When I redeploy an aplication on WildFly 8.2.0 (standalone full profile) I get an exception:
It happens only on the first creation of (remote) graph instance after redeploy, additional requests (I am using OrientGraphFactory) for graph instance don't produce the exception.
I also haven't noticed any consequences so far.
Maybe the MBean cache is not properly unregistered before redeploy (because MBean server is still running), so it can't be registered again after the deployment, but I don't understand these things so I am just speculating.
Even if the exception might not be serious, I would like to get rid of it.
Maybe I could unregister the MBean from MBeanServer manually, during app shutdown, but I am afraid of possible unreleased resources used by MBean cache?
Or maybe OrientDB should check if the MBean cache is not already registered before an attempt to register?
I also get an exception when WildFly is shutting down:
Fullstacks:
The text was updated successfully, but these errors were encountered: