[Installation, Configuration & DEPLOYMENT] - Re: Maven + Embedded EJB + JPA +EJB 3.0 getting Null name
by r_sudh
Took me a while to get this but here it is:
The persistence.xml should look almost exactly like below:
<persistence>
| <persistence-unit name="myPU">
| <jta-data-source>java:/MyDB</jta-data-source>
| <properties>
| <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect" />
| <property name="hibernate.hbm2ddl.auto" value="update" />
| </properties>
| </persistence-unit>
| </persistence>
Each tag should be in one single line with no line breaks. The Null name I was getting is most likely a bug in parsing this persistence.xml file with line breaks.
Also, since I was coming from a toplink background I found that the data source has to be name "java:/MyDB" as opposed to "jdbc/MyDB"
Then make sure you have the corresponding data source defined in embedded-jboss-beans.xml as below
<bean name="MyDB" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
| <property name="driverClass">com.mysql.jdbc.Driver</property>
| <property name="connectionURL">jdbc:mysql://dev1:3306/mydb?user=root&password=hello</property>
| <property name="jndiName">java:/MyDB</property>
| <property name="transactionManager"><inject bean="TransactionManager"/></property>
| <property name="cachedConnectionManager"><inject bean="CachedConnectionManager"/></property>
| <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
| </bean>
|
Finally here is a method that will test your code:
| public void create() throws Exception {
| Owner owner = new Owner();
| OwnerData ownerData = new OwnerData();
| ownerData.setName("Test Company");
| ownerData.setContact("Richard");
| ownerData.setPhone("979-777-7777");
| owner.setOwnerData(ownerData);
|
| EJB3StandaloneBootstrap.boot(null);
| EJB3StandaloneBootstrap.scanClasspath();
|
| InitialContext ctx = getInitialContext();
|
| OwnerDAO dao = (OwnerDAO) ctx.lookup("OwnerDAOBean/local");
| dao.create(owner);
| EJB3StandaloneBootstrap.shutdown();
| }
I was having problems trying to get the lookup to work when the container was being started by a BeforeGroups method. But I've save that for another post. Once you get it all working it's pretty cool :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071420#4071420
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071420
18Â years, 8Â months
[JBoss Seam] - Double Click . Seam 1.2.1.GA
by lilianas
Hi:
I got one particular Next button on the screen which when I click the Next button twice, I encountered the following exception. Note that this Next button performs a number of validation steps before it renders the next screen. Some other buttons which perform only 1 step validation does not have this problem. I suspect the slow render process is causing the problem. This is the exception:
javax.faces.el.EvaluationException: /normal-application.jspx @13,72 rendered="#{normalCreditApplication.serviceProvider}": Exception getting value of property serviceProvider of base of type : com.yoogalu.ncf.web.seam.bean.NormalCreditApplication_$$_javassist_2
at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
:
:
:
Caused by: org.jboss.seam.NoConversationException: no long-running conversation for @Conversational bean: normalCreditApplication
at org.jboss.seam.interceptors.ConversationalInterceptor.aroundInvoke(ConversationalInterceptor.java:55)
The Next button is defined in the page (.xhmtl) as follow:
<h:form id='normalApp'>
:
:
<h:commandButton value="#{msg['creditApplication.next']}"
action="next" styleClass="buttom" />
</h:form>
In the page flow (pageflow.jpdl.xml), the transition for Next is defined as follow. It goes through valideLocation, validaInvoiceNo, validateSecondApplicant, validaDefaultPrintPrivacy, normalSerialNumberPrint:
| <page name="normal" view-id="/normal-application.jspx"
| back="disabled">
| <redirect />
| <transition name="next"
| to="validateLocation"></transition>
| </page>
|
| <decision name="validateLocation"
| expression="#{normalCreditApplication.validateLocation}">
| <transition name="true"
| to="validaInvoiceNo"></transition>
| <transition name="false" to="normal"></transition>
| </decision>
|
| <decision name="validaInvoiceNo"
| expression="#{normalCreditApplication.validaInvoiceNo}">
| <transition name="true"
| to="validateSecondApplicant">
| </transition>
| <transition name="false" to="normal"></transition>
| </decision>
|
| <decision name="validateSecondApplicant"
| expression="#{normalCreditApplication.validateSecondApplicant}">
| <transition name="true" to="validaDefaultPrintPrivacy"></transition>
| <transition name="false" to="normal"></transition>
| </decision>
|
| <decision name="validaDefaultPrintPrivacy"
| expression="#{normalCreditApplication.validaDefaultPrintPrivacy}">
| <transition name="true" to="normalSerialNumberPrint">
| <action
| expression="#{normalCreditApplication.calculateSerialNumber}" />
| <action expression="#{normalCreditApplication.setMapPrint}" />
| </transition>
| <transition name="false" to="normalListPossibleDebtors">
| </transition>
| </decision>
|
| <page name="normalSerialNumberPrint"
| view-id="/normal-serialnumber-print.jspx" back="enabled">
| <redirect />
| <transition name="previous" to="normal">
| <action
| expression="#{normalCreditApplication.setNoPrinting}" />
| </transition>
| <transition name="next" to="validaSerialNumber">
| <action expression="#{normalCreditApplication.setPrinting}" />
| </transition>
| </page>
|
|
| Many Thanks
|
|
| |
| | anonymous wrote :
| | |
| | |
| | | My page:
| | |
| | | | (It is the template) ... Here have the code that is broken when i press a lot of time the next buttom
| | | | ***
| | | | <h:panelGroup rendered="#{!normalCreditApplication.serviceProvider}">
| | | | **
| | | |
| | | | <?xml version="1.0" encoding="UTF-8"?>
| | | | <jsp:root xmlns="http://www.w3.org/1999/xhtml"
| | | | xmlns:jsp="http://java.sun.com/JSP/Page"
| | | | xmlns:ui="http://java.sun.com/jsf/facelets"
| | | | xmlns:h="http://java.sun.com/jsf/html"
| | | | version="2.0">
| | | |
| | | | <ui:composition template="/WEB-INF/view/layout/default.jspx">
| | | | <ui:define name="body-content">
| | | | <ui:include src="/WEB-INF/view/body-content/normal-application.jspx"/>
| | | | </ui:define>
| | | | <ui:define name="title">
| | | |
| | | | <h:panelGroup rendered="#{normalCreditApplication.serviceProvider}">
| | | | <h:outputText value="#{msg['createServProvApplication-title']}" styleClass="page_title" />
| | | | </h:panelGroup>
| | | | <h:panelGroup rendered="#{!normalCreditApplication.serviceProvider}">
| | | | <h:outputText value="#{msg['createStandardApplication-title']}" styleClass="page_title" />
| | | | </h:panelGroup>
| | | | </ui:define>
| | | | <ui:define name="description">
| | | | <h:outputText value="#{msg['normalApplication-description']}" />
| | | | </ui:define>
| | | |
| | | | <ui:define name="load-index">
| | | | </ui:define>
| | | | </ui:composition>
| | | | </jsp:root>
| | | |
| | | | (It is the body)
| | | |
| | | | <?xml version="1.0" encoding="UTF-8"?>
| | | | <jsp:root xmlns="http://www.w3.org/1999/xhtml"
| | | | xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
| | | | xmlns:a="https://ajax4jsf.dev.java.net/ajax"
| | | | xmlns:c="http://java.sun.com/jstl/core"
| | | | xmlns:f="http://java.sun.com/jsf/core"
| | | | xmlns:h="http://java.sun.com/jsf/html"
| | | | xmlns:jsp="http://java.sun.com/JSP/Page"
| | | | xmlns:rich="http://richfaces.ajax4jsf.org/rich"
| | | | xmlns:s="http://jboss.com/products/seam/taglib"
| | | | xmlns:ui="http://java.sun.com/jsf/facelets" version="2.0">
| | | | <h:messages globalOnly="true" styleClass="alertMsgBold" />
| | | | <div><h:form id='normalApp'>
| | | |
| | | |
| | | | <s:validateAll>
| | | |
| | | |
| | | | <a4j:region id="autocomplete">
| | | |
| | | | <table width="610" border="0">
| | | | <tr>
| | | | <td colspan="4"><h:outputText id="idHeaderLocation"
| | | | value="#{msg['creditApplication.headerLocation']}"
| | | | styleClass="header1" /></td>
| | | | </tr>
| | | |
| | | | <c:if test="#{userCredentials.allStoresAccessor}">
| | | |
| | | | <tr>
| | | | <td width="10"><img src="images/point.gif" /></td>
| | | | <td width="100"><h:outputText for="company"
| | | | value="#{msg['creditApplication.company']}" /></td>
| | | | <td width="300"><a4j:outputPanel id="companyPanel">
| | | | <a4j:region id="companyRegion" renderRegionOnly="false">
| | | | <h:inputText
| | | | value="#{normalCreditApplication.autoCompleteLocation.companySel}"
| | | | size="50" required="true" id="company" />
| | | |
| | | | <rich:suggestionbox for="company"
| | | | suggestionAction="#{normalCreditApplication.autoCompleteLocation.autocompleteCompany}"
| | | | var="company" height="200" width="250" requestDelay="350"
| | | | focus="store" ignoreDupResponses="true">
| | | | <a4j:support event="onselect"
| | | | action="#{normalCreditApplication.autoCompleteLocation.onSelectCompany}"
| | | | reRender="storePanel,dealerPanel"
| | | | oncomplete="setFocus('normalApp:store');" />
| | | | <h:column>
| | | | <h:outputText value="#{company.companyCode}-#{company.name}" />
| | | | </h:column>
| | | | </rich:suggestionbox>
| | | | </a4j:region>
| | | | </a4j:outputPanel></td>
| | | | <td width="200"><a4j:outputPanel ajaxRendered="true">
| | | | <h:message for="company" styleClass="alertMsg" />
| | | | </a4j:outputPanel></td>
| | | | </tr>
| | | | </c:if>
| | | | <c:if test="#{!userCredentials.allStoresAccessor}">
| | | | <tr>
| | | | <td width="10"><img src="images/point.gif" /></td>
| | | | <td width="100"><h:outputText for="company"
| | | | value="#{msg['creditApplication.company']}" /></td>
| | | | <td width="300"><h:outputText for="company"
| | | | value="#{normalCreditApplication.autoCompleteLocation.companySel}" />
| | | | </td>
| | | | <td width="200"></td>
| | | | </tr>
| | | | </c:if>
| | | | <c:if test="#{userCredentials.allStoresAccessor}">
| | | | <tr>
| | | | <td><img src="images/point.gif" /></td>
| | | | <td><h:outputText for="store"
| | | | value="#{msg['creditApplication.store']}" /></td>
| | | | <td><a4j:outputPanel id="storePanel">
| | | | <a4j:region id="storeRegion" renderRegionOnly="false">
| | | | <h:inputText
| | | | value="#{normalCreditApplication.autoCompleteLocation.storeSel}"
| | | | size="50" required="true" id="store" />
| | | | <rich:suggestionbox for="store" requestDelay="350"
| | | | suggestionAction="#{normalCreditApplication.autoCompleteLocation.autocompleteStore}"
| | | | var="store" height="200" width="250" focus="dealer">
| | | | <a4j:support event="onselect"
| | | | action="#{normalCreditApplication.autoCompleteLocation.onSelectStore}"
| | | | reRender="dealerPanel"
| | | | oncomplete="setFocus('normalApp:dealer');" />
| | | | <h:column>
| | | | <h:outputText value="#{store.storeCode}-#{store.name}" />
| | | | </h:column>
| | | | </rich:suggestionbox>
| | | | </a4j:region>
| | | | </a4j:outputPanel></td>
| | | | <td><a4j:outputPanel ajaxRendered="true">
| | | | <h:message for="store" styleClass="alertMsg" />
| | | | </a4j:outputPanel></td>
| | | | </tr>
| | | | </c:if>
| | | | <c:if test="#{!userCredentials.allStoresAccessor}">
| | | | <tr>
| | | | <td><img src="images/point.gif" /></td>
| | | | <td><h:outputText for="store"
| | | | value="#{msg['creditApplication.store']}" /></td>
| | | | <td><h:outputText for="store"
| | | | value="#{normalCreditApplication.autoCompleteLocation.storeSel}" />
| | | | </td>
| | | | <td></td>
| | | | </tr>
| | | | </c:if>
| | | | <tr>
| | | | <td><img src="images/point.gif" /></td>
| | | | <td><h:outputText for="dealer"
| | | | value="#{msg['creditApplication.dealer']}" /></td>
| | | | <td><a4j:outputPanel id="dealerPanel">
| | | |
| | | | <h:inputText
| | | | value="#{normalCreditApplication.autoCompleteLocation.dealerSel}"
| | | | size="50" id="dealer" required="true" />
| | | | <rich:suggestionbox for="dealer" requestDelay="350"
| | | | suggestionAction="#{normalCreditApplication.autoCompleteLocation.autocompleteDealer}"
| | | | var="dealer" height="200" width="250">
| | | | <a4j:support event="onselect"
| | | | oncomplete="setFocus('normalApp:invoice');" />
| | | | <h:column>
| | | | <h:outputText
| | | | value="#{dealer.departmentCode}-#{dealer.franchiseName}" />
| | | | </h:column>
| | | | </rich:suggestionbox>
| | | |
| | | | </a4j:outputPanel></td>
| | | | <td><a4j:outputPanel ajaxRendered="true">
| | | | <h:message for="dealer" styleClass="alertMsg" />
| | | | </a4j:outputPanel></td>
| | | | </tr>
| | | | </table>
| | | | </a4j:region>
| | | | <table width="560">
| | | | <tr>
| | | | <td colspan="4" height="10"></td>
| | | | </tr>
| | | | <tr>
| | | | <td colspan="4"><h:outputText id="headerApplicationDetails"
| | | | value="#{msg['creditApplication.headerApplicationDetails']}"
| | | | styleClass="header1" /></td>
| | | | </tr>
| | | | <tr>
| | | | <td width="10"><img src="images/point.gif" /></td>
| | | | <td width="100"><h:outputText for="invoice"
| | | | value="#{msg['creditApplication.invoice']}" /></td>
| | | | <td width="150"><h:inputText id="invoice"
| | | | value="#{normalCreditApplication.application.primaryInvoice.invoiceNo}"
| | | | required="true"></h:inputText></td>
| | | | <td width="300"><h:message for="invoice" styleClass="alertMsg" /></td>
| | | | </tr>
| | | | <tr>
| | | | <td colspan="4" height="10"></td>
| | | | </tr>
| | | | <tr>
| | | | <td colspan="4"><h:outputText for="headerFirstApplicant"
| | | | value="#{msg['creditApplication.headerFirstApplicant']}"
| | | | styleClass="header1" /></td>
| | | | </tr>
| | | | <tr>
| | | | <td><img src="images/point.gif" /></td>
| | | | <td><h:outputText for="firstName"
| | | | value="#{msg['creditApplication.firstName']}" /></td>
| | | | <td><h:inputText id="firstName"
| | | | value="#{normalCreditApplication.application.applicant1.customer.firstName}"
| | | | required="true"></h:inputText></td>
| | | | <td><h:message for="firstName" styleClass="alertMsg" /></td>
| | | | </tr>
| | | | <tr>
| | | | <td><img src="images/point.gif" /></td>
| | | | <td><h:outputText for="middleName"
| | | | value="#{msg['creditApplication.middleName']}" /></td>
| | | | <td><h:inputText id="middleName"
| | | | value="#{normalCreditApplication.application.applicant1.customer.middleName}"></h:inputText></td>
| | | | <td><h:message for="middleName" styleClass="alertMsg" /></td>
| | | | </tr>
| | | | <tr>
| | | | <td><img src="images/point.gif" /></td>
| | | | <td><h:outputText for="surname"
| | | | value="#{msg['creditApplication.surname']}" /></td>
| | | | <td><h:inputText id="surname"
| | | | value="#{normalCreditApplication.application.applicant1.customer.surname}"
| | | | required="true"></h:inputText></td>
| | | | <td><h:message for="surname" styleClass="alertMsg" /></td>
| | | | </tr>
| | | | <tr>
| | | | <td colspan="4" height="10"></td>
| | | | </tr>
| | | | <tr>
| | | | <td colspan="4"><h:outputText for="headerSecondApplicant"
| | | | value="#{msg['creditApplication.headerSecondApplicant']}"
| | | | styleClass="header1" /></td>
| | | | </tr>
| | | | <tr>
| | | | <td><img src="images/point.gif" /></td>
| | | | <td><h:outputText for="firstNameSecond"
| | | | value="#{msg['creditApplication.firstName']}" /></td>
| | | | <td><h:inputText id="firstNameSecond"
| | | | value="#{normalCreditApplication.application.applicant2.customer.firstName}"></h:inputText></td>
| | | | <td><h:message for="firstNameSecond" styleClass="alertMsg" /></td>
| | | | </tr>
| | | | <tr>
| | | | <td><img src="images/point.gif" /></td>
| | | | <td><h:outputText for="middleNameSecond"
| | | | value="#{msg['creditApplication.middleName']}" /></td>
| | | | <td><h:inputText id="middleNameSecond"
| | | | value="#{normalCreditApplication.application.applicant2.customer.middleName}"></h:inputText></td>
| | | | <td><h:message for="middleNameSecond" styleClass="alertMsg" /></td>
| | | | </tr>
| | | | <tr>
| | | | <td><img src="images/point.gif" /></td>
| | | | <td><h:outputLabel for="surnameSecond"
| | | | value="#{msg['creditApplication.surname']}" /></td>
| | | | <td><h:inputText id="surnameSecond"
| | | | value="#{normalCreditApplication.application.applicant2.customer.surname}"></h:inputText></td>
| | | | <td><h:message for="surnameSecond" styleClass="alertMsg" /></td>
| | | | </tr>
| | | | </table>
| | | |
| | | | <f:subview rendered="#{normalCreditApplication.serviceProvider}">
| | | |
| | | |
| | | |
| | | | <table width="560" border="0">
| | | | <tr>
| | | | <td colspan="4"><h:outputText id="headerServiceProvider"
| | | | value="#{msg['creditApplication.headerServiceProvider']}"
| | | | styleClass="header1" /></td>
| | | | </tr>
| | | |
| | | | <tr>
| | | | <td width="10"><img src="images/point.gif" /></td>
| | | | <td width="100"><h:outputLabel for="serviceProv"
| | | | value="#{msg['creditApplication.serviceProvider']}" /></td>
| | | | <td width="400"><h:selectOneMenu
| | | | value="#{normalCreditApplication.application.serviceProvider}"
| | | | style="width:280px"
| | | | valueChangeListener="#{normalCreditApplication.onSelectServiceProvider}"
| | | | id="serviceProviderId">
| | | | <s:selectItems
| | | | value="#{normalCreditApplication.listServiceProviders}"
| | | | var="serviceProvider" onchange="submit()" immediate="true"
| | | | label="#{serviceProvider.name}" />
| | | | <f:converter converterId="serviceProviderConverter" />
| | | | </h:selectOneMenu></td>
| | | | <td width="50"><h:message for="serviceProv"
| | | | styleClass="alertMsg" /></td>
| | | | </tr>
| | | |
| | | | </table>
| | | | </f:subview>
| | | |
| | | | </s:validateAll>
| | | | <h:commandButton value="#{msg['creditApplication.next']}"
| | | | action="next" styleClass="buttom" />
| | | | </h:form> <br />
| | | | <br />
| | | | </div>
| | | | <script type="text/javascript">
| | | |
| | | |
| | | |
| | | | function setFocus(parm) {
| | | | document.getElementById(parm).focus();
| | | | }
| | | |
| | | | </script>
| | | |
| | | |
| | | | </jsp:root>
| | | |
| | | My Bean
| | |
| | | | package com.yoogalu.ncf.web.seam.bean;
| | | |
| | | | import java.io.Serializable;
| | | | import java.sql.Timestamp;
| | | | import java.util.HashMap;
| | | | import java.util.List;
| | | | import java.util.Map;
| | | | import javax.faces.event.ValueChangeEvent;
| | | | import org.jboss.seam.ScopeType;
| | | | import org.jboss.seam.annotations.Begin;
| | | | import org.jboss.seam.annotations.Conversational;
| | | | 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.datamodel.DataModel;
| | | | import org.jboss.seam.annotations.datamodel.DataModelSelection;
| | | | import org.jboss.seam.core.FacesMessages;
| | | |
| | | | import com.yoogalu.framework.FrameworkConstants;
| | | | import com.yoogalu.ncf.core.cache.CompanyCache;
| | | | import com.yoogalu.ncf.core.cache.DealerCache;
| | | | import com.yoogalu.ncf.core.cache.ServiceProviderCache;
| | | | import com.yoogalu.ncf.core.cache.StoreCache;
| | | | import com.yoogalu.ncf.core.entity.AppCustomer;
| | | | import com.yoogalu.ncf.core.entity.Application;
| | | | import com.yoogalu.ncf.core.entity.Company;
| | | | import com.yoogalu.ncf.core.entity.Customer;
| | | | import com.yoogalu.ncf.core.entity.Dealer;
| | | | import com.yoogalu.ncf.core.entity.Invoice;
| | | | import com.yoogalu.ncf.core.entity.ServiceProvider;
| | | | import com.yoogalu.ncf.core.entity.Store;
| | | | import com.yoogalu.ncf.core.util.AppContext;
| | | | import com.yoogalu.ncf.web.seam.Tokens;
| | | | import com.yoogalu.ncf.web.seam.Util;
| | | | import com.yoogalu.ncf.web.seam.bean.UserCredentials;
| | | |
| | | | @Name("normalCreditApplication")
| | | | @Scope(ScopeType.CONVERSATION)
| | | | @Conversational
| | | | public class NormalCreditApplication implements Serializable {
| | | |
| | | | private static final long serialVersionUID = FrameworkConstants.SERIAL_VERSION_UID;
| | | |
| | | | private static final int MAX_SERIAL = 999;
| | | |
| | | | private static final String APPLICATIONREF = "applicationRef";
| | | |
| | | | private static final String APPLICANTNAME1 = "applicantName1";
| | | |
| | | | private static final String APPLICANTNAME2 = "applicantName2";
| | | |
| | | | private static final String SERIALNO = "serialNo";
| | | |
| | | | private static final String DEALERNAME = "dealerName";
| | | |
| | | | private static final String APPFEE = "appFee";
| | | |
| | | | private static final String APPSTATUS_NEWAPPLICATION = "N";
| | | |
| | | | private static final String NAMETEMPLATE = "template";
| | | |
| | | | private static final String PRIVACY = "privacy";
| | | |
| | | | private static final String ONE = "One";
| | | |
| | | | private static final String TWO = "Two";
| | | |
| | | | private static final String APPLICATIONFEE = "applicationFee";
| | | |
| | | | private static final String NAMEFIELD1VALUE = "________________________________";
| | | |
| | | | private static final String DATEFIELD1VALUE = "___/___/_____";
| | | |
| | | | private static final String DATETEXT1VALUE = "Date";
| | | |
| | | | private static final String NAMEFIELD1 = "nameField1";
| | | |
| | | | private static final String DATEFIELD1 = "dateField1";
| | | |
| | | | private static final String DATETEXT1 = "dateText1";
| | | |
| | | | private static final String NAMEFIELD2 = "nameField2";
| | | |
| | | | private static final String DATEFIELD2 = "dateField2";
| | | |
| | | | private static final String DATETEXT2 = "dateText2";
| | | |
| | | | private Dealer dealer;
| | | |
| | | | private String surnameSearch;
| | | |
| | | | private String firstNameSearch;
| | | |
| | | |
| | | | private String serialNumberUser;
| | | |
| | | | private List<Customer> listPossibleDebtors;
| | | |
| | | | private boolean serviceProvider;
| | | |
| | | | private boolean secondApplicant;
| | | |
| | | | private String idServiceProvider;
| | | |
| | | | private String companyName;
| | | |
| | | | private String storeName;
| | | |
| | | | private String dealerName;
| | | |
| | | | private Integer numRows;
| | | | private boolean flgPrint;
| | | | private AutoCompleteLocation autoCompleteLocation ;
| | | | @Out(value = Tokens.entityLookup4Application, scope = ScopeType.CONVERSATION)
| | | | private Application application;
| | | |
| | | | @Out(value = "mapPrint", scope = ScopeType.CONVERSATION, required = false)
| | | | private transient Map<String, String> mapPrint;
| | | |
| | | | @In(value = Tokens.bean4UserCredentials, scope = ScopeType.SESSION)
| | | | private transient UserCredentials userCredentials;
| | | |
| | | | @DataModelSelection(value = "listPossibleDebtors")
| | | | private Customer customerSelected;
| | | |
| | | | @In
| | | | private FacesMessages facesMessages;
| | | |
| | | | @Begin(join = true, pageflow = "normalCreditApplicationFlow")
| | | | public void beginStandard() {
| | | | System.out.println("**********Standars**********");
| | | | initApplication();
| | | |
| | | | }
| | | |
| | | | @Begin(join = true, pageflow = "normalCreditApplicationFlow")
| | | | public void beginServProv() {
| | | | System.out.print("**********ServProv***********");
| | | | initApplication();
| | | | setServiceProvider(true);
| | | |
| | | | String serviceProviderContractType = Util.getBundledMessageResource(Tokens.SERVICEPROVIDERCONTRACTTYPE);
| | | | getApplication().setContractTypeCode(serviceProviderContractType);
| | | |
| | | | }
| | | |
| | | | private void initApplication() {
| | | | this.autoCompleteLocation = new AutoCompleteLocation();
| | | |
| | | | this.application = new Application();
| | | | this.application.setApplicationDate(new Timestamp(System.currentTimeMillis()));
| | | | this.application.setAppStatus(APPSTATUS_NEWAPPLICATION);
| | | | Customer firstCustomer = new Customer();
| | | | Customer secondCustomer = new Customer();
| | | | AppCustomer firstAppCustomer = new AppCustomer();
| | | | AppCustomer secondAppCustomer = new AppCustomer();
| | | | Invoice invoice = new Invoice();
| | | | firstAppCustomer.setCustomer(firstCustomer);
| | | | firstAppCustomer.setApplicantNo(new Integer(1));
| | | |
| | | | secondAppCustomer.setCustomer(secondCustomer);
| | | | secondAppCustomer.setApplicantNo(new Integer(2));
| | | | this.application.setPrimaryInvoice(invoice);
| | | | this.application.setApplicant1(firstAppCustomer);
| | | | this.application.setApplicant2(secondAppCustomer);
| | | |
| | | | if (!userCredentials.isAllStoresAccessor()) {
| | | |
| | | | this.autoCompleteLocation.setStoreSel(Util.getStoreCodeDashStoreName(userCredentials.getStoreId()));
| | | | this.autoCompleteLocation.setCompanySel(Util.getCompanyCodeDashStoreName(userCredentials.getCompanyId()));
| | | | }
| | | | }
| | | |
| | | | public void searchPossibleDebtorsbyUser() {
| | | | final List<Customer> customers;
| | | | customers = Util.getApplicationService().searchCustomerByName(getFirstNameSearch(), getSurnameSearch());
| | | | setListPossibleDebtors(customers);
| | | | this.numRows = customers.size();
| | | | }
| | | |
| | | | public void searchPossibleDebtorsbySystem() {
| | | | final List<Customer> customers;
| | | | customers = Util.getApplicationService().searchCustomerByName(
| | | | this.getApplication().getApplicant1().getCustomer().getFirstName(),
| | | | this.getApplication().getApplicant1().getCustomer().getSurname());
| | | | setFirstNameSearch(this.getApplication().getApplicant1().getCustomer().getFirstName());
| | | | setSurnameSearch(this.getApplication().getApplicant1().getCustomer().getSurname());
| | | | setListPossibleDebtors(customers);
| | | | this.numRows = customers.size();
| | | | }
| | | |
| | | | public void setMapPrint() {
| | | |
| | | | String nameFile = null;
| | | | String applicationFee = null;
| | | | String valueApplicationFee = null;
| | | | String filePath = null;
| | | | mapPrint = new HashMap<String, String>();
| | | | // Obtain the name of the pdf template
| | | |
| | | | if (isSecondApplicant()) {
| | | | nameFile = PRIVACY + TWO;
| | | |
| | | | } else {
| | | | nameFile = PRIVACY + ONE;
| | | | }
| | | | if (getApplication().getContractTypeCode() != null) {
| | | | nameFile = nameFile + getApplication().getContractTypeCode().toUpperCase();
| | | | }
| | | |
| | | | try {
| | | | filePath = Util.getBundledMessageResource(nameFile);
| | | | } catch (Exception e) {
| | | | filePath = null;
| | | | }
| | | |
| | | | if (filePath == null) {
| | | | if (getApplication().getContractTypeCode() != null) {
| | | | nameFile = PRIVACY + getApplication().getContractTypeCode().toUpperCase();
| | | | }
| | | | try {
| | | | filePath = Util.getBundledMessageResource(nameFile);
| | | | } catch (Exception e) {
| | | | filePath = null;
| | | | }
| | | | }
| | | | // Obtain the value of applicationFee
| | | |
| | | | if (getApplication().getContractTypeCode() != null) {
| | | | applicationFee = APPLICATIONFEE + getApplication().getContractTypeCode().toUpperCase();
| | | |
| | | | }
| | | | try {
| | | | valueApplicationFee = Util.getBundledMessageResource(applicationFee);
| | | | } catch (Exception e) {
| | | | valueApplicationFee = null;
| | | | }
| | | | if (valueApplicationFee == null) {
| | | | try {
| | | | valueApplicationFee = Util.getBundledMessageResource(APPLICATIONFEE);
| | | | } catch (Exception e) {
| | | | valueApplicationFee = null;
| | | | }
| | | | }
| | | |
| | | | // Set the map to print
| | | | this.mapPrint.put(APPLICATIONREF, this.getDealer().getFranchiseCode() + Tokens.SPACE + Tokens.DASH + Tokens.SPACE
| | | | + getApplication().getPrimaryInvoice().getInvoiceNo().toString());
| | | | this.mapPrint.put(APPLICANTNAME1, getApplication().getApplicant1().getCustomer().getFullName());
| | | | this.mapPrint.put(APPLICANTNAME2, getApplication().getApplicant2().getCustomer().getFullName());
| | | | this.mapPrint.put(SERIALNO, getApplication().getSerialNo());
| | | |
| | | | this.mapPrint.put(APPFEE, valueApplicationFee);
| | | | this.mapPrint.put(NAMETEMPLATE, filePath);
| | | |
| | | |
| | | | if (serviceProvider) {
| | | |
| | | | String nameField2 = Tokens.SPACE;
| | | | String dateField2 = Tokens.SPACE;
| | | | String dateText2 = Tokens.SPACE;
| | | |
| | | | if (secondApplicant) {
| | | | nameField2 = NAMEFIELD1VALUE;
| | | | dateField2 = DATEFIELD1VALUE;
| | | | dateText2 = DATETEXT1VALUE;
| | | | // }
| | | | }
| | | | this.mapPrint.put(NAMEFIELD1, NAMEFIELD1VALUE);
| | | | this.mapPrint.put(DATEFIELD1, DATEFIELD1VALUE);
| | | | this.mapPrint.put(DATETEXT1, DATETEXT1VALUE);
| | | | this.mapPrint.put(NAMEFIELD2, nameField2);
| | | | this.mapPrint.put(DATEFIELD2, dateField2);
| | | | this.mapPrint.put(DATETEXT2, dateText2);
| | | | this.mapPrint.put(DEALERNAME, "Dealer: " + this.getDealer().getFranchiseName().toUpperCase()
| | | | + " and Services Dealer: " + getApplication().getServiceProvider().getName().toUpperCase());
| | | |
| | | | } else {
| | | |
| | | | this.mapPrint.put(DEALERNAME, this.getDealer().getFranchiseName());
| | | |
| | | | }
| | | |
| | | | }
| | | |
| | | | public boolean validateSecondApplicant() {
| | | | if (!getApplication().getApplicant2().getCustomer().getFirstName().trim().equals(Tokens.BLANK)
| | | | && !getApplication().getApplicant2().getCustomer().getSurname().trim().equals(Tokens.BLANK)) {
| | | | setSecondApplicant(true);
| | | | return true;
| | | | } else if (getApplication().getApplicant2().getCustomer().getFirstName().trim().equals(Tokens.BLANK)
| | | | && getApplication().getApplicant2().getCustomer().getSurname().trim().equals(Tokens.BLANK)
| | | | && getApplication().getApplicant2().getCustomer().getMiddleName().trim().equals(Tokens.BLANK)) {
| | | | setSecondApplicant(false);
| | | | return true;
| | | | } else if (!getApplication().getApplicant2().getCustomer().getFirstName().trim().equals(Tokens.BLANK)
| | | | || !getApplication().getApplicant2().getCustomer().getSurname().trim().equals(Tokens.BLANK)
| | | | || !getApplication().getApplicant2().getCustomer().getMiddleName().trim().equals(Tokens.BLANK)) {
| | | | setSecondApplicant(false);
| | | | facesMessages.add(Util.getBundledMessageResource(Tokens.MSG_INVALIDNAME_SECONDAPPPLICANT));
| | | | }
| | | | return false;
| | | | }
| | | |
| | | | public boolean validateLocation() {
| | | | try {
| | | |
| | | | int idDealer = Util.obtainDealerId(this.autoCompleteLocation.getCompanySel(), this.autoCompleteLocation.getStoreSel(), this.autoCompleteLocation.getDealerSel());
| | | | int idCompany = Util.obtainCompanyId(this.autoCompleteLocation.getCompanySel());
| | | | int idStore = Util.obtainStoreId(this.autoCompleteLocation.getCompanySel(), this.autoCompleteLocation.getStoreSel());
| | | | getApplication().setDealerId(null);
| | | | getApplication().setStoreId(null);
| | | | this.setDealerName(null);
| | | | this.setStoreName(null);
| | | | this.setCompanyName(null);
| | | |
| | | | this.setDealer(null);
| | | | if (idDealer > 0) {
| | | |
| | | | DealerCache dealerCache = (DealerCache) AppContext.getCache(DealerCache.class.getSimpleName());
| | | | Dealer dealerAux = (Dealer) dealerCache.getEntityById(idDealer);
| | | |
| | | | StoreCache storeCache = (StoreCache) AppContext.getCache(StoreCache.class.getSimpleName());
| | | | Store storeAux = (Store) storeCache.getEntityById(idStore);
| | | |
| | | | CompanyCache companyCache = (CompanyCache) AppContext.getCache(CompanyCache.class.getSimpleName());
| | | | Company companyAux = (Company) companyCache.getEntityById(idCompany);
| | | |
| | | | if (dealerAux != null) {
| | | | getApplication().setDealerId(dealerAux.getId());
| | | | getApplication().setStoreId(dealerAux.getStoreId());
| | | | this.setDealer(dealerAux);
| | | | this.setDealerName(dealerAux.getDepartmentCode() + Tokens.DASH + dealerAux.getFranchiseName());
| | | | this.setStoreName(storeAux.getStoreCode() + Tokens.DASH + storeAux.getName());
| | | | this.setCompanyName(companyAux.getCompanyCode() + Tokens.DASH + companyAux.getName());
| | | | return true;
| | | | }
| | | |
| | | | }
| | | | facesMessages.add(Util.getBundledMessageResource(Tokens.MSG_INVALID_LOCATION));
| | | | return false;
| | | | } catch (Exception e) {
| | | | facesMessages.add(Util.getBundledMessageResource(Tokens.MSG_INVALID_LOCATION));
| | | | return false;
| | | | }
| | | | }
| | | |
| | | | public void calculateSerialNumber() {
| | | | double serialNoSyst = Math.random() * MAX_SERIAL;
| | | |
| | | | getApplication().setSerialNo(getDealer().getDepartmentCode() + (int) serialNoSyst + Tokens.BLANK);
| | | | }
| | | |
| | | | public boolean validaSerialNumber() {
| | | | if (getSerialNumberUser() != null) {
| | | | if (getSerialNumberUser().equals("111")) { // return
| | | | // getApplication().getSerialNo().equals(getSerialNumberUser());
| | | | return true;
| | | | } else {
| | | | facesMessages.add(Util.getBundledMessageResource(Tokens.MSG_INVALID_SERIALNUMBER));
| | | | return false;
| | | | }
| | | |
| | | | } else {
| | | | facesMessages.add(Util.getBundledMessageResource(Tokens.MSG_INVALID_SERIALNUMBER));
| | | | return false;
| | | | }
| | | | }
| | | |
| | | | public boolean validaDefaultPrintPrivacy() {
| | | | if ((Util.getBundledMessageResource(Tokens.DEFAULTPRINTPRIVACY).toUpperCase().equals(Tokens.YES))) {
| | | | return true;
| | | | } else {
| | | | return false;
| | | | }
| | | | }
| | | |
| | | | public boolean validaInvoiceNo() {
| | | |
| | | | if (Util.getApplicationService().isUniqueInvoiceNo(this.getDealer(), getApplication().getPrimaryInvoice().getInvoiceNo())) {
| | | | // this.setMsgWrongInvoiceNo(Util.getBundledMessageResource(Tokens.BLANK));
| | | | return true;
| | | | } else {
| | | | // this.setMsgWrongInvoiceNo(Util.getBundledMessageResource(Tokens.MSG_INVALID_INVOICENO));
| | | | facesMessages.add( Util.getBundledMessageResource(Tokens.MSG_INVALID_INVOICENO));
| | | | return false;
| | | | }
| | | | }
| | | |
| | | | public String getSurnameSearch() {
| | | | return surnameSearch;
| | | | }
| | | |
| | | | public void setSurnameSearch(String surnameSearch) {
| | | | this.surnameSearch = surnameSearch;
| | | | }
| | | |
| | | | public String getFirstNameSearch() {
| | | | return firstNameSearch;
| | | | }
| | | |
| | | | public void setFirstNameSearch(String firstNameSearch) {
| | | | this.firstNameSearch = firstNameSearch;
| | | | }
| | | |
| | | |
| | | | public String getSerialNumberUser() {
| | | | return serialNumberUser;
| | | | }
| | | |
| | | | public void setSerialNumberUser(String serialNumberUser) {
| | | | this.serialNumberUser = serialNumberUser;
| | | | }
| | | |
| | | |
| | | |
| | | |
| | | | @DataModel
| | | | public List<Customer> getListPossibleDebtors() {
| | | | return listPossibleDebtors;
| | | | }
| | | |
| | | | public void setListPossibleDebtors(List<Customer> listPossibleDebtors) {
| | | | this.listPossibleDebtors = listPossibleDebtors;
| | | | }
| | | |
| | | | public boolean getServiceProvider() {
| | | | return serviceProvider;
| | | | }
| | | |
| | | | public void setServiceProvider(boolean serviceProvider) {
| | | | this.serviceProvider = serviceProvider;
| | | | }
| | | |
| | | | public String getIdServiceProvider() {
| | | | return idServiceProvider;
| | | | }
| | | |
| | | | public void setIdServiceProvider(String idServiceProvider) {
| | | | this.idServiceProvider = idServiceProvider;
| | | | }
| | | |
| | | | public boolean isSecondApplicant() {
| | | | return secondApplicant;
| | | | }
| | | |
| | | | public void setSecondApplicant(boolean secondApplicant) {
| | | | this.secondApplicant = secondApplicant;
| | | | }
| | | |
| | | | public Customer getCustomerSelected() {
| | | | return customerSelected;
| | | | }
| | | |
| | | | public void setCustomerSelected(Customer customerSelected) {
| | | | this.customerSelected = customerSelected;
| | | | }
| | | |
| | | | public void setSelectCustomerOne() {
| | | | if (customerSelected != null) {
| | | | getApplication().getApplicant1().setCustomer(customerSelected);
| | | | if (customerSelected.getLatestAppCustomer() != null) {
| | | | Application app = Util.getApplicationService().findApplicationById(
| | | | customerSelected.getLatestAppCustomer().getApplication().getId());
| | | | application.getApplicant1().copyFrom(app.getApplicant1());
| | | | }
| | | |
| | | | }
| | | | }
| | | |
| | | | public Application getApplication() {
| | | | return application;
| | | | }
| | | |
| | | | public void setApplication(Application application) {
| | | | this.application = application;
| | | | }
| | | |
| | | | public void createApplication() {
| | | |
| | | | getApplication().setStoreId(getDealer().getStoreId());
| | | | getApplication().setDealerId(getDealer().getId());
| | | | getApplication().setFranchiseCode(getDealer().getFranchiseCode());
| | | |
| | | | getApplication().getApplicant1().setApplication(getApplication());
| | | | getApplication().getPrimaryInvoice().setDealerId(getApplication().getDealerId());
| | | | getApplication().getPrimaryInvoice().setApplication(getApplication());
| | | | getApplication().getPrimaryInvoice().setStoreId(getApplication().getStoreId());
| | | |
| | | | if (isSecondApplicant()) {
| | | | getApplication().getApplicant2().setApplication(getApplication());
| | | |
| | | | } else {
| | | | getApplication().setApplicant2(null);
| | | | }
| | | |
| | | | Util.getApplicationService().save(getApplication());
| | | |
| | | | }
| | | |
| | | | public List<ServiceProvider> getListServiceProviders() {
| | | |
| | | | ServiceProviderCache serviceProviderCache = (ServiceProviderCache) AppContext.getCache(ServiceProviderCache.class
| | | | .getSimpleName());
| | | | List<ServiceProvider> serviceProviders = (List<ServiceProvider>) serviceProviderCache.getEntityList();
| | | |
| | | | return serviceProviders;
| | | |
| | | | }
| | | |
| | | | public void onSelectServiceProvider(ValueChangeEvent event) {
| | | | ServiceProvider serProvider = (ServiceProvider) event.getNewValue();
| | | | getApplication().setServiceProvider(serProvider);
| | | |
| | | | }
| | | |
| | | |
| | | | public void setPrinting() {
| | | | this.setFlgPrint(true);
| | | | }
| | | |
| | | | public void setNoPrinting() {
| | | | this.setFlgPrint(false);
| | | | }
| | | |
| | | | public Dealer getDealer() {
| | | | return dealer;
| | | | }
| | | |
| | | | public void setDealer(Dealer dealer) {
| | | | this.dealer = dealer;
| | | | }
| | | |
| | | | public String getCompanyName() {
| | | | return companyName;
| | | | }
| | | |
| | | | public void setCompanyName(String companyName) {
| | | | this.companyName = companyName;
| | | | }
| | | |
| | | | public String getDealerName() {
| | | | return dealerName;
| | | | }
| | | |
| | | | public void setDealerName(String dealerName) {
| | | | this.dealerName = dealerName;
| | | | }
| | | |
| | | | public String getStoreName() {
| | | | return storeName;
| | | | }
| | | |
| | | | public void setStoreName(String storeName) {
| | | | this.storeName = storeName;
| | | | }
| | | |
| | | | public boolean isFlgPrint() {
| | | | return flgPrint;
| | | | }
| | | |
| | | | public void setFlgPrint(boolean flgPrint) {
| | | | this.flgPrint = flgPrint;
| | | | }
| | | |
| | | | public AutoCompleteLocation getAutoCompleteLocation() {
| | | | return autoCompleteLocation;
| | | | }
| | | |
| | | | public void setAutoCompleteLocation(AutoCompleteLocation autoCompleteLocation) {
| | | | this.autoCompleteLocation = autoCompleteLocation;
| | | | }
| | | |
| | | | public Integer getNumRows() {
| | | | return numRows;
| | | | }
| | | |
| | | | public void setNumRows(Integer numRows) {
| | | | this.numRows = numRows;
| | | | }
| | | |
| | | | }
| | | |
| | |
| | | My PageFlow
| | |
| | | |
| | | | <pageflow-definition xmlns="http://jboss.com/products/seam/pageflow"
| | | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| | | | xsi:schemaLocation="http://jboss.com/products/seam/pageflow http://jboss.com/products/seam/pageflow-1.2.xsd"
| | | | name="normalCreditApplicationFlow">
| | | | <start-state>
| | | | <transition to="normal" />
| | | | </start-state>
| | | |
| | | | <page name="normal" view-id="/normal-application.jspx"
| | | | back="disabled">
| | | | <redirect />
| | | | <transition name="next" to="validateLocation"></transition>
| | | | </page>
| | | |
| | | |
| | | | <decision name="validateLocation"
| | | | expression="#{normalCreditApplication.validateLocation}">
| | | | <transition name="true" to="validaInvoiceNo"></transition>
| | | | <transition name="false" to="normal"></transition>
| | | | </decision>
| | | |
| | | | <decision name="validaInvoiceNo"
| | | | expression="#{normalCreditApplication.validaInvoiceNo}">
| | | | <transition name="true" to="validateSecondApplicant"></transition>
| | | | <transition name="false" to="normal"></transition>
| | | | </decision>
| | | |
| | | | <decision name="validateSecondApplicant"
| | | | expression="#{normalCreditApplication.validateSecondApplicant}">
| | | | <transition name="true" to="validaDefaultPrintPrivacy"></transition>
| | | | <transition name="false" to="normal"></transition>
| | | | </decision>
| | | |
| | | | <decision name="validaDefaultPrintPrivacy"
| | | | expression="#{normalCreditApplication.validaDefaultPrintPrivacy}">
| | | | <transition name="true" to="normalSerialNumberPrint">
| | | | <action
| | | | expression="#{normalCreditApplication.calculateSerialNumber}" />
| | | | <action expression="#{normalCreditApplication.setMapPrint}" />
| | | | </transition>
| | | | <transition name="false" to="normalListPossibleDebtors">
| | | | </transition>
| | | | </decision>
| | | |
| | | | <page name="normalSerialNumberPrint"
| | | | view-id="/normal-serialnumber-print.jspx" back="enabled">
| | | | <redirect />
| | | | <transition name="previous" to="normal">
| | | | <action
| | | | expression="#{normalCreditApplication.setNoPrinting}" />
| | | | </transition>
| | | | <transition name="next" to="validaSerialNumber">
| | | | <action expression="#{normalCreditApplication.setPrinting}" />
| | | | </transition>
| | | | </page>
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | <decision name="validaSerialNumber"
| | | | expression="#{normalCreditApplication.validaSerialNumber}">
| | | | <transition name="true" to="normalListPossibleDebtorsPrint">
| | | | <action
| | | | expression="#{normalCreditApplication.searchPossibleDebtorsbySystem}" />
| | | | </transition>
| | | | <transition name="false" to="normalSerialNumberPrint">
| | | |
| | | | </transition>
| | | | </decision>
| | | |
| | | | <page name="normalListPossibleDebtors"
| | | | view-id="/list-existing-debtors.jspx" back="disabled">
| | | | <redirect />
| | | | <transition name="previous" to="normal"></transition>
| | | | <transition name="existingCustomerOne" to="toEditApplication">
| | | | <action
| | | | expression="#{normalCreditApplication.setSelectCustomerOne}" />
| | | | <action
| | | | expression="#{normalCreditApplication.createApplication}" />
| | | | </transition>
| | | | <transition name="newCustomerOne" to="toEditApplication">
| | | | <action
| | | | expression="#{normalCreditApplication.createApplication}" />
| | | | </transition>
| | | | <transition name="search" to="normalListPossibleDebtors">
| | | | <action
| | | | expression="#{normalCreditApplication.searchPossibleDebtorsbyUser}" />
| | | | </transition>
| | | | </page>
| | | |
| | | | <page name="normalListPossibleDebtorsPrint"
| | | | view-id="/list-existing-debtors.jspx" back="disabled">
| | | | <redirect />
| | | | <transition name="previous" to="normalSerialNumberPrint"></transition>
| | | | <transition name="existingCustomerOne" to="toEditApplication">
| | | | <action
| | | | expression="#{normalCreditApplication.setSelectCustomerOne}" />
| | | | <action
| | | | expression="#{normalCreditApplication.createApplication}" />
| | | | </transition>
| | | | <transition name="newCustomerOne" to="toEditApplication">
| | | | <action
| | | | expression="#{normalCreditApplication.createApplication}" />
| | | | </transition>
| | | | <transition name="search" to="normalListPossibleDebtors">
| | | | <action
| | | | expression="#{normalCreditApplication.searchPossibleDebtorsbyUser}" />
| | | | </transition>
| | | | </page>
| | | |
| | | | <page name="toEditApplication" view-id="/loan-application.jspx">
| | | | <redirect />
| | | | </page>
| | | |
| | | | <page name="salary" view-id="/salaryApplication.jspx"
| | | | back="disabled">
| | | | <redirect />
| | | | <end-conversation />
| | | | </page>
| | | |
| | | | </pageflow-definition>
| | | |
| | |
| | | Error
| | |
| | | |
| | | | 2007-08-06 09:21:53 StandardWrapperValve[FacesServlet]: Servlet.service() for servlet FacesServlet threw exception
| | | | javax.faces.el.EvaluationException: /normal-application.jspx @13,72 rendered="#{normalCreditApplication.serviceProvider}": Exception getting value of property serviceProvider of base of type : com.yoogalu.ncf.web.seam.bean.NormalCreditApplication_$$_javassist_2
| | | | at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
| | | | at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:1078)
| | | | at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:601)
| | | | at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:605)
| | | | at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:605)
| | | | at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:138)
| | | | at org.ajax4jsf.framework.ajax.AjaxViewRoot.access$001(AjaxViewRoot.java:53)
| | | | at org.ajax4jsf.framework.ajax.AjaxViewRoot$1.invokeRoot(AjaxViewRoot.java:256)
| | | | at org.ajax4jsf.framework.ajax.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:53)
| | | | at org.ajax4jsf.framework.ajax.AjaxContext.invokeOnRegionOrRoot(AjaxContext.java:191)
| | | | at org.ajax4jsf.framework.ajax.AjaxViewRoot.processDecodes(AjaxViewRoot.java:272)
| | | | at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:32)
| | | | at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
| | | | at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
| | | | at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
| | | | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
| | | | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
| | | | at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
| | | | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
| | | | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
| | | | at com.yoogalu.ncf.web.servlet.Boilerplate.doFilter(Boilerplate.java:42)
| | | | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
| | | | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
| | | | at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
| | | | at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
| | | | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
| | | | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
| | | | at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
| | | | at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
| | | | at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
| | | | at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
| | | | at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
| | | | at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
| | | | at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
| | | | at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
| | | | at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
| | | | at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
| | | | at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
| | | | at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
| | | | at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
| | | | at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
| | | | at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
| | | | at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
| | | | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
| | | | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
| | | | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
| | | | at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
| | | | at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
| | | | at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
| | | | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
| | | | at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
| | | | at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
| | | | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
| | | | at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
| | | | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
| | | | at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
| | | | at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
| | | | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| | | | at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
| | | | at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
| | | | at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
| | | | at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
| | | | at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
| | | | at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
| | | | at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
| | | | at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
| | | | at java.lang.Thread.run(Thread.java:595)
| | | | Caused by: javax.faces.el.EvaluationException: Bean: com.yoogalu.ncf.web.seam.bean.NormalCreditApplication_$$_javassist_2, property: serviceProvider
| | | | at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:461)
| | | | at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:85)
| | | | at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
| | | | at com.sun.el.parser.AstValue.getValue(AstValue.java:118)
| | | | at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
| | | | at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
| | | | at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
| | | | ... 66 more
| | | | Caused by: java.lang.reflect.InvocationTargetException
| | | | at sun.reflect.GeneratedMethodAccessor162.invoke(Unknown Source)
| | | | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| | | | at java.lang.reflect.Method.invoke(Method.java:585)
| | | | at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:457)
| | | | ... 72 more
| | | | Caused by: org.jboss.seam.NoConversationException: no long-running conversation for @Conversational bean: normalCreditApplication
| | | | at org.jboss.seam.interceptors.ConversationalInterceptor.aroundInvoke(ConversationalInterceptor.java:55)
| | | | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| | | | at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
| | | | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| | | | at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
| | | | at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
| | | | at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
| | | | at com.yoogalu.ncf.web.seam.bean.NormalCreditApplication_$$_javassist_2.getServiceProvider(NormalCreditApplication_$$_javassist_2.java)
| | | | ... 76 more
| | | |
| | |
| | |
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071417#4071417
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071417
18Â years, 8Â months
[JBoss Seam] - Re: Trinidad: Validation still not working
by wschwendt
"wschwendt" wrote : it looked to me as if it could be a state restoration issue.
|
| When the view tree is constructed during the first RENDER RESPONSE phase, the validator properties (attributes such as minimum or maximum) are stored. On a subsequent faces request, this state is supposed to be restored during the RESTORE VIEW phase. But it appears that this isn't working correctly.
|
the debugging clearly revealed that validator properties are not correctly restored.
So it's absolutely no surprise that validation in turn doesn't work.
For example, if f:validateLongRange is applied to a component and its "minimum" and "maximum" properties are not restored correctly during RESTORE VIEW, the validator does nothing.
Further note that trinidad-impl-1.2.1.jar contains a faces-config.xml in META-INF, which replaces the standard JSF RI validators with a Trinidad implementation of these validators.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071415#4071415
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071415
18Â years, 8Â months
[JBoss Seam] - Re: Trinidad: Validation still not working
by wschwendt
A big thank you for posting this! Incidentally, I already spent the entire day on this trinidad validation mess.
Backdrop: I had problems getting the Hibernate validator to work with the CVS-based Seam (solved in the meantime thanks to Pete Muir's helpful response): http://www.jboss.com/index.html?module=bb&op=viewtopic&t=115318
So I thought: Why not use the JSF validators as temporary workaround? And then I noticed that the JSF validators fail to work correctly when Trinidad is involved. What's more, the Hibernate validator annotations don't work either in combination with s:validate all and Trinidad (one can test this by modifying Seam-discs).
anonymous wrote : Any idea why this is not working?
no real idea, but I debugged it and it looked to me as if it could be a state restoration issue.
When the view tree is constructed during the first RENDER RESPONSE phase, the validator properties (attributes such as minimum or maximum) are stored. On a subsequent faces request, this state is supposed to be restored during the RESTORE VIEW phase. But it appears that this isn't working correctly.
The culprit could possibly be org.apache.myfaces.trinidad.bean.util.StateUtils.restoreState() or a related method.
StateUtils.restoreState() is called from org.apache.myfaces.trinidad.bean.util.FlaggedPropertyMap.
| // org.apache.myfaces.trinidad.bean.util.FlaggedPropertyMap
| public void restoreState(
| FacesContext context,
| FacesBean.Type type,
| Object state)
| {
| StateUtils.restoreState(this, context, type, state, getUseStateHolder());
| }
|
|
Until FlaggedPropertyMap.restoreState() is called, the restoration process looks ok to me (at least the argument named "state" correctly contained the validator properties).
A Trinidad expert would need to look at this, where exactly the state restoration fails.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071413#4071413
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071413
18Â years, 8Â months
[Javassist user questions] - Javassist 3.5.SNAPSHOT Maven2 POM broken on Mac OS X
by manik.surtaniï¼ jboss.com
I've been playing around with maven2, using it to include microcontainer dependencies into JBoss Cache, and see the following:
|
| [INFO] ------------------------------------------------------------------------
| [ERROR] BUILD ERROR
| [INFO] ------------------------------------------------------------------------
| [INFO] Failed to resolve artifact.
|
| Missing:
| ----------
| 1) com.sun:tools:jar:1.5
|
| Try downloading the file manually from the project website.
|
| Then, install it using the command:
| mvn install:install-file -DgroupId=com.sun -DartifactId=tools \
| -Dversion=1.5 -Dpackaging=jar -Dfile=/path/to/file
|
| Path to dependency:
| 1) jboss:jbc21test:jar:2.1
| 2) jboss:jboss-aop-mc-int:jar:2.0.0-SNAPSHOT
| 3) jboss:jboss-aop:jar:2.0.0-SNAPSHOT
| 4) javassist:javassist:jar:3.5-SNAPSHOT
| 5) com.sun:tools:jar:1.5
|
|
Googling around for a bit, I see the following that are relevant:
http://jira.codehaus.org/browse/MNG-806
http://jira.codehaus.org/browse/MNG-869
http://maven.apache.org/general.html#tools-jar-dependency
http://developer.apple.com/documentation/Java/Conceptual/Java14Developmen...
The problem with defining tools.jar as a dependency - even as a "system" scope dependency - is that this is only specific to Sun JDKs. Other JDKs (like Apple, which I use) have tools.jar classes in the Classes.jar archive, which is already in your classpath.
Basically, from what I gathered, this block in javassist's pom should only be enabled if the vendor name includes Sun Microsystems:
<profiles>
| <profile>
| <id>jdk14</id>
| <activation>
| <jdk>1.4</jdk>
| </activation>
| <dependencies>
| <dependency>
| <groupId>com.sun</groupId>
| <artifactId>tools</artifactId>
| <version>1.4</version>
| <scope>system</scope>
| <systemPath>${java.home}/../lib/tools.jar</systemPath>
| </dependency>
| </dependencies>
| </profile>
| <profile>
| <id>jdk15</id>
| <activation>
| <jdk>1.5</jdk>
| </activation>
| <dependencies>
| <dependency>
| <groupId>com.sun</groupId>
| <artifactId>tools</artifactId>
| <version>1.5</version>
| <scope>system</scope>
| <systemPath>${java.home}/../lib/tools.jar</systemPath>
| </dependency>
| </dependencies>
| </profile>
| </profiles>
|
|
Cheers,
Manik
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071410#4071410
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071410
18Â years, 8Â months
[JNDI/Naming/Network] - javax.naming.NoInitialContextException trying to connect to
by atuljboss
I have a simple setup where I am trying to connect to a remote JMS queue using a MDB. Jboss and JDK versions are Jboss 4.0.4GA and JDK 1.4.2_11 respectively. I have configured the MDB Jboss instance as well as the queue host where the JMSProvider is configured (the default JbossMQ provider) as per the JBoss documentation
http://wiki.jboss.org/wiki/Wiki.jsp?page=HowDoIConfigureAnMDBToTalkToARem...
But when I try to start the JBoss where the MDB is deployed I get this as JBoss is starting up. This exception comes during the deployment of the MDB. The MDB does get deployed properly but the server keeps retrying to connect to the remote JMS provider (default every 10 seconds) and this exception is repeated.
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org/jnp/interfaces/NamingContextFactory ]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:652)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.(InitialContext.java:195)
at org.jboss.jms.jndi.JNDIProviderAdapter.getInitialContext(JNDIProviderAdapter.java:44)
at org.jboss.ejb.plugins.jms.DLQHandler.createService(DLQHandler.java:177)
at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:188)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSContainerInvoker.java:510)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:839)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
I would greatly appreciate if anybody has faced this issue and resolved it. If you can guide me as to where I may has a misconfiguration that would be great as well.
The JMS provider is configured in the jms-ds.xml as follows -
<!-- Configuration for a Remote JMS Provider to access to queue object on
a remote machine through it's JNDI
-->
ABC-JMSProvider
org.jboss.jms.jndi.JNDIProviderAdapter
<!-- The queue connection factory -->
XAConnectionFactory
<!-- The topic factory -->
XAConnectionFactory
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jnp.interfaces
java.naming.provider.url=ABCServer:1099
The MDB configuration is as follows (jboss.xml) -
<invoker-proxy-bindings>
<invoker-proxy-binding>
Abc-mdb-invoker
<invoker-mbean>does-not-matter</invoker-mbean>
<proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
<proxy-factory-config>
ABC-JMSProvider
StdJMSPool
1
15
30000
1
10
queue/DLQ
10
0
</proxy-factory-config>
</invoker-proxy-binding>
</invoker-proxy-bindings>
<enterprise-beans>
<message-driven>
<ejb-name>TestMdb</ejb-name>
<destination-jndi-name>queue/TestQueue</destination-jndi-name>
<invoker-bindings>
<invoker-proxy-binding-name>Abc-mdb-invoker</invoker-proxy-binding-name>
</invoker-bindings>
</message-driven>
</enterprise-beans>
Thanks in Advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071409#4071409
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071409
18Â years, 8Â months
[JBoss jBPM] - Re: JBPM 3.2.1 web app?does not display deployed process
by jdickins
Hey all,
I am sorry to leave everyone hanging but I have been a temporary developer for a US university for the past 2 months and my job ends today. I would like to thank everyone, jeffcwang, msandoz and Koen for all of the help you have given me. My supervisor may come back to this post, but as deployment is working on her machine I'm not sure she will.
Sorry, but as my process definition is made up from a process tons of other people developed, I don't think it would be right to post my process definition without their permission (and they haven't gotten back to me about giving it).
And jeffcwang, if I'm reading you problem right you might want to check out the relationship between the the task controller and fields associated with each task in the getting started wiki:
http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmGettingStarted
Obviously you're way beyond the basics of this document, but I have found it actually pretty rich in help when attempting to diagnose faulty behavior.
As I understand it task-variables are what appear next to the writable boxes in the web app-- ie, in the old websale example, the input field where cookie monster wrote the number of cookies he wanted, word "amount" was what the jbpm user inputed as a task-variable when the workflow was being designed initially. Sections 11.4 and 11.5 of the jbpm userguide might help here.
http://docs.jboss.com/jbpm/v3/userguide/taskmanagement.html#taskinstancev...
In the response to your other question, I have plugin version 3.2.1. When I was using Europa I had the "server deployer" section in my deployment tab. In 3.2 I think I can which server I am deploying to using the path Windows-> Preferences->JBoss jBPM->Runtime locations. This also works in Europa. The UI has changed 3 times in my time working w/ jBPM. I think at least once it was because I changed versions. It turns out (at least for what I'm doing) that the web app (which I think is only meant to be a sample and is supposed to be customized by users who wish to do so) is functional no matter what the UI looks like.
Anyway, Thanks again to all the jBPM folks. Learning from ya'll is a lot more interactive, varied and intense than learning in school. Which is what I'll be doing next. Thanks again!
>From Jessica
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071408#4071408
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071408
18Â years, 8Â months