• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with ENC  RSS feed

 
Markus Schmider
Ranch Hand
Posts: 148
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am trying to understand the ENC so I began playing around a bit.
If I understood it right you can define an alias for a resource (e.g. an EJB) in the local namespace of a EJB.

I thought EJB(name specifies the ENC name of an EJB in the ENC of the EJB on which the annotation it used, so that you can use this name to lookup the EJB "ejb/FechterDAO"
I tried this with the following example:


When I try to execut addFechter() I get (on Glassfish V3)
[#|2011-02-04T10:19:26.615+0100|SEVERE|glassfishv3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=34;_ThreadName=Thread-1;|javax.naming.NamingException: Lookup failed for 'java:comp:/env/ejb/FechterDAO' in SerialContext [Root exception is javax.naming.NameNotFoundException: No object bound to name java:comp:/env/ejb/FechterDAO]

Any help would be appreciated.
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you try



i.e value of beanName instead of name, also try without java:com:/env.. atleast with my environment with jboss it works with MYApp/FechterDAOBean where MYApp is name of my ear file.
if this dosenot work, look for JNDI tree in App server and see to what name is this DAO bound.

Not very concrete help but worth trying.
 
Ram Narayan.M
Ranch Hand
Posts: 247
Chrome Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All are correct...

I suppose the mistake is in ""java:comp:/env/ejb/FechterDAO""...

It should be

"java:comp/env/ejb/FechterDAO"
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!