Hi,

I would like to have access to the resource and class defined in a
bundle. This is for an EJB-jar packaged as a bundle. The code looks
like that

        Enumeration<?> e = bundle.findEntries("META-INF", "ejb-jar.xml", false);

        if (e != null) {
            if (e.hasMoreElements()) {
                URL ejbJarUrl = (URL) e.nextElement();

                LOGGER.info("[Deployer] It's an EJB module: " +
ejbJarUrl); // --> It's an EJB module:
bundle://143.4:0/META-INF/ejb-jar.xml

                String location = bundle.getLocation();

                try {
                    File file = new File(new URL(location).getFile());
                    try {
                        DeploymentLoader deploymentLoader = new
DeploymentLoader();
                        AppModule appModule = deploymentLoader.load(file);

but finally the URL created is not correct as it looks under
karaf_home followed by groupId/artifactId/version

-->

karaf@root> org.apache.openejb.config.UnknownModuleTypeException:
Unable to determine module type for jar:
file:/Users/charlesmoulliard/MyApplications/apache-karaf-2.2.4/org.apache.camel.example/camel-ejb/1.0:
Unknown module type:
url=file:/Users/charlesmoulliard/MyApplications/apache-karaf-2.2.4/org.apache.camel.example/camel-ejb/1.0
        at 
org.apache.openejb.config.DeploymentLoader.load(DeploymentLoader.java:141)
        at org.apache.openejb.core.osgi.impl.Deployer.deploy(Deployer.java:77)

How can I have access to the jar deployed in karaf or in the cache ?

Regards,

Charles Moulliard

Apache Committer

Blog : http://cmoulliard.blogspot.com
Twitter : http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard
Skype: cmoulliard

Reply via email to