[jboss-user] [JBoss Seam] - Seam cannot find component

arnieAustin do-not-reply at jboss.com
Tue Nov 14 17:01:41 EST 2006


I have a seam component (it is not an Entity since there is no table related to it in this application) that at run time cannot be located for some reason. I've included the errors from the log below. The User class is used in the UserLogin/UserLoginAction class, populated via the userLogin.xhtml file. I just don't see what's wrong here.


  | package us.tx.state.oag.DPSLicenseInquiry.business;
  | 
  | import org.hibernate.validator.Length;
  | import org.hibernate.validator.NotNull;
  | import org.jboss.seam.ScopeType;
  | import org.jboss.seam.annotations.Name;
  | import org.jboss.seam.annotations.Scope;
  | 
  | import us.tx.state.oag.OagIdVault.OagIdVaultAccount;
  | import us.tx.state.oag.DPSLicenseInquiry.business.User;
  | 
  | @Name("user")
  | @Scope(ScopeType.SESSION)
  | public class User {
  | 	private String cs_user_login = null;
  | 	private String cs_user_password = null;
  | 	private OagIdVaultAccount oagIdVaultAccount = null; 
  | 	public User () {}
  | 	
  | 	@NotNull @Length(min=2)
  | 	public void setUserLogin(String ps_value) {
  | 		cs_user_login = ps_value;
  | 	}
  | 	@NotNull
  | 	public String getUserLogin() {
  | 		return cs_user_login;
  | 	}
  | 	@NotNull @Length(min=5)
  | 	public void setUserPassword(String ps_value) {
  | 		cs_user_password = ps_value;
  | 	}
  | 	public String getUserPassword() {
  | 		return cs_user_password;
  | 	}
  | 	
  | 	public void setOagIdVaultAccount(OagIdVaultAccount po_account) {
  | 		oagIdVaultAccount = new OagIdVaultAccount(po_account);
  | 	}
  | }
  | 

The error is:


  | 2006-11-14 15:49:13,250 DEBUG [org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener] beginning transaction prior to phase: RESTORE_VIEW(1)
  | 2006-11-14 15:49:13,250 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
  | 2006-11-14 15:49:13,250 DEBUG [org.jboss.seam.contexts.Lifecycle] >>> Begin web request
  | 2006-11-14 15:49:13,281 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.manager
  | 2006-11-14 15:49:13,281 DEBUG [org.jboss.seam.core.Manager] No stored conversation
  | 2006-11-14 15:49:13,281 DEBUG [org.jboss.seam.contexts.Contexts] found in application context: org.jboss.seam.core.init
  | 2006-11-14 15:49:13,281 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] After restoring conversation context: ConversationContext(2)
  | 2006-11-14 15:49:13,296 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user
  | 2006-11-14 15:49:13,296 DEBUG [org.jboss.seam.Component] seam component not found: user
  | 2006-11-14 15:49:13,296 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
  | 2006-11-14 15:49:13,343 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user
  | 2006-11-14 15:49:13,343 DEBUG [org.jboss.seam.Component] seam component not found: user
  | 2006-11-14 15:49:13,343 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
  | 2006-11-14 15:49:13,343 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
  | 2006-11-14 15:49:13,343 DEBUG [org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener] committing transaction after phase: PROCESS_VALIDATIONS(3)
  | 2006-11-14 15:49:13,343 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
  | 2006-11-14 15:49:13,343 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
  | 2006-11-14 15:49:13,343 DEBUG [org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener] beginning transaction prior to phase: RENDER_RESPONSE(6)
  | 2006-11-14 15:49:13,343 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
  | 2006-11-14 15:49:13,343 DEBUG [org.jboss.seam.Component] instantiating Seam component: facesMessages
  | 2006-11-14 15:49:13,359 DEBUG [org.jboss.seam.core.Manager] Discarding conversation state: 2
  | 2006-11-14 15:49:13,359 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing page context
  | 2006-11-14 15:49:13,375 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
  | 2006-11-14 15:49:13,375 DEBUG [org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener] committing transaction after phase: RENDER_RESPONSE(6)
  | 2006-11-14 15:49:13,375 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
  | 2006-11-14 15:49:13,375 DEBUG [org.jboss.seam.contexts.Lifecycle] After render response, destroying contexts
  | 2006-11-14 15:49:13,375 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying event context
  | 2006-11-14 15:49:13,375 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager
  | 2006-11-14 15:49:13,375 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.application.jsp.JspStateManagerImpl.SERIALIZED_VIEW
  | 2006-11-14 15:49:13,375 DEBUG [org.jboss.seam.contexts.Contexts] destroying: com.sun.facelets.legacy.ELCONTEXT
  | 2006-11-14 15:49:13,375 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying conversation context
  | 2006-11-14 15:49:13,375 DEBUG [org.jboss.seam.contexts.Contexts] destroying: facesMessages
  | 2006-11-14 15:49:13,375 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing server-side conversation context
  | 2006-11-14 15:49:13,375 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End web request
  | 2006-11-14 15:49:13,375 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
  | 


  | package us.tx.state.oag.DPSLicenseInquiry.business;
  | 
  | import java.io.Serializable;
  | 
  | import javax.ejb.Remove;
  | import javax.ejb.Stateful;
  | import javax.faces.application.Application;
  | import javax.faces.component.UIMessage;
  | import javax.faces.context.FacesContext;
  | import javax.persistence.EntityManager;
  | import javax.persistence.PersistenceContext;
  | 
  | import org.jboss.seam.annotations.Create;
  | import org.jboss.seam.annotations.In;
  | import org.jboss.seam.annotations.Name;
  | import org.jboss.seam.annotations.Out;
  | import org.jboss.seam.annotations.Scope;
  | import org.jboss.seam.annotations.Destroy;
  | import org.jboss.seam.ScopeType;
  | 
  | import us.tx.state.oag.DPSLicenseInquiry.business.User;
  | import us.tx.state.oag.DPSLicenseInquiry.business.DpsLicenseInquiryConstants;
  | 
  | import us.tx.state.oag.OagIdVault.OagIdVault;
  | import us.tx.state.oag.OagIdVault.OagIdVaultAccount;
  | 
  | @Stateful
  | @Name("UserLogin")
  | @Scope(ScopeType.CONVERSATION)
  | public class UserLoginAction implements UserLogin {
  | 	@In(create=true, required=true)
  | 	@Out
  | 	private User user;
  | 	
  | 	//seam-gen method
  | 	public String doAction() {
  | 		FacesContext facesContext = FacesContext.getCurrentInstance();
  |         Application application = facesContext.getApplication();
  |         String ls_result = null;
  |         
  | 		// check to see that the user object above has been created and passed in
  | 		if ( user == null ) {
  | 			System.out.println("No user object passed in!");
  | 			return ls_result;
  | 		} else {
  | 			System.out.println("User object to find: " + user.getUserLogin());
  | 		}
  | 		
  | 		
  | 		OagIdVault userVault = new OagIdVault();
  | 		if ( userVault.connectDefaults() == false ) {
  | 			System.out.println("Unable to connect to LDAP server.");
  | 			return ls_result;
  | 		}
  | 		OagIdVaultAccount lo_user = null;
  | 		lo_user = userVault.authenticateUser(user.getUserLogin(), user.getUserPassword());
  | 		if ( lo_user != null ) { 
  | 			// fake out security
  | 			//lo_user.addToGroup(DpsLicenseInquiryConstants.CS_DPS_LI_Security_Group);
  | 			
  | 			// determine if the user is a member of the group
  | 			if ( lo_user.findGroupName(DpsLicenseInquiryConstants.CS_DPS_LI_Security_Group) ) {
  | 				ls_result = "success";
  | 			} else {
  | 				/*
  | 				UIMessage msg = (UIMessage)application.createComponent("javax.faces.HtmlMessage");
  | 				msg.getAttributes().put("for", "username");
  | 				msg.set*/
  | 				ls_result = "failure";
  | 			}
  | 		}
  | 		userVault.disconnect();
  | 		
  | 		return ls_result;
  | 	}
  | 	
  | 	@Remove @Destroy
  | 	public void destroy() {}
  | }
  | 

XHTML FILE

  | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  |                       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  | <html xmlns="http://www.w3.org/1999/xhtml"
  |       xmlns:s="http://jboss.com/products/seam/taglib"
  |       xmlns:ui="http://java.sun.com/jsf/facelets"
  |       xmlns:f="http://java.sun.com/jsf"
  |       xmlns:h="http://java.sun.com/jsf/html">
  | <head>
  |     <f:loadBundle basename="messages" var="msgs" />     
  | 	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  | 	<title>OAG / DPS License Inquiry</title>
  | 	<link href="stylesheet/theme.css" rel="stylesheet" type="text/css" />
  | </head>
  | <body>
  | <div id="pgHeader">
  | 	<img src="images/banner.jpg" alt="OAG Banner" width="800px"/>
  | </div>
  | <div id="pgHeaderText">Office of the Attorney General</div>
  | 
  | <div class="pgHorizSpace" style="color: white;">DPS License Search</div>
  | 
  | <div class="pgAttention">
  | 	<p class="error"><b>*** WARNING ***</b></p>
  | 	<p class="warning">The information queried by this system has been provided by the DPS<br></br>
  | 			with the understanding that it will not be abused or released.<br></br>
  | 		Your access is conditional on the information contained herein remaining <b>Private</b>
  | 			and <b>Privileged</b>.<br></br><br></br>
  | 		Every query is logged by User Id. Printing of this data is <b>Strongly Discouraged</b>.<br></br>
  | 		 <br></br>
  | 	</p>
  | </div>
  | 
  | <div class="pgHorizSpace"> </div>
  | 
  | <div id="pgMessages">
  | 	<h:messages globalOnly="true"/>
  | </div>
  | 
  | <div id="pgContent">
  | <h:form>
  | 	<fieldset>
  | 		<legend>Enter your User Credentials</legend>
  | 		<table class="formInput">
  | 			<tr><td> </td></tr>
  | 			<tr><td class="formLabelColumn">User Login:</td>
  | 				<td class="formSpacerColumn"> </td>
  | 				<td class="formFieldColumn"><h:inputText id="username" value="#{user.userLogin}"/></td>
  | 			</tr>
  | 			<tr><td class="formLabelColumn"> </td>
  | 				<td class="formSpacerColumn"> </td>
  | 				<td class="formFieldColumn"><h:message for="username"/></td></tr>
  | 
  | 			<tr><td class="formLabelColumn">Password:</td>
  | 				<td class="formSpacerColumn"> </td>
  | 				<td class="formFieldColumn"><h:inputSecret id="password" value="#{user.userPassword}"/></td>
  | 			</tr>
  | 			
  | 			<tr><td> </td></tr>
  | 			<tr><td class="formLabelColumn"> </td>
  | 				<td class="formSpacerColumn"> </td>
  | 				<td class="formFieldColumn"><h:commandButton action="#{UserLogin.doAction}" value="Login" class="button" /></td>
  | 			</tr>
  | 			<tr><td> </td></tr>
  | 		</table>
  | 	</fieldset>
  | </h:form>
  | </div>
  | <div class="pgHorizSpace"> </div>
  | <div id="pgFooter">
  | 	<p>This is some footer text</p>
  | 	<p class="copyright">© 2006 Office of the Attorney General</p>
  | </div>
  | </body> 
  | </html>
  | 

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

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




More information about the jboss-user mailing list