If Framework .getRuntime() fails it means the runtime was not started (even if the JAR was deployed) To be able to start the runtime you need to use nuxeo.ear and remove all nuxeo jars but
nuxeo-runtime.jar, nuxeo-runtime-osgi.jar and osgi-core-4.1.jar
Also you need these two JARS:
nuxeo-common-xxx.jar
nuxeo-runtime-jboss-extensions-xxx.jar

in jboss lib directory and you need to override the deploy/ear-deployment.xml with the one from nuxeo.
(you can get this file from a nuxeo installation ...)


Unfortunately there is not yet a simple way to deploy nuxeo runtime for now in jboss.
This is possible but needs some special packaging.
Here is a hack to have runtime working outside nuxeo.ear in jboss:

You need to create a .sar package
that contains the nuxeo-common.jar, nuxeo-runtime.jar, nuxeo-runtime-jboss-adapter.jar, nuxeo-runtime-osgi.jar and in META-INF
the jboss-servioce.xml attached to that mail.
Also you need to modify the org.nuxeo.osgi.jboss.JBossOSGiAdapter class
and replace the line 137
       File installDir = FileUtils.getFileFromURL(getEARDeployment().url);
with something like
File installDir = new File("path/to/nuxeo/home/dir");

You can use as home directory the workingDir created on the line above:
File workingDir =  new File(jbossConfig.getServerDataDir(), "NXRuntime");

You should do these modifications because the getEARDeployment() assume you are in a nuxeo.ear.

After this, the runtime should work.
Nuxeo will provide in future a packaging to have the runtime outside nuxeo.ear in jboss (may be in some weeks)

Bogdan


Krys Malak wrote:
Hi,

I want to access the Nuxeo Runtime and in it a component through an
ejb-client, but I think i'm missing something.

I try the following:

"Framework.getRuntime();" and the result is a NullPointer Exception. (Or in
the 1.0.0 Release NXRuntime.getRuntime(); it is the same)

I am 100% sure that the runtime is running and i can correctly deploy,
register and activate components in it.

What i'm not sure is if i missed adding some necessary library or
configuration file in this ejb-client.

This client basically executes this line (the following don't matter, since
already this one fails) and has the necessary runtime.jar. I also tried
adding other .jar file like the osgi.core etc. but this did not help, so I
guess ist something else i'm overlooking and need to add either in the code
or some additional config files or libraries.

Hope somebody can help me with this.

Cheers,
Krys



_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

<?xml version="1.0" encoding="UTF-8"?>

<server>

   <mbean code="org.nuxeo.osgi.jboss.JBossOSGiAdapter"
        name="nx:service=adapter">

        <attribute name="SubscriptionList">
            <subscription-list>
                <mbean name="jboss.system:type=Server">
                    <notification
                        type="org.jboss.system.server.started" />
                </mbean>
                <mbean name="jboss.system:service=ServiceDeployer">
                    <notification
                        type="org.jboss.deployment.SubDeployer.create" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.start" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.stop" />
                </mbean>
                <mbean name="jboss.system:service=JARDeployer">
                    <notification
                        type="org.jboss.deployment.SubDeployer.create" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.start" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.stop" />
                </mbean>
                <mbean name="jboss.j2ee:service=EARDeployer">
                    <notification
                        type="org.jboss.deployment.SubDeployer.create" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.start" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.stop" />
                </mbean>
                <mbean name="jboss.j2ee:service=ClientDeployer">
                    <notification
                        type="org.jboss.deployment.SubDeployer.create" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.start" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.stop" />
                </mbean>
                <mbean name="jboss.ejb3:service=EJB3Deployer">
                    <notification
                        type="org.jboss.deployment.SubDeployer.create" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.start" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.stop" />
                </mbean>
                <mbean name="jboss.ejb:service=EJBDeployer">
                    <notification
                        type="org.jboss.deployment.SubDeployer.create" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.start" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.stop" />
                </mbean>
                <mbean name="jboss.web:service=WebServer">
                    <notification
                        type="org.jboss.deployment.SubDeployer.create" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.start" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.stop" />
                </mbean>
                <mbean name="jboss.jca:service=RARDeployer">
                    <notification
                        type="org.jboss.deployment.SubDeployer.create" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.start" />
                    <notification
                        type="org.jboss.deployment.SubDeployer.stop" />
                </mbean>

            </subscription-list>

        </attribute>

    </mbean>

</server>


_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to