Kiuma, a solution might be to declare a local-jndi-name (perhaps only the
local variety) on your entity beans. Assuming your session beans are on the
same server you can do lookups on any entity bean without declaring which
beans you call with @ejb-ref - is it just me or is there something hideous
about having to specify which beans a given EJB uses in a deployment
descriptor? Fortunately that is not required.
* local-jndi-name="ejb/webappointments/User
----- Original Message -----
From: "kiuma" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 31, 2003 4:59 AM
Subject: Re: [JBoss-user] HELP javax.ejb.EJBException: Naming lookup
failure: User not bound
> Solved setting:
>
> In session:
>
> * @ejb.ejb-ref ejb-name="User"
> * ref-name="mywebappointments/User"
> * view-type="local"
>
> In Entity:
>
> * @ejb.bean
> * name="User"
> * display-name="User"
> * type="CMP"
> * cmp-version="2.x"
> * schema="WaUsers"
> * jndi-name="ejb/webappointments/User"
> * jndi-name="ejb/webappointments/UserLocal"
> * view-type="local"
>
> kiuma ha scritto:
>
> > Hello,
> >
> > I have the following problem:
> >
> > My session doesn't find the local EJB cmp I want to get.
> >
> > So with XDoclet I've defined UserBean.java
> >
> > * @ejb.bean
> > * name="User"
> > * display-name="User"
> > * type="CMP"
> > * cmp-version="2.x"
> > * schema="WaUsers"
> > * jndi-name="ejb/webappointments/User"
> > * view-type="local"
> >
> > Then UserSessionBean.java
> >
> > * @ejb.bean name="UserSession"
> > * display-name="User Session Bean"
> > * type="Stateless"
> > * transaction-type="Container"
> > * jndi-name="ejb/webappointments/UserSession"
> > *
> > * @ejb.ejb-ref ejb-name="User"
> > * ref-name="mywebappointments/User"
> > *
> >
> > and the function that throws NamingLookupException
> >
> > /**
> > *
> > * Find a User by his name/id
> > * @param pUserId User's name. * @return Returns the User's data.
> > * @throws RemoteException Idnicates that the modification process
> > failed
> > *
> > * @ejb.interface-method view-type="remote"
> > * @ejb.permission role-name="Admin,PoweredUser,User"
> > *
> > **/
> > public UserData getUserByPrincipalId(String pPrincipalId)
> > throws
> > RemoteException
> > {
> > try {
> > // Get User Entity Remote Interface
> > Context lContext = new InitialContext();
> > UserLocalHome lHome = (UserLocalHome)
> > PortableRemoteObject.narrow(
> > lContext.lookup(
> > "java:comp/env/ejb/mywebappointments/User"
> > ),
> > UserLocalHome.class
> > );
> > UserLocal lEntity = lHome.findByPrimaryKey( new
> > UserPK(pPrincipalId) );
> > UserData lData = lEntity.getValueObject();
> > return lData;
> > }
> > catch ( FinderException fe ) { throw new
> > EJBException( "User not found: " + fe.getMessage() );
> > }
> > catch ( NamingException ne ) { throw new
> > EJBException( "Naming lookup failure: " + ne.getMessage() );
> > } }
> >
> > ____________________________________________________________
> >
> > so the output is:
> >
> >
> > 09:42:25,758 ERROR [LogInterceptor] EJBException:
> > javax.ejb.EJBException: Naming lookup failure: User not bound
> > at
> >
com.wingstech.webappointments.session.UserSessionBean.getUserByPrincipalId(U
serSessionBean.java:710)
> >
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> >
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
> >
> > at
> >
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
> >
> > at java.lang.reflect.Method.invoke(Method.java:324)
> >
> >
> > Jndi view says
> >
> >
> > java:comp namespace of the UserSession bean:
> >
> > +- env (class: org.jnp.interfaces.NamingContext)
> > | +- ejb (class: org.jnp.interfaces.NamingContext)
> > | | +- mywebappointments (class: org.jnp.interfaces.NamingContext)
> > | | | +- Role[link -> Role] (class: javax.naming.LinkRef)
> > | | | +- UserGroups[link -> UserGroups] (class:
> > javax.naming.LinkRef)
> > | | | +- User[link -> User] (class: javax.naming.LinkRef)
> > | +- security (class: org.jnp.interfaces.NamingContext)
> > | | +- subject[link -> java:/jaas/appointmentsApp/subject]
> > (class: javax.naming.LinkRef)
> > | | +- security-domain[link -> java:/jaas/appointmentsApp]
> > (class: javax.naming.LinkRef)
> >
> >
> > I can't get out please help me!
> >
> > Thanks in advance,
> > Kiuma
> >
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.NET email is sponsored by:
> > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> > http://www.vasoftware.com
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> > .
> >
>
>
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user