Hi, 

I've just make the changes that you propose
configModule.values(ServerAddress.class);

new
   MongoMapEntityStoreAssembler().withConfig(configModule, 
Visibility.application)
                                  .visibleIn(Visibility.application)
                                  .identifiedBy("mongodb.booking.store")
                                  .assemble(module);


I also changed the .properties file.

But now I get back the following exception:



org.qi4j.bootstrap.AssemblyException: Unable to create Application Model.
        at 
org.qi4j.bootstrap.Energy4Java.newApplicationModel(Energy4Java.java:76)
        at org.qi4j.bootstrap.Energy4Java.newApplication(Energy4Java.java:83)
        at 
com.projectbeagle.gateway.kernel.scope.wiring.ApplicationPool.fillUp(ApplicationPool.java:74)
        ... 47 more
Caused by: org.qi4j.api.common.InvalidApplicationException: Could not register 
[class com.mongodb.ServerAddress, interface org.qi4j.api.value.ValueComposite]
        at 
org.qi4j.runtime.bootstrap.ValueAssemblyImpl.newValueModel(ValueAssemblyImpl.java:105)
        at 
org.qi4j.runtime.bootstrap.ModuleAssemblyImpl.assembleModule(ModuleAssemblyImpl.java:519)
        at 
org.qi4j.runtime.bootstrap.ApplicationModelFactoryImpl.newApplicationModel(ApplicationModelFactoryImpl.java:86)
        at 
org.qi4j.bootstrap.Energy4Java.newApplicationModel(Energy4Java.java:72)
        ... 49 more
Caused by: org.qi4j.api.composite.InvalidCompositeException: No implementation 
found for method 
    public boolean com.mongodb.ServerAddress.sameHost(java.lang.String)
in
    [class com.mongodb.ServerAddress, interface 
org.qi4j.api.value.ValueComposite]
        at 
org.qi4j.runtime.bootstrap.CompositeAssemblyImpl.implementMethod(CompositeAssemblyImpl.java:307)
        at 
org.qi4j.runtime.bootstrap.CompositeAssemblyImpl.implementMixinType(CompositeAssemblyImpl.java:214)
        at 
org.qi4j.runtime.bootstrap.CompositeAssemblyImpl.buildComposite(CompositeAssemblyImpl.java:181)
        at 
org.qi4j.runtime.bootstrap.ValueAssemblyImpl.newValueModel(ValueAssemblyImpl.java:96)
        ... 52 more




Any suggestions? 

Regards,
Apostolis
 

    Στις 3:24 μ.μ. Τετάρτη, 3 Μαΐου 2017, ο/η Niclas Hedhman 
<[email protected]> έγραψε:
 

 Greetings,Are you on Qi4j 2.1 ?
If I remember correctly, firstly you need to declare the ServerAddress as a 
value composite in the configuration module of MongoDbEntityStore and secondly 
you need to use JSON in the bootstrap configuration. I think (and Paul can 
probably correct me if I am wrong) that you can either use .json file instead 
of .properties file, or have a JSON object for the nodes properties.
HOWEVER, the ServerAddress doesn't have setters, and I am not sure if Jackson 
will deserialize that anyway.
But in principle this should work...

nodes=[ { "host":"n1.acme.com"}, { "host":"n2.acme.com"}, { 
"host":"n3.acme.com"}, { "host":"n4.acme.com"} ]

I would be delighted to hear if it does or not, as this would affect 3.0 
release as well.
CheerNiclas

On Wed, May 3, 2017 at 6:08 PM, Apostolos Krionidis 
<[email protected]> wrote:

Hello I' m Apostolis
I'm working with Qi4j a couple of years and recently I tried to connect with 
MongoDb Entity Store.
Everything was fine and I successfully insert entities in Mongo when I 
configure the .property file with hostname and port.

The problem came when I tried to configure in the .property file the nodes 
property.
So when I use the nodes property I get back the following error:"Could not find 
any visible ValueComposite of type [com.mongodb.ServerAddress] in module 
[config]"
How can I add more nodes in MongoEntityStore.
My current version is 2.1
Thank you very muchApostolis





-- 
Niclas Hedhman, Software Developer
http://polygene.apache.org - New Energy for Java

   

Reply via email to