10-31-2011 07:29 AM
Hi,
I'm would like to embed the Nuxeo DM core into my application so that I can make Java API calls to it to store and retrieve documents. However, I don't see what is the right starting point for this. I tried to work with the FrameworkerLoader from http://doc.nuxeo.com/display/KB/How+to+use+an+embedded+Nuxeo+from+a+Java+application but I get a NullPointerException when I call Framework.getLocalService(SchemaManager.class). Can somebody provide me with a more complete example on how to embed Nuxeo?
Thanks
Martin
11-02-2011 08:07 AM
There must be logs about missing code (such as ClassNotFoundException). If you do get some logs (confirming you properly configured the logging) but no error, please fill a Jira issue about raising errors at framework initialization: https://jira.nuxeo.com/browse/NXP
About nuxeo-core-schema, if you look at its Maven POM, you will see it has dependencies on other Nuxeo modules: nuxeo-common, nuxeo-runtime
and on third-party libraries: xsom and relaxngDatatype
See https://maven.nuxeo.org/nexus/ => nuxeo-core-schema-5.4.2.pom
Note those modules will also have their own dependencies. Manually resolving them will be a pain. You should use Maven for compiling and resolving dependencies. See http://doc.nuxeo.com/x/BIAO
FYI, here's a simplified dependency tree of nuxeo-core-schema:
$ mvn dependency:tree -o
org.nuxeo.ecm.core:nuxeo-core-schema:jar:5.4.2
+- org.nuxeo.common:nuxeo-common:jar:5.4.2:compile
| +- xerces:xercesImpl:jar:2.9.1:provided
| +- org.osgi:osgi-core:jar:4.1:provided
| +- commons-io:commons-io:jar:1.4:provided
| +- commons-lang:commons-lang:jar:2.3:provided
| \- commons-logging:commons-logging:jar:1.1:provided
| +- log4j:log4j:jar:1.2.16:provided (version managed from 1.2.12)
| +- logkit:logkit:jar:1.0.1:provided
| +- avalon-framework:avalon-framework:jar:4.1.3:provided
| \- javax.servlet:servlet-api:jar:2.4:provided (version managed from 2.3)
+- org.nuxeo.runtime:nuxeo-runtime:jar:5.4.2:compile
| +- org.nuxeo.common:nuxeo-common:jar:5.4.2:compile
| +- javax.transaction:jta:jar:1.1:provided
| \- commons-jexl:commons-jexl:jar:1.1:provided
+- com.sun.xml:xsom:jar:20060306:compile
\- com.sun.xml:relaxngDatatype:jar:1.0:compile
10-31-2011 11:18 AM
Hi,
10-31-2011 12:57 PM
Hi,
10-31-2011 01:36 PM
Since runtime is null, you have an issue with the framework initialization.
11-01-2011 04:40 AM
The framework reports no errors during initialization. However, my problem seems to be that I did not provide all the bundles required to run my code, because after adding all .jars from the bundles directory of the distribution, my code works. Of course, this is not optimal so I wonder how I can figure out which bundles are required. Currently, I only want to get a reference to the SchemaManager (Framework.getLocalService(SchemaManager.class)) and thus I thought that adding nuxeo-core-schema-5.4.2.jar would be sufficient, but I was wrong. What else do I need to add?
11-02-2011 08:07 AM
There must be logs about missing code (such as ClassNotFoundException). If you do get some logs (confirming you properly configured the logging) but no error, please fill a Jira issue about raising errors at framework initialization: https://jira.nuxeo.com/browse/NXP
About nuxeo-core-schema, if you look at its Maven POM, you will see it has dependencies on other Nuxeo modules: nuxeo-common, nuxeo-runtime
and on third-party libraries: xsom and relaxngDatatype
See https://maven.nuxeo.org/nexus/ => nuxeo-core-schema-5.4.2.pom
Note those modules will also have their own dependencies. Manually resolving them will be a pain. You should use Maven for compiling and resolving dependencies. See http://doc.nuxeo.com/x/BIAO
FYI, here's a simplified dependency tree of nuxeo-core-schema:
$ mvn dependency:tree -o
org.nuxeo.ecm.core:nuxeo-core-schema:jar:5.4.2
+- org.nuxeo.common:nuxeo-common:jar:5.4.2:compile
| +- xerces:xercesImpl:jar:2.9.1:provided
| +- org.osgi:osgi-core:jar:4.1:provided
| +- commons-io:commons-io:jar:1.4:provided
| +- commons-lang:commons-lang:jar:2.3:provided
| \- commons-logging:commons-logging:jar:1.1:provided
| +- log4j:log4j:jar:1.2.16:provided (version managed from 1.2.12)
| +- logkit:logkit:jar:1.0.1:provided
| +- avalon-framework:avalon-framework:jar:4.1.3:provided
| \- javax.servlet:servlet-api:jar:2.4:provided (version managed from 2.3)
+- org.nuxeo.runtime:nuxeo-runtime:jar:5.4.2:compile
| +- org.nuxeo.common:nuxeo-common:jar:5.4.2:compile
| +- javax.transaction:jta:jar:1.1:provided
| \- commons-jexl:commons-jexl:jar:1.1:provided
+- com.sun.xml:xsom:jar:20060306:compile
\- com.sun.xml:relaxngDatatype:jar:1.0:compile
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.