geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shiva Kumar H R" <shiv...@gmail.com>
Subject Re: WAR deployment problem: Could not find an EJB for reference ejb/ModuleFactory
Date Wed, 04 Jul 2007 06:55:45 GMT
Comments inline.

On 7/3/07, Xh <xhsaymyname@yahoo.co.uk> wrote:
>
> Hi All!
>
> I can deploy successfully the EJB JAR that defines remote stateful session
> bean.
> But I have a problem while deploying WAR application that needs to
> retrieve this remote session bean.
>
> In my EJB JAR I have defined two files: META-INF/ejb-jar.xml and
> META-INF/openejb-jar.xml
>
> ejb-jar.xml extract follows:
> <enterprise-beans>
> <session>
>             <display-name>ModuleFactory</display-name>
>             <ejb-name>ModuleFactory</ejb-name>
>             <home>org.xh.dataweaver.common.ejb.ModuleFactoryHome</home>
>             <remote>org.xh.dataweaver.common.ejb.ModuleFactory</remote>
>             <ejb-class>
> org.xh.dataweaver.enterprise.core.ejb.ModuleFactoryBean</ejb-class>
>             <session-type>Stateful</session-type>
>             <transaction-type>Container</transaction-type>
> </session>
> </enterprise-beans>
>
> openejb-jar.xml extract follows:
> <enterprise-beans>
>     <session>
>     <ejb-name>ModuleFactory</ejb-name>
>     <ejb-ref>
>         <ref-name>ejb/ModuleFactory</ref-name>
>         <ejb-link>ModuleFactory</ejb-link>
>     </ejb-ref>
>     </session>
> </enterprise-beans>
>

There isn't a need to specify the <ejb-ref> element here. It instead needs
to be in the referring WAR's geronimo-web.xml. Create a "geronimo-web.xml"
as below and specify it while deploying your WAR.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
    <dep:environment xmlns:dep="
http://geronimo.apache.org/xml/ns/deployment-1.1">
        <dep:moduleId>
            <dep:groupId>your-web-app's-group-id</dep:groupId>
            <dep:artifactId>your-web-app's-artifact-id</dep:artifactId>
            <dep:version>1.0</dep:version>
            <dep:type>war</dep:type>
        </dep:moduleId>
        <dep:dependencies>
            <dep:dependency>
                <dep:groupId>ejb's-group-id</dep:groupId>
                <dep:artifactId>ejb's-artifact-id</dep:artifactId>
                <dep:type>jar</dep:type>
            </dep:dependency>
        </dep:dependencies>
    </dep:environment>
    <context-root>your-web-app's-context-root</context-root>
    <nam:ejb-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1">
        <nam:ref-name>ejb/ModuleFactory</nam:ref-name>
        <nam:ref-link>ModuleFactory</nam:ref-link>
    </nam:ejb-ref>
</web-app>

I am assuming you are deploying on Geronimo 1.1. For higher versions you
will have to change the xsd versions above to web-1.1, deployment-1.2 &
naming-1.2.

After successful deployment of EJB JAR I tried to create proper web.xml file
> for my WAR application.
>
> In WEB-INF/web.xml I wrote:
> <ejb-ref>
>     <ejb-ref-name>ejb/ModuleFactory</ejb-ref-name>
>     <ejb-ref-type>Session</ejb-ref-type>
>     <home>org.xh.dataweaver.common.ejb.ModuleFactoryHome</home>
>     <remote>org.xh.dataweaver.common.ejb.ModuleFactory</remote>
>     <ejb-link>ModuleFactory</ejb-link>
> </ejb-ref>
>

Don't know if specifying <ejb-link> here would help.  Try with an <ejb-ref>
element in geronimo-web.xml as above and see if it solves the problem.

But when I'm deploying WAR I receive:
>
> Could not find an EJB for reference ejb/ModuleFactory to a remote session
> bean that has the home interface
> org.xh.dataweaver.common.ejb.ModuleFactoryHome and the remote interface
> org.xh.dataweaver.common.ejb.ModuleFactory
>
> what am I doing wrong?
> I read http://cwiki.apache.org/GMOxDOC11/ejb-sample-application.html and
> http://cwiki.apache.org/GMOxDOC11/very-simple-session-ejb-example.html
> but I still don't see the error in my descriptors...
>

For more info refer this
http://www.chariotsolutions.com/geronimo/geronimo-1.1/geronimo-html-toc.html


thanks in advance for help
> best regards
> Lukasz
>
> ------------------------------
> Yahoo! Answers - Get better answers from someone who knows. Try it now<http://uk.answers.yahoo.com/;_ylc=X3oDMTEydmViNG02BF9TAzIxMTQ3MTcxOTAEc2VjA21haWwEc2xrA3RhZ2xpbmU>
> .
>

Mime
View raw message