[jboss-user] [JBoss Tools (users)] - Re: Unknown context variable name:

scatudal@gmail.com do-not-reply at jboss.com
Mon Dec 15 09:22:49 EST 2008


It's in my session beans.  In the code bellow, identity, credentials and localLocator cause an "Unknown context variable name: "%variableName%" warning.


  | package org.domain.SeamOne.session;
  | 
  | /* imports...
  |  */
  | 
  | @Stateless
  | @Name("authenticator")
  | public class Authenticator implements IAuthenticator {
  | 
  | 	@Logger
  | 	Log log;
  | 
  | 	@In
  | 	Identity identity;
  | 	@In
  | 	Credentials credentials;
  | 	@In
  | 	LocaleSelector localeSelector;
  | 
  | 	@Out(scope = ScopeType.SESSION)
  | 	UserInfo currentUser;
  | 
  | 	@PersistenceContext
  | 	private EntityManager em;
  | 
  | 	/*
  | 	 * (non-Javadoc)
  | 	 * 
  | 	 * @see org.domain.SeamOne.session.IAuthenticator#authenticate()
  | 	 */
  | 	public boolean authenticate() {
  | 		log.info("authenticating {0}", credentials.getUsername());
  | 		// write your authentication logic here,
  | 		// return true if the authentication was
  | 		// successful, false otherwise
  | 
  | 		if ("admin".equals(credentials.getUsername())) {
  | 			identity.addRole("admin");
  | 			return true;
  | 		} else {
  | 
  | 			currentUser = (UserInfo) em
  | 					.createQuery(
  | 							"select u from UserInfo u " + "where u.userLogin=#{credentials.username} and " + 
  |           "u.password=#{credentials.password}").getSingleResult();
  | 
  | 			if (currentUser == null) {
  | 				return false;
  | 			} else {
  | 				log.info("setting locale to '{0}' for '{1}'", currentUser
  | 						.getLocale(), currentUser.getUserLogin());
  | 
  | 				localeSelector.setLocaleString(currentUser.getLocale());
  | 				localeSelector.select();
  | 				return true;
  | 			}
  | 		}
  | 	}
  | }
  | 

Is there any way I can tell eclipse how to resolve these?

Thanks

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

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



More information about the jboss-user mailing list