All,
This my first time using MongoEMF. I'm following the user guide under the heading Create and I get error saying "unknown protocol: mongodb". No doubt I'm doing something wrong. I suspect I went wrong with IMongoProvider when I didn't do anything wrt ConfigurationAdmin, but I'm not sure. What gives?
Thanks in advance
java.net.MalformedURLException: unknown protocol: mongodb13:22:51.757 [Gogo shell] ERROR cmd.CommandSet -
My code:
// Type this command at the OSGi console and we should get a simple save.
public Object _savecda(CommandInterpreter itrp) {
// Load a clinical document from the filesystem.
File file = new File("samples/SampleCDADocument.xml");
log.info("file=" + file.getAbsolutePath());
try {
Reader reader = new BufferedReader(new FileReader(file));
InputSource is = new InputSource(reader);
ClinicalDocument cda = CDAUtil.load(is); // we now have a CDA which is based on EMF.
// Clinical document loaded successfully.
//begin: Mongo-emf related code
IResourceSetFactory resourceSetFactory = new MongoResourceSetFactory();
ResourceSet resourceSet = resourceSetFactory.createResourceSet();
Resource resource = resourceSet.createResource(URI
.createURI("mongodb://localhost/ehr/cda/"));
EList<EObject> eo = resource.getContents();
eo.add(cda);
try {
cda.eResource().save(null);
} catch (IOException e) {
log.error("", e); // unknown protocol: mongodb
}
//end Mongo-emf related code
log.info("cda=" + cda.toString());
} catch (Exception e) {
log.error("", e);
}
return null;
}
--
You received this message because you are subscribed to the Google Groups "MongoEMF" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoemf+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
g! lb
START LEVEL 1
ID|State |Level|Name
0|Active | 0|System Bundle (4.2.1)
1|Active | 1|Logback Classic Module (1.0.0)
2|Active | 1|Logback Core Module (1.0.0)
3|Active | 1|Storet MongoCDA Command (0.0.0) // My command bundle
4|Active | 1|Storet Mongo Componenture (0.0.0)
5|Active | 1|Apache Felix Configuration Admin Service (1.6.0)
6|Active | 1|Apache Felix Gogo Command (0.12.0)
7|Active | 1|Apache Felix Gogo Runtime (0.10.0)
8|Active | 1|Apache Felix Gogo Shell (0.10.0)
9|Active | 1|Apache Felix Log Service (1.0.1)
10|Active | 1|Apache Felix Declarative Services (1.6.2)
11|Active | 1|eMongo Services API (1.0.0.201310230854) // Looks good to me
12|Active | 1|MongoDB Java Driver (2.11.1.RELEASE)
13|Active | 1|OPS4J Pax Logging - API (1.3.0)
14|Active | 1|OPS4J Pax Logging - Service (1.3.0)
15|Active | 1|osgi.cmpn (5.0.0.201305092017)
16|Active | 1|osgi.enterprise (4.2.0.201003190513)
17|Active | 1|osgi.residential (4.3.0.201111022239)
18|Active | 1|slf4j-api (1.6.2)
But the command won't run if the component contains the following code:
@Reference
public void setMongoDatabaseProvider(
MongoDatabaseProvider mongoDatabaseProvider) {
log.info("mongoDatabaseProvider=" + mongoDatabaseProvider);
this.mongoDatabaseProvider = mongoDatabaseProvider;
}
-buildpath: osgi.core,\
osgi.cmpn,\
biz.aQute.bnd.annotation,\
org.apache.felix.gogo.runtime,\
iop.storet.mgo.provider;version=latest,\
slf4j.api,\
org.eclipselabs.emongo.api,\
org.eclipselabs.emongo.components,\
org.eclipselabs.emongo.configurator
-sub: *.bnd
From run.runBundle:
-runfw: org.apache.felix.framework;version='[4,5)'
-runee: JavaSE-1.7
-runsystemcapabilities: ${native_capability}
-resolve.effective: active
-runbundles: ch.qos.logback.classic;version='[1.0.0,1.0.1)',\
ch.qos.logback.core;version='[1.0.0,1.0.1)',\
iop.storet.cmd.command;version=latest,\
iop.storet.mgo.provider;version=latest,\
org.apache.felix.configadmin;version='[1.6.0,1.6.1)',\
org.apache.felix.gogo.command;version='[0.12.0,0.12.1)',\
org.apache.felix.gogo.runtime;version='[0.10.0,0.10.1)',\
org.apache.felix.gogo.shell;version='[0.10.0,0.10.1)',\
org.apache.felix.log;version='[1.0.1,1.0.2)',\
org.apache.felix.scr;version='[1.6.2,1.6.3)',\
org.eclipselabs.emongo.api;version='[1.0.0,1.0.1)',\
org.mongodb.mongo-java-driver;version='[2.11.1,2.11.2)',\
org.ops4j.pax.logging.pax-logging-api;version='[1.3.0,1.3.1)',\
org.ops4j.pax.logging.pax-logging-service;version='[1.3.0,1.3.1)',\
osgi.cmpn;version='[5.0.0,5.0.1)',\
osgi.enterprise;version='[4.2.0,4.2.1)',\
osgi.residential;version='[4.3.0,4.3.1)',\
slf4j.api;version='[1.6.2,1.6.3)'
-runrequires: osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.shell)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.command)',\
osgi.identity;filter:='(osgi.identity=osgi.cmpn)',\
osgi.identity;filter:='(osgi.identity=org.ops4j.pax.logging.pax-logging-service)',\
osgi.identity;filter:='(osgi.identity=iop.storet.cmd.command)',\
osgi.identity;filter:='(osgi.identity=iop.storet.mgo.provider)',\
osgi.identity;filter:='(osgi.identity=org.eclipselabs.emongo.api)',\
osgi.identity;filter:='(osgi.identity=org.eclipselabs.emongo.components)',\
osgi.identity;filter:='(osgi.identity=org.eclipselabs.emongo.configurator)'
{
clientId = (String) properties.get(PROP_CLIENT_ID);
handleIllegalConfiguration(validateClientId(clientId));