If you need to do a lookup with "java:comp/env/ejb/MyAdminHome", then you
need to define an ejb-ref for the desired bean.
Where are you doing the lookup? If the lookup code is in another bean say
MyBean then in ejb-jar.xml, for MyBean you will need to add ejb-ref for
MyAdminHome.
Descriptor for this will bean will look like
<session>
<ejb-name>MyBean</ejb-name>
<home>abc.cde.MybeanHome</home>
<remote>abc.cde.MyBeanRemote</remote>
<ejb-class>abc.cde.MyBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-ref>
<description>No Description</description>
<ejb-ref-name>ejb/MyAdminHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>com.abc.xyz.ejb.MyAdminHome</local-home>
<remote>com.abc.xyz.ejb.MyAdmin</local>
</ejb-ref>
</session>
If the home being looked up is local, then you will need to add
ejb-local-ref.
Then in weblogic-ejb-jar.xml, under "reference-descriptor", you will have to
specify which ref maps to which jndi name.
If the lookup code is in any web component, (jsp/Servlet) then you will need
to put the refs in web.xml similarly and another entry in weblogic.xml.
In java client, you can not lookup with "java:comp/env... " unless the
server has Application client container. Wl6.1 does not have this. So, You
will need to do a direct JNDI lookup for this purpose.
Regards,
Rupesh.
> Hi All ,
>
> I have a stateless session ejb which is NOT referencing any other ejbs. I
> just wish to perform a JNDI lookup via ENC and this is how I am doing it.
I
> have successfully deployed it on Weblogic 6.1 server.
>
> Context ctx = new InitialContext();
> Object obj = ctx.lookup("java:comp/env/ejb/MyAdminHome");//throws an
> Exception
>
> BUT
>
> Object obj = ctx.lookup("MyAdminHome");//works fine
> ....
> ....
>
>
> But it gives me an Exception saying
>
> Unable to resolve comp/env/ejb/SMProCardSpendAdminHome Resolved:
'comp/env'
> Unresolved:'ejb'
>
> The ejb-jar.xml looks like this
> <ejb-jar>
> <enterprise-beans>
> <session>
> <ejb-name>MyAdminBean</ejb-name>
> <home>com.abc.xyz.ejb.MyAdminHome</home>
> <remote>com.abc.xyz.ejb.MyAdmin</remote>
> <ejb-class>com.abc.xyz.ejb.MyAdminBean</ejb-class>
> <session-type>Stateless</session-type>
> <transaction-type>Container</transaction-type>
> </session>
> </enterprise-beans>
> </ejb-jar>
>
> and the weblogic-ejb-jar.xml looks like this
>
> <weblogic-enterprise-bean>
> <ejb-name>MyAdminBean</ejb-name>
> <stateless-session-descriptor>
> <pool>
>
<max-beans-in-free-pool>100</max-beans-in-free-pool>
>
> <initial-beans-in-free-pool>5</initial-beans-in-free-pool>
> </pool>
> </stateless-session-descriptor>
> <jndi-name>MyAdminHome</jndi-name>
> </weblogic-enterprise-bean>
>
> Where am I faltering? Can anybody please point out? I saw the petstore
> weblogic deployment descriptor for the Customer session bean but couldnt
> understand how the ENC lookup was working there.
>
> - Rahul
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".