I have 3 couchbase clusters and I create 3 CouchbaseCluster instances for each cluster on cb clients 2.0.2 .
At every starting tomcat, I got WARN message below.
Is there any problems about one more CouchbaseCluster ?
[com.couchbase.client.core.env.CoreEnvironment] - More than 1 Couchbase Environments found (3), this can have severe impact on performance and stability. Reuse environments!
I believe that’s likely safe to ignore. You’re likely seeing it because you have three clusters and the intent of the message is to warn people who might accidentally not be reusing the CouchbaseCluster against the same cluster. I’m sure @daschl or @avsej or @simonbasle can confirm.
We may be able to make that smarter by triggering the warning only if the arguments match or something.
@Sam_K@daschl@ingenthr
Hey i have a doubt. I am getting error while defining bean in the same way you created. It is not able to resolve “couchbaseEnvironment” while creating bean.
any help ??
my spring-with-xml days are way past me, I’m not sure this can easily be done since the method for creation is neither a constructor nor a factory method on the Bucket class…
you’d have to look up if invoking another bean’s method + passing in bucket name and password is feasible in Spring (especially with xml configuration)…
@akshay I recommend you to check out the spring documentation, creating beans is not something that strictly relates to couchbase. You might want to start here: Redirecting... by using instance factory methods.
Thanks @Sam_K
i already did that.
I am facing another issue now. I have defined these beans in file named “applicationContext.xml” and when i am using
Bucket bucket = (Bucket) ( new ClassPathXmlApplicationContext(“applicationContext.xml”).getBean(“bucket”) );
in different classes.And it is creating different environments each time instead of reusing the same environment and giving the same “more than one couchbase environments found” warning.
What wrong am i doing ??
I’ve run into this as well… Basically we manage our own configuration and I’ve been able to track and re-use the duplicated cluster info. But… If the client itself detects a duplicate, why would it throw this warning out and not just mitigate the duplicate automagically? Or, is there a reason why one would want to have this behavior?