[jboss-user] [JNDI/Naming/Network] - Re: transaction exception while jndi lookup

loucs do-not-reply at jboss.com
Tue Apr 29 17:01:54 EDT 2008


i've done some tests they might be helpfull to resolve this issue.

i've changed the instruction : 
obj = (NameOfEJBLocalInterface) new InitialContext().lookup(jndiName);

to :
Object obj = new InitialContext().lookup(jndiName);
System.out.println(obj.toString());
NameOfEJBLocalInterface obj2 = (NameOfEJBLocalInterface) obj;

now the "wrong tx" exception is happening on the "cast" line (the last one)...

the jndi lookup works fine and i've got this output from the obj.toString instruction : IdentityUserModule:5c4o0f-y2rqf0-ffmxpqgv-1-ffmxtfx0-dbla

i must be doing something wrong. I'd like to add that my ear project uses Jboss-seam 2.0.0GA, and here's the code of my session EJB in the ear package :


  | import javax.ejb.Stateful;
  | 
  | import com.smalltox.business.model.persistent.impl.site.SiteAccountImpl;
  | 
  | @Stateful
  | 
  | public class IdentityUserModule implements IdentityUserModuleLocalInterface {
  | 	
  | 	public SiteAccountImpl findUserByUserName(String userName) {
  | 		//some code that uses entities to query my own database (not portal's)
  | 	}
  | }
  | 

and now the interface :


  | import javax.ejb.Local;
  | 
  | import com.smalltox.business.model.persistent.impl.site.SiteAccountImpl;
  | 
  | @Local
  | public interface IdentityUserModuleLocalInterface {
  | 	public SiteAccountImpl findUserByUserName(String userName);
  | }
  | 

maybe it has something to do with the fact that the sources of my ear are in my eclipse build path but it's not present in the JAR i put in portal libdir.

any clues would be really appreciated ;)

Regards,

--
Lucas
Montes

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147648#4147648

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147648



More information about the jboss-user mailing list