[
http://jira.jboss.com/jira/browse/JBSEAM-3029?page=comments#action_12414115 ]
asookazian commented on JBSEAM-3029:
------------------------------------
Well if that's it, then the root cause in this SFSB (if this particular one was having
the exception posted, not even sure there are currently 4 in this app) may be in the
following code validation. I have done extensive refactoring on this project and using
Hibernate Validator annotations on SFSB methods and entity class methods as much as
possible. If it happens any time soon I will try to capture the code/files that are
causing the exception to happen.
//TO DO: refactor this method (it is duplicated in AssignToStorageAction)
public void validateBarCode(ValueChangeEvent event) throws AbortProcessingException {
myInput = (HtmlInputText)event.getComponent();
String localBarCode = "";
fc = FacesContext.getCurrentInstance();
fc.getExternalContext().getRequestMap().put("focusId",(event.getComponent().getClientId(FacesContext.getCurrentInstance())));
boolean invalidFormat = false;
boolean invalidRangeChk = false;
boolean invalidLengthChk = false;
boolean notInInvChk = false;
boolean notDuplicateOnScreenChk = false;
boolean alreadyAssignedOrDepToUser = false;
try {
if (myInput.getValue() != null) {
localBarCode = myInput.getValue().toString().trim();
if (localBarCode.length()>0) {
int len= localBarCode.length() ;
int s_charcode = 0;
for (int i=0;i<len;i++) {
s_charcode = localBarCode.charAt(i);
if(!((s_charcode>=48 && s_charcode<=57))) {
msg = localBarCode+ " HAS INVALID FORMAT - PLEASE ENTER A NUMERIC BARCODE
(EX: 01234)";
msgConfirm = "YES";
myInput.setStyle("border-right-color: Red; border-bottom-color: Red;
border-top-width: medium; border-top-color: Red; border-right-width: medium;
border-left-width: medium; border-left-color: Red; border-bottom-width: medium");
setCompId(fc.getExternalContext().getRequestMap().get("focusId").toString());
setCompMsg(msgConfirm);
setMsg(msg);
setMyImg("/error.gif");
invalidFormat = true;
}
}
}
if (invalidFormat== false && invalidRangeChk== false &&
(localBarCode.length() > 0 && localBarCode.length() < 5)) {
msg = localBarCode+" INVALID "+" - PERMITTED BARCODE LENGTH MUST BE
5.";
msgConfirm = "YES";
myInput.setStyle("border-right-color: Red; border-bottom-color: Red;
border-top-width: medium; border-top-color: Red; border-right-width: medium;
border-left-width: medium; border-left-color: Red; border-bottom-width: medium");
setCompId(fc.getExternalContext().getRequestMap().get("focusId").toString());
setCompMsg(msgConfirm);
setMsg(msg);
setMyImg("/error.gif");
invalidLengthChk = true;
}
if (invalidFormat== false && invalidRangeChk == false &&
invalidLengthChk == false && localBarCode.length() == 5) {
int total = findBarCode(localBarCode);
if(total == 0) {
msg = localBarCode+ " - NOT AVAILABLE IN INVENTORY.";
msgConfirm = "YES";
myInput.setStyle("border-right-color: Red; border-bottom-color: Red;
border-top-width: medium; border-top-color: Red; border-right-width: medium;
border-left-width: medium; border-left-color: Red; border-bottom-width: medium");
setCompId(fc.getExternalContext().getRequestMap().get("focusId").toString());
setCompMsg(msgConfirm);
setMsg(msg);
setMyImg("/error.gif");
notInInvChk = true;
}
else if (hardwareList != null) {
for (int i=0;i<hardwareList.size();i++) {
log.info("CoxBarCode = "+hardwareList.get(i).getCoxBarcode()+" |
Historical Status =
"+hardwareList.get(i).getTrHardwareStatus().getHardwareStatus().trim());
if
(hardwareList.get(i).getTrHardwareStatus().getHardwareStatus().trim().equalsIgnoreCase(SHIMSConstants.ASSIGN_TO_TECH_STATUS_ID.trim()))
{
msg = localBarCode+ " - ALREADY ASSIGNED TO TECHNICIAN.";
msgConfirm = "YES";
myInput.setStyle("border-right-color: Red; border-bottom-color: Red;
border-top-width: medium; border-top-color: Red; border-right-width: medium;
border-left-width: medium; border-left-color: Red; border-bottom-width: medium");
setCompId(fc.getExternalContext().getRequestMap().get("focusId").toString());
setCompMsg(msgConfirm);
setMsg(msg);
setMyImg("/error.gif");
alreadyAssignedOrDepToUser = true;
break;
}
if
(hardwareList.get(i).getTrHardwareStatus().getHardwareStatus().trim().equalsIgnoreCase(SHIMSConstants.DEPLOYED_TO_USER_STATUS_ID.trim()))
{
msg = localBarCode+ " - DEPLOYED TO USER.";
msgConfirm = "YES";
myInput.setStyle("border-right-color: Red; border-bottom-color: Red;
border-top-width: medium; border-top-color: Red; border-right-width: medium;
border-left-width: medium; border-left-color: Red; border-bottom-width: medium");
setCompId(fc.getExternalContext().getRequestMap().get("focusId").toString());
setCompMsg(msgConfirm);
setMsg(msg);
setMyImg("/error.gif");
alreadyAssignedOrDepToUser = true;
break;
}
}
}
}
if (notInInvChk == false && alreadyAssignedOrDepToUser == false &&
hardwareTableList != null && localBarCode.length() == 5) {
for (int j=0;j<hardwareTableList.size();j++) {
Object[] obj = (Object[])hardwareTableList.get(j);
TbHardware tbHardware = (TbHardware)obj[0];
if (localBarCode.equalsIgnoreCase(tbHardware.getCoxBarcode())) {
msg = localBarCode+ " - DUPLICATE ASSIGNMENT TO TECHNICIAN.";
msgConfirm = "YES";
myInput.setStyle("border-right-color: Red; border-bottom-color: Red;
border-top-width: medium; border-top-color: Red; border-right-width: medium;
border-left-width: medium; border-left-color: Red; border-bottom-width: medium");
setCompId(fc.getExternalContext().getRequestMap().get("focusId").toString());
setCompMsg(msgConfirm);
setMsg(msg);
setMyImg("/error.gif");
notDuplicateOnScreenChk = true;
}
}
}
getBarCodeDetails(localBarCode);
}
}
catch (Exception e) {
e.printStackTrace();
}
}
SeamPhaseListener swallowing NullPointerException
-------------------------------------------------
Key: JBSEAM-3029
URL:
http://jira.jboss.com/jira/browse/JBSEAM-3029
Project: Seam
Issue Type: Bug
Affects Versions: 2.0.1.GA
Environment: Seam 2.0.1.GA
JBoss 4.2.1.GA
RF3.2.0.SR1
Windows XP 5.1 SP2
Reporter: asookazian
Not sure what the root cause of this is, how to reproduce it, or what damage it may cause
while executing use cases in the app. As directed by Dan Allen, posting stack trace
here:
11:42:10,468 ERROR [SeamPhaseListener] uncaught exception
java.lang.NullPointerException
at org.apache.catalina.connector.Request.parseParameters(Request.java:2409)
at org.apache.catalina.connector.Request.getParameterNames(Request.java:1073)
at
org.apache.catalina.connector.RequestFacade.getParameterNames(RequestFacade.java:371)
at
javax.servlet.ServletRequestWrapper.getParameterNames(ServletRequestWrapper.java:178)
at
com.sun.faces.context.RequestParameterMap.getEntryIterator(ExternalContextImpl.java:1174)
at com.sun.faces.context.BaseContextMap$EntrySet.iterator(ExternalContextImpl.java:575)
at com.sun.faces.context.BaseContextMap$BaseSet.size(ExternalContextImpl.java:563)
at java.util.Collections$UnmodifiableCollection.size(Unknown Source)
at java.util.AbstractMap.size(Unknown Source)
at java.util.Collections$UnmodifiableMap.size(Unknown Source)
at org.jboss.seam.contexts.EntityBeanMap.passivateAll(EntityBeanMap.java:65)
at
org.jboss.seam.contexts.AbstractEntityBeanCollection.passivate(AbstractEntityBeanCollection.java:43)
at
org.jboss.seam.contexts.ServerConversationContext.isAttributeDirty(ServerConversationContext.java:307)
at
org.jboss.seam.contexts.ServerConversationContext.flush(ServerConversationContext.java:280)
at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:371)
at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:112)
at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:502)
at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:235)
at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:182)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:256)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:362)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:488)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
11:42:10,468 ERROR [SeamPhaseListener] swallowing exception
java.lang.NullPointerException
at org.apache.catalina.connector.Request.parseParameters(Request.java:2409)
at org.apache.catalina.connector.Request.getParameterNames(Request.java:1073)
at
org.apache.catalina.connector.RequestFacade.getParameterNames(RequestFacade.java:371)
at
javax.servlet.ServletRequestWrapper.getParameterNames(ServletRequestWrapper.java:178)
at
com.sun.faces.context.RequestParameterMap.getEntryIterator(ExternalContextImpl.java:1174)
at com.sun.faces.context.BaseContextMap$EntrySet.iterator(ExternalContextImpl.java:575)
at com.sun.faces.context.BaseContextMap$BaseSet.size(ExternalContextImpl.java:563)
at java.util.Collections$UnmodifiableCollection.size(Unknown Source)
at java.util.AbstractMap.size(Unknown Source)
at java.util.Collections$UnmodifiableMap.size(Unknown Source)
at org.jboss.seam.contexts.EntityBeanMap.passivateAll(EntityBeanMap.java:65)
at
org.jboss.seam.contexts.AbstractEntityBeanCollection.passivate(AbstractEntityBeanCollection.java:43)
at
org.jboss.seam.contexts.ServerConversationContext.isAttributeDirty(ServerConversationContext.java:307)
at
org.jboss.seam.contexts.ServerConversationContext.flush(ServerConversationContext.java:280)
at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:371)
at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:112)
at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:502)
at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:235)
at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:182)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:256)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:362)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:488)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira