You are looking for the local container.
It is deployed at local/<ejb-name> by default.
In your case lookup("local/Content");
Alternatively specify
<ejb-name>Content</ejb-name>
<local-jndi-name>Content</local-jndi-name>
</ejb-name>
in jboss.xml
Regards,
Adrian
On Sat, 2003-08-30 at 01:15, Matthew Hixson wrote:
> On Friday, August 29, 2003, at 04:41 PM, Adrian Brock wrote:
>
> > It isn't necessary. There are defaults for everything.
> > The defaults are unlikely to be the best options for all your beans.
> >
> > On Fri, 2003-08-29 at 23:54, Matthew Hixson wrote:
> >> In my .ear I have a .jar. (I guess that's better than having my ear
> >> in
> >> a jar. ahahhaaha.....)
> >> Anyway, it seems that anytime I have jboss.xml in the META-INF
> >> directory, as I've seen some example code doing, I get an exception:
> >>
> >> javax.management.InstanceAlreadyExistsException:
> >> jboss.j2ee:jndiName=Partner,service=EJB already registered.
> >>
> >> If I don't have jboss.xml there things work as best they have so far.
> >
> > Your jndi names must be unique.
> > You have Partner twice. JBoss uses <ejb-name> when you don't specify
> > a <jndi-name> in jboss.xml.
>
> Okay, so I've gotten past this issue for now by not including a
> jboss.xml at all. Moving on...
>
> >> I wouldn't have put jboss.xml into the jar except that I'm trying to
> >> figure out why my session beans are being found in JNDI, but my entity
> >> beans are not.
> >
> > You probably have an ejb-name that isn't a valid java name.
> > The spec requires this extra restriction for entity beans
> > because it might be used as the table.
> > e.g. ejbs/MyEntity is not valid
>
> The bean I'm trying to use is called ContentBean. The entry in
> ejb-jar.xml is:
>
> <entity >
> <description><![CDATA[]]></description>
> <ejb-name>Content</ejb-name>
>
> <local-home>com.versaly.ejb.entity.ContentLocalHome</local-home>
> <local>com.versaly.ejb.entity.ContentLocal</local>
> <ejb-class>com.versaly.ejb.entity.ContentBean</ejb-class>
> <persistence-type>Container</persistence-type>
> <prim-key-class>java.lang.Integer</prim-key-class>
> <reentrant>False</reentrant>
> <cmp-version>2.x</cmp-version>
> <abstract-schema-name>v_content</abstract-schema-name>
> <cmp-field >
> <description><![CDATA[]]></description>
> <field-name>contentId</field-name>
> </cmp-field>
> <!-- other cmp fields snipped -->
> <primkey-field>contentId</primkey-field>
> <!-- ejb finders snipped -->
> </entity>
>
> A session bean which I know my code is looking up and using is defined
> as this:
>
> <session >
> <description> <![CDATA[]]> </description>
> <ejb-name>PartnerServices</ejb-name>
>
> <local-home>com.versaly.ejb.session.PartnerServicesLocalHome</local-
> home>
> <local>com.versaly.ejb.session.PartnerServicesLocal</local>
> <ejb-class>com.versaly.ejb.session.PartnerServices</ejb-class>
> <session-type>Stateless</session-type>
> <transaction-type>Container</transaction-type>
> </session>
>
> And I look it up with this:
>
> _partnerServicesHome = (PartnerServicesLocalHome)
> _context.lookup("PartnerServices");
>
> > Or maybe you have some other problem with the db mappings?
>
> I have my Postgres datasource setup properly and the entity beans
> deploy without any errors written to the console. I'm not sure that
> they're error free, but I don't think that's causing this problem.
>
> > Post the exception.
>
> When my entity home locator class tries to lookup my ContentBean with:
>
> _contentLocalHome = (ContentLocalHome)
> _context.lookup("Content");
>
> I get a NamingException:
>
> 16:30:11,889 ERROR [STDERR] NamingException
> javax.naming.NameNotFoundException: Content not bound
>
> Thanks for explaining the file purposes, too.
> -M@
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user