Problem in validator method

Hi to all, i have this jsf code:
          <h:outputText value="#{bundle.oldPassword}:" />
          <h:inputSecret id="oldPassword" value="#{userManager.oldPassword}" required="true"></h:inputSecret>
                    <t:message id="oldPasswordError" for="oldPassword" styleClass="error"/>
          <h:outputText value="#{bundle.newPassword}:" />
          <h:inputSecret id="newPassword" validator="#{userManager.validateChangePassword}" value="#{userManager.newPassword}" required="true"></h:inputSecret>
                    <t:message id="newPasswordError" for="newPassword" styleClass="error"/>
          <h:outputText value="#{bundle.retypePassword}:" />
          <h:inputSecret id="retypePassword" value="#{userManager.retypePassword}" required="true"></h:inputSecret>
                    <t:message id="retypePasswordError" for="retypePassword" styleClass="error"/>
The field "newPassword" has the validator method "validateChangePassword".
The validator method is (is a test):
     public void validateChangePassword(FacesContext fc, UIComponent ui, Object o){
          UIInput old = (UIInput)fc.getViewRoot().findComponent("oldPassword");
          UIInput pass = (UIInput)fc.getViewRoot().findComponent("newPassword");
          UIInput retp = (UIInput)fc.getViewRoot().findComponent("retypePassword");
          System.out.println("------ "+old.getValue());
          System.out.println("------ "+pass.getValue());
          System.out.println("------ "+retp.getValue());
          FacesMessage facesMessage = new FacesMessage("Error password");
          throw new ValidatorException(facesMessage);
I must know the values of all three fields in jsf page, but, with the method above, i get only the value of one of the fields, the others return null.
How can i do to getting all three values?
Thanks!

The local value of an input component is set after conversion and validation.
You don't need to find newPassword value because you already have it as the
third parameter of the method, i.e. Object o.
You can't get a local value of retypePassword because the value hasn't been
converted nor validated. Instead, you can get the submitted value; getSubmittedValue().
But wait! You may understand that the ways to get these three values
depend on the order of the components. Very ugly.
This means that JSF's validator is not designed for cross values validation.
It is designed for single value validation, I think.
I recommend you that the validation you want should be done in the action method.

Similar Messages

  • How to force validator method instead of data type validation in af:table

    This post will probably once again illustrate exactly how new I am to the Java/JDeveloper world so thanks in advance for any help! I have tried searching but couldn't find anything that seemed to mirror my problem.
    I am using a modification of Frank's idea on how to individually color table cell backgrounds.
    http://thepeninsulasedge.com/frank_nimphius/2008/04/10/adf-faces-conditionally-color-table-cell-background-2/
    My intention was to use this along with custom validation to color cells with invalid values. It was a user request that it be done so as to quickly spot input errors (when updating records) if someone had missed the initial faces message and was no longer in the field that generated the error. It works fine for fields in my af:table based on VO attributes with varchar2 types but the 2 values with float and number types handle character input with a faces message "Not a number" and then do not seem to process the validator. The reason I (think I) need to use the validator in addition to Franks code is that in the validator code I use an addpartialtarget to the uicomponent that refreshes the background color if it changed in the backing bean.
    FYI the project is based on ADF BC/JSF.
    I tried gave the full use case as suggested so you understand what I am trying to accomplish and if you have a better way to accomplish this please let me know as well.
    Thanks,
    Rich
    Managed-Bean
        public String getMODELColorString() {
            MODELColorString = "width:125px;";
            Object MODEL = getRowValue("#{row.ModelType}");
            if (MODEL != null) {
                if (!isValidMODEL(MODEL.toString())) {
                    MODELColorString = "background-color:red;width:125px;";
            return MODELColorString;
        }Backing-Bean
            if (!myValidation.isValidMODEL(object.toString())) {
                System.out.println("InValid Data");
            AdfFacesContext.getCurrentInstance().addPartialTarget(uiComponent);P.S. If I made any newbie mistakes in my code please let me know, although this is obviously not production code yet by any means.
    Message was edited by:
    BengalGuy

    Frank (or anyone else who might offer some advice),
    I thought that solved my issue as I could see the validator getting triggered, however something else is now happening. It seems to pass through the validator once for each of the values on my table with the invalid input I entered on one of the numbers, "a" in this case, and then once again through the color change backing bean but at that time the invalid input reverts to the original input and the change is rendered on the af:table as well. Any thoughts ? I put a print in the validator method, in the method that gets called from the validator (checks to see if value can be converted to float) , and then the color change bean (which also calls the float validation test) and pasted the output below.
    Validator Triggered \Current Value = 0.037178375 \FloatTestOn: 0.037178375 \Result: Valid Data
    Validator Triggered \Current Value = 0.109212324 \FloatTestOn: 0.109212324 \Result: Valid Data
    Validator Triggered \Current Value = 0.18624917 \FloatTestOn: 0.18624917 \Result: Valid Data
    Validator Triggered \Current Value = 0.26863635 \FloatTestOn: 0.26863635 \Result: Valid Data
    Validator Triggered \Current Value = 0.35674548 \FloatTestOn: 0.35674548 \Result: Valid Data
    Validator Triggered \Current Value = -0.38118127 \FloatTestOn: -0.38118127 \Result: Valid Data
    Validator Triggered \Current Value = -0.3382032a \FloatTestOn: -0.3382032a NumberFormatException: For input string: "-0.3382032a"
    08/04/16 10:03:14 \Result: InValid Data
    Validator Triggered \Current Value = -0.29224017 \FloatTestOn: -0.29224017 \Result: Valid Data
    Validator Triggered \Current Value = -0.24308495 \FloatTestOn: -0.24308495 \Result: Valid Data
    Validator Triggered \Current Value = -0.1905158 \FloatTestOn: -0.1905158 \Result: Valid Data
    Validator Triggered \Current Value = -0.13429564 \FloatTestOn: -0.13429564 \Result: Valid Data
    Validator Triggered \Current Value = -0.07417088 \FloatTestOn: -0.07417088 \Result: Valid Data
    Validator Triggered \Current Value = -0.009870344 \FloatTestOn: -0.009870344 \Result: Valid Data
    \Checking for color change \FloatTestOn: 0.037178375
    \Checking for color change \FloatTestOn: 0.109212324
    \Checking for color change \FloatTestOn: 0.18624917
    \Checking for color change \FloatTestOn: 0.26863635
    \Checking for color change \FloatTestOn: 0.35674548
    \Checking for color change \FloatTestOn: -0.38118127
    \Checking for color change \FloatTestOn: -0.3382032 <- "a" is no longer there ?
    \Checking for color change \FloatTestOn: -0.29224017
    \Checking for color change \FloatTestOn: -0.24308495
    \Checking for color change \FloatTestOn: -0.1905158
    \Checking for color change \FloatTestOn: -0.13429564
    \Checking for color change \FloatTestOn: -0.07417088
    \Checking for color change \FloatTestOn: -0.009870344

  • I have downloaded whats app/brave temple run but using netsafe card. well now it shows 1.98$ is pending , though m trying with new netsafe card to pay it is showing error saying Pls select valid method for payment. i used same method as i did earlier

    i have downloaded whats app/brave temple run but using netsafe card. well now it shows 1.98$ is pending , though m trying with new netsafe card to pay it is showing error saying Pls select valid method for payment. i used same method as i did earlier

    I have recently started having this problem in PSE8. The Adobe workaround
    did work, but I don't fancy having to re register each time I use it.
    What I have discovered is that it's nothing to do with the image metadata as it occurs before any image is opened.
    It SEEMS to only occur if you use file/open with to open an image in the editor - IE start PSE with that command.
    If you close elements down, and start it using programs/PSE/Elements (or your desktop shortcut) - the panorama feature magically works.
    Each time I've opened the editor 'automatically' using image/open with, it seems to create the problem.
    Hope this helps

  • EO Validation method called twice

    Hi,
    I have written an EO based field Validation method. But the problem is it is being called twice. First time ,it is validating correctly. But the second time it is not taking the field value and giving the error
    I have included it like this in my jspx.
    <af:inputText value="#{bindings.SubOrgName.inputValue}"
    label="#{bindings.SubOrgName.label}"
    required="#{bindings.SubOrgName.mandatory}"
    columns="#{bindings.SubOrgName.displayWidth}"
    binding="#{backing_Org.inputText3}"
    id="inputText3"
    rows="1">
    <af:validator binding="#{bindings.SubOrgName.validator}"/>
    </af:inputText>
    Please help.

    Thanks for sharing! ;-)

  • Are prepaid cards valid method of payment ???

    Are prepaid cards a valid method of payment ??? And if yes why would apple decline valid prepaid cards which have money in that ??? I am very frustrated with this crap !!! Can anybody give an email to contact AppStore ???  I have had enough with this problem !!! 

    You can contact iTunes support via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • 1 year ago i installed Elements 12 on my PC with a serial number.  Today i have installed Elements 12 also on my laptop. But,...there is a problem with validation of the serial number on my laptop. Is there a need to validate Elements  or will this progra

    One year ago i installed Elements 12 on my PC with a serial number and it was OK.
    Today i have installed Elements 12 also on my laptop.
    But,...there is a problem with validation of the serial number on my laptop. Is there a need to validate Elements  or will this program real disapeare in 7 days?
    Hans

    Hi,
    Since you already have one copy activated the serial number must be logged in your account details - I would first check that the one logged and the one you are attempting to enter are the same.
    You can check your account details by going to www.adobe.com and clicking on Manage Account. You need to sign in with your Adobe Id and then click on View All under Plans & Products. Next click on View your products and after a while it should produce your list.
    If there is a problem with the serial number, only Adobe can help you there (we are just users). Please see the response in this thread
    First of all, I would have to say that getting in touch with you is a nightmare and I am not at all happy that I can't just email or live chat with someone who can help!  I am not a technical person, I just want to be able to use Photoshop Elements and ge
    Brian

  • Setup encountered a problem while validating the state of Active Directory: Could not find information about the local site

    Have an existing ex2010 sp3 organization.
    Could not run ex2013cu1 setup from my newly built 2012 server, getting the error in the subject line.  I used the command line to run the AD preparation steps successfully from my 2012 DC/GC, then tried to run setup again from the new 2012 server and
    still get the same error.  The error itself in the log is pretty useless:
    [05/07/2013 01:19:13.0137] [0] **********************************************
    [05/07/2013 01:19:13.0137] [0] Starting Microsoft Exchange Server 2013 Cumulative Update 1 Setup
    [05/07/2013 01:19:13.0137] [0] **********************************************
    [05/07/2013 01:19:13.0152] [0] Local time zone: (UTC-08:00) Pacific Time (US & Canada).
    [05/07/2013 01:19:13.0152] [0] Operating system version: Microsoft Windows NT 6.2.9200.0.
    [05/07/2013 01:19:13.0152] [0] Setup version: 15.0.620.29.
    [05/07/2013 01:19:13.0152] [0] Logged on user: DOMAIN\ADMINISTRATOR.
    [05/07/2013 01:19:13.0168] [0] The registry key, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\V15\Setup, wasn't found.
    [05/07/2013 01:19:13.0168] [0] The registry key, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\V15\Setup, wasn't found.
    [05/07/2013 01:19:13.0215] [0] Command Line Parameter Name='sourcedir', Value='\\h1\f$\junk\installers\server\Exchange\2013cu1'.
    [05/07/2013 01:19:13.0215] [0] Command Line Parameter Name='mode', Value='Install'.
    [05/07/2013 01:19:13.0215] [0] RuntimeAssembly was started with the following command: '/sourcedir:\\SERVER\f$\junk\installers\server\Exchange\2013cu1 /mode:Install'.
    [05/07/2013 01:19:13.0215] [0] The registry key, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\V15\Setup, wasn't found.
    [05/07/2013 01:19:13.0793] [0] Finished loading screen CheckForUpdatesPage.
    [05/07/2013 01:19:38.0762] [0] Finished loading screen UpdatesDownloadsPage.
    [05/07/2013 01:19:40.0496] [0] Starting file's copying...
    [05/07/2013 01:19:40.0496] [0] Setup copy files from '\\SERVER\f$\junk\installers\server\Exchange\2013cu1\Setup\ServerRoles\Common' to 'C:\Windows\Temp\ExchangeSetup'
    [05/07/2013 01:19:40.0700] [0] Finished loading screen CopyFilesPage.
    [05/07/2013 01:19:40.0840] [0] Disk space required: 1292445007 bytes.
    [05/07/2013 01:19:40.0840] [0] Disk space available: 23767240704 bytes.
    [05/07/2013 01:19:59.0762] [0] File's copying finished.
    [05/07/2013 01:19:59.0965] [0] Finished loading screen InitializingSetupPage.
    [05/07/2013 01:20:02.0934] [0] Setup is choosing the domain controller to use
    [05/07/2013 01:20:09.0325] [0] Setup is choosing a local domain controller...
    [05/07/2013 01:20:11.0794] [0] [ERROR] Setup encountered a problem while validating the state of Active Directory: Could not find information about the local site. This can be caused by incorrect configuration of subnets or sites or by replication latency. 
    See the Exchange setup log for more information on this error.
    [05/07/2013 01:20:11.0794] [0] [ERROR] Could not find information about the local site. This can be caused by incorrect configuration of subnets or sites or by replication latency.
    [05/07/2013 01:20:11.0809] [0] Setup will use the domain controller ''.
    [05/07/2013 01:20:11.0809] [0] Setup will use the global catalog ''.
    [05/07/2013 01:20:11.0825] [0] Exchange configuration container for the organization is 'CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=domain,DC=local'.
    [05/07/2013 01:20:11.0919] [0] Exchange organization container for the organization is 'CN=DOMAIN,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=domain,DC=local'.
    [05/07/2013 01:20:11.0966] [0] Setup will search for an Exchange Server object for the local machine with name 'WEX1'.
    [05/07/2013 01:20:12.0028] [0] No Exchange Server with identity 'WEX1' was found.
    [05/07/2013 01:20:12.0044] [0] The following roles have been unpacked:
    [05/07/2013 01:20:12.0044] [0] The following datacenter roles are unpacked:
    [05/07/2013 01:20:12.0044] [0] The following roles are installed:
    [05/07/2013 01:20:12.0059] [0] The local server does not have any Exchange files installed.
    [05/07/2013 01:20:12.0075] [0] Server Name=WEX1
    [05/07/2013 01:20:12.0137] [0] Setup will use the path '\\SERVER\f$\junk\installers\server\Exchange\2013cu1' for installing Exchange.
    [05/07/2013 01:20:12.0137] [0] The installation mode is set to: 'Install'.
    [05/07/2013 01:20:27.0591] [0] An Exchange organization with name 'DOMAIN' was found in this forest.
    [05/07/2013 01:20:27.0591] [0] Active Directory Initialization status : 'False'.
    [05/07/2013 01:20:27.0591] [0] Schema Update Required Status : 'False'.
    [05/07/2013 01:20:27.0591] [0] Organization Configuration Update Required Status : 'False'.
    [05/07/2013 01:20:27.0591] [0] Domain Configuration Update Required Status : 'False'.
    [05/07/2013 01:20:27.0841] [0] Applying default role selection state
    [05/07/2013 01:20:27.0872] [0] Setup is determining what organization-level operations to perform.
    [05/07/2013 01:20:27.0872] [0] Because the value was specified, setup is setting the argument OrganizationName to the value DOMAIN.
    [05/07/2013 01:20:27.0872] [0] Setup will run from path 'C:\Windows\Temp\ExchangeSetup'.
    [05/07/2013 01:20:27.0888] [0] InstallModeDataHandler has 0 DataHandlers
    [05/07/2013 01:20:27.0888] [0] RootDataHandler has 1 DataHandlers
    [05/07/2013 01:20:27.0903] [0] Setup encountered a problem while validating the state of Active Directory: Could not find information about the local site. This can be caused by incorrect configuration of subnets or sites or by replication latency.  See
    the Exchange setup log for more information on this error.
    [05/07/2013 01:20:27.0935] [0] [ERROR] Setup encountered a problem while validating the state of Active Directory: Could not find information about the local site. This can be caused by incorrect configuration of subnets or sites or by replication latency. 
    See the Exchange setup log for more information on this error.
    [05/07/2013 01:21:04.0154] [0] The registry key, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\V15\Setup, wasn't found.
    [05/07/2013 01:21:04.0154] [0] End of Setup
    [05/07/2013 01:21:04.0154] [0] **********************************************

    Hi,
    The cause is clearly described in the log:
    [05/07/2013 01:20:11.0794] [0] [ERROR] Setup encountered a problem while validating the state of Active Directory: Could not find information about the local site. This can be caused by incorrect configuration of subnets or sites or by replication latency. 
    See the Exchange setup log for more information on this error.
    [05/07/2013 01:20:11.0794] [0] [ERROR] Could not find information about the local site. This can be caused by incorrect configuration of subnets or sites or by replication latency.
    I'd suggest you check NIC settings and AD configuration.
    Hope it is helpful.
    Fiona Liao
    TechNet Community Support

  • "Setup encountered a problem while validating the state of Active Directory: Exchange organization-level objects have not been created, and setup cannot create them because the local computer is not in the same domain and site as the schema master. Run se

    Team,
    I am trying to Install Exchange on my Lab, getting below error
    message.
    The Schema Role is installed on Root Domain and trying to install
    exchange on Child domain.
    1 Root Domain - 1 Child domain. both are located on single site.
    “Setup encountered a problem while validating
    the state of Active Directory: Exchange organization-level objects have not been created, and setup cannot create them because the local computer is not in the same domain and site as the schema master. Run setup with the /prepareAD parameter and wait for
    replication to complete.”
    Followed below articles:
    http://support.risualblogs.com/blog/2012/02/21/exchange-2010-sp2-upgrade-issue-exchange-organization-level-objects-have-not-been-created-and-setup-cannot-create-them-because-the-local-computer-is-not-in-the-same-domain-and-site-as-the-sche/
    http://www.petenetlive.com/KB/Article/0000793.htm
    transferred the schema roles to different server on root domain, still no luck.
    can someone please help me.
    regards
    Srinivasa k
    Srinivasa K

    Hi Srinivasa,
    I guess, you didn't completed the initial setup schemaprep and adprep before starting the installation. You can do it as follows:
    1. Open command Prompt as administrator and browse to the root of installation cd and run Setup.exe /PrepareSchema /IAcceptExchangeServerLicenseTerms
    After finishing this,
    2. Setup.exe /PrepareAD /OrganizationName:"<organization name>" /IAcceptExchangeServerLicenseTerms
    3. To prepare all domains within the forest run Setup.exe /PrepareAllDomains /IAcceptExchangeServerLicenseTerms. If you want to prepare a specific domain run Setup.exe /PrepareDomain:<FQDN of the domain you want to prepare> /IAcceptExchangeServerLicenseTerms
    4. Once you complete all of the 3 steps, install the pre-requisities for Exchange 2013
    5. Finally, run the setup program
    Hope this will help you
    Regards from Visit ExchangeOnline |
    Visit WindowsAdmin

  • Problem in Validation of ICP dimension

    Hi,
    We have a problem in validating ICP members in FDQM.
    We have few accounts for which ICP value needs to be present.
    In our existing mapping in FDQM,we have an explicit map,which maps source flex to ICP account.We have a default map which maps flex that do not have ICP to [ICP None].
    The problem now, is with the existing mapping,if the acount is an ICP account and if it is not included in explicit mapping,it is getting mapped to default [ICP None].
    Since we are not getting any kickouts for ICP accounts, it is giving us problem in performing eliminations in HFM.
    Could any one suggest any work around where,when any ICP account is not maaped in FDQM,it should give a kickout rather than mapping to [ICP None].
    Appreciate your help.
    Thanks

    There are some partial truths to all of the above....the most accurate being that if ICP None as an acceptable member for Accounts flagged as ICP then you will have problems because it is a valid intersection.
    But there are bigger things to think about. What values come into the icp dimension? Is there always a value being passed through or is that value sometimes blank?
    If there is always a source value then you do not have to use Explict types of mappings. All you have to do is make sure that your *-to-[ICP None] mapping is ALWAYS the last mapping entry in the Like type. Think of it as a catch-all. You just have to map your source-to-target values appropriately.
    If the values coming in are blank then you can still use the above procedures. If you do not use a *-to-[ICP None] mapping and a value comes in as blank then FDM will automatically place [ICP None] in the extract field....it does not map it to ICP None though!!!!!
    Are your source values the same as those in HFM? These are things to think about when mapping.
    Quick note...if a value comes in blank and you try to drill back then you may end up with a false "Show Conversion Rules" view. For example, you have two rows imported with every dimension being the exact same EXCEPT the ICP dimension, where one has a value and the other is blank then you will end up seeing the value that is not blank when you select the "Show Conversion Rules" option. To remedy this I've created an Import Format script for the ICP dimension and check the value coming in...if it is blank then I change the value to "Blank" and map "Blank" to [ICP None]". This allows me to use the Drill-down/Drill-back features correctly.
    Mappings are very simple no matter what dimension but yes, ICP is the trickiest because ICP None can be a valid intersection.
    Lastly, you could have you very last mapping as a *-to#Script....or a Conditional Mapping where your scripting is checking is as such....(See conditional maps in the admin guide for further info)
    'varValues(14) is the Target Account
    'varValues(17) is the source ICP value
    If varValues(17) = "" Then *'1*
    Select Case varValues(14) *'2*
    Case +1stHfMAccount that is ICP, etc+
    Result = "BAD ICP" *'3*
    Case Else
    Result = "[ICP None]" *'4*
    End Select
    Else
    Result = "[ICP None]"
    End If
    1 - If the icp value is blank then check the list of all HFM Accounts that should have an IC Partner. You have to get the list of all accounts flagged as ICP from HFM and continue to update this mapping accordingly.
    2 - Check to see what the Target account is
    3 - If the source account is mapped to an ICP account in HFM and the value is blank then mapped the ICP value to "*BAD ICP*" because *BAD ICP* is not an account in HFM which will cause an Invalid Intersection Report
    4 - If the mapped account is not an ICP account in HFM then map it to [ICP None]
    Hired by Upstream, bought by Hyperion, then bought by Oracle...I've been there.
    -Matt
    Edited by: MattWalker on Feb 26, 2009 11:58 PM
    Edited by: MattWalker on Feb 26, 2009 11:59 PM
    Edited by: MattWalker on Feb 27, 2009 12:02 AM

  • I have problem with pay method

    I have problem with pay method. My card declined. I change card and I have the same problem. What can i do? Why declined my card again?

    Contact iTunes store support: https://ssl.apple.com/emea/support/itunes/contact.html.

  • Problem with traverse method

    Hi, I am having this problem:
    I made a CustomItem, a TextField, now I overloaded the traverse method, so if the keycode is Canvas.UP or Canvas.DOWN then return false else return true.
    The problem is that when I press the left or rigth button it also returns false and not true.
    and there is another problem with traverse, before returning false or true I set a boolean and call to repaint to draw it on some way if its selected or not, the paint method is being called but it just dont draw as desired.
    protected void paint(Graphics g, int ancho, int alto) {
              System.out.println ("Dentro del paint, seleccionado="+seleccionado);
              try {
                   g.drawString(label, 0, 0, Graphics.TOP|Graphics.LEFT);
                   if (!seleccionado) {
                        g.setColor(120, 120, 120);
                   g.drawRect(0, 4, tama�oTexto+8, 25);
                   if (seleccionado) {
                        g.setColor(255, 255, 255);
                        g.fillRect(1, 5, (tama�oTexto+8-1), 23);
                   g.setColor(0, 0, 0);
                   if (!seleccionado) {
                        g.setColor(80, 80, 80);
                   g.drawString(texto, 4, 7, Graphics.TOP|Graphics.LEFT);
                   if (seleccionado) {
                        int cursorX=Font.getDefaultFont().charsWidth((texto.substring(0, idLetraActual)).toCharArray(), 0, texto.substring(0, idLetraActual).length())+4;
                        g.drawChar('|', cursorX, 7, Graphics.TOP|Graphics.LEFT);
              } catch (Exception E){
                   E.printStackTrace();
         }the traverse method set the seleccionado variable and calls to repaint but instead of being false the paint method is drawing it as true (most of times).

    I have a problem with findByxxx() method.. in
    Container managed bean.
    i have
    Collection collection =
    home.findByOwnerName("fieldValue");
    specified in my Client Program, where ownerName is the
    cmp fieldname..
    and
    public Collection findByOwnerName(String ownerName)
    throws RemoteException, FinderException
    defined in my home interface.
    i have not mentioned the findBy() method anywhere else
    (Bean class). You have to describe the query in the deployment descriptor.
    >
    Even if i have a same "fieldValue" in the database
    (Oracle), which i specified in findBy() method, iam a
    result of owner Not found, which is not the case as i
    have that owner name.
    for the same application if i use findByPrimaryKey(),
    it is working..
    Can any one please post me the solution.

  • Problem with Vector method addElement

    I am new to Java. I am using JDK 1.3. I am writing a program that will convert a text file to a binary file that stores a Vector object. I have narrowed my problem to the method that reads the text file and creates my vector. Each element in my vector stores an integer and a string variable. The reading of the text file works find and the creation of my record works find. It seems that the storing of the record in the vector is not working. When I print the first 10 elements of the vector, it have the same record(the last record of my text file). What is wrong with the method below? I am also appending the result of running my program.
    private static void readTextFile(File f) {
    try {
    FileReader fileIn = new FileReader(f);
    BufferedReader in = new BufferedReader(fileIn);
    String line;
    int i;
    SsnLocationRecord recordIn = new SsnLocationRecord();
    int ctr = 0;
    while (true) {
    line = in.readLine();
    if (line == null)
    break;
    ctr += 1;
    i = line.indexOf(" ");
    recordIn.putAreaNumber(Integer.parseInt(line.substring(0,i).trim()));
    recordIn.putLocation(line.substring(i+1).trim());
    records.addElement(recordIn);
    if (ctr < 11)
    System.out.println(recordIn);
    in.close();
    } catch (IOException e) {
    System.out.println ("Error reading file");
    System.exit(0);
    for (int i = 0; i < 11; i++)
    System.out.println((SsnLocationRecord) records.elementAt(i));
    RESULTS:
    C:\Training\Java>java ConvertTextFileToObjectFile data\ssn.dat
    0 null
    3 New Hampshire
    7 Maine
    9 Vermont
    34 Massachusetts
    39 Rhode Island
    49 Connecticut
    134 New York
    158 New Jersey
    211 Pennsylvania
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    C:\Training\Java>

    First of all it would be better if you did a priming read and then checked line == null in the while statement instead of the way you have it.
    ctr++ will also accomplish what ctr +=1 is doing.
    you need to create a new instance of SsnLocationRecord for each line read. What you are doing is overlaying the objects data each time you execute the .putxxxx methods. The reference to the object is placed in the vector. The actual object is still being updated by the .putxxx methods (NOTE : THIS IS THE ANSWER TO YOUR MAIN QUESTION).
    you close should be in a finally statement.
    To process through all the elements of a Vector create an Enumeration and then use the nextElement() method instead of the elementAt is probably better. (Some will argue with me on this I am sure).
    Also, on a catch do not call System.exit(0). This will end your JVM normally. Instead throw an Exception (Runtime or Error level if you want an abnormal end).

  • Problem with prerender method

    Hi,
    I have a problem with the method prerender. A month ago, I started to develop a web project using Sun Studio Creator and a few page beans that i used extended the Abstract Page Bean, so I overrided the prerender and customized it.
    The problem is that, now i'm using eclipse and the configuration files of the project has changed and the prerender method never execute.
    I want to know why it is happening. Maybe the project is "bad-configurated"?
    Thanks

    The code of java bean doesn't change, the only thing that has changed is the configuration files (faces-config.xml, web.xml, etc).
    I put a breakpoint in the prerender method but the lifecycle doesn�t execute this method.
    After serveral changes, I wrote this code in the method prerender :
    int i=0;
    i = 1;
    And the prerender method doesn't execute.
    I'm a bit lost,
    thanks

  • Problem with affinetransformOp method...

    I have a serious problem with filter method
    I Want to make a image flipping or some other filtering by using
    AffineTransformOp
    but it printouts an erro like this
    cannot resolve symbol
    op.filter (img, flipped)
    (the error pointer shows ".after the op")
    a code from my one of the filters
    BufferedImage flipped = new BufferedImage(img.getHeight(), img.getWidth(),BufferedImage.TYPE_INT_RGB);
    AffineTransform trans = new AffineTransform(0, 1, 1, 0, 0, 0);
    AffineTransformOp op = new AffineTransformOp(trans, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
    op.filter(img, flipped); //img is my buffered image source
    I used some other ways like (img, null) but always give out error.
    thanks..

    Did you declare "img" as BufferedImage or something else?
    What is the full error message?

  • Problem with WindowClosing() method

    Hello everyone,
    I have some problem with WindowClosing() method, in which I gave options
    to quit or not. Quit is working fine but in case of Cancel, its not returning to
    the frame. Can anyone help me ....Here is my code
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    public class TestFrame extends JPanel
         public static void main(String[] args)
              JFrame frame = new JFrame("Frame3");
              WindowListener l = new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        int button = JOptionPane.showConfirmDialog(null,"OK to Quit","",JOptionPane.YES_NO_OPTION, -1);
                        if(button == 0)     {
                             System.exit(0);
                                   else
                                              return;
              frame.addWindowListener(l);
              frame.setSize(1200,950);     
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
    }

    Maybe try
    int button = JOptionPane.showConfirmDialog(yourframe,"OK to
    Quit","",JOptionPane.YES_NO_OPTION, -1);

Maybe you are looking for

  • Vendor is getting downloaded as Organisation from R/3 to CRM

    While downloading vendors from R/3 to CRM, the vendor is getting created successfully under role vendor. However, if I assign vendor to title of person in R/3 (as Mr., Mrs etc), it gives me validation error related to title. In short it allows me onl

  • Bpartner - Link between customer and vendor if its the same face

    Hello As I understood the primary idea to keep all business partners together is to make a link between differant roles of the same partner (like link customer and vendor if its the same face). Please correct me if I am wrong. The questions is : how

  • Logic keeps unexpectedly quitting..

    in searching around this forum, this hardly seems to be an unheard of problem. i use Logic Pro 7.0.1, with a MOTU 896HD firewire interface. basically logic keeps quitting whenever i use virtual instruments (not immediately, but frequently enough to c

  • Insert fields in a report header using SortValue() function  (PLD)

    Hi... I need to create a user report, based on a query, that shows the following fields. CardCode |  CardName | Phone1  | E_mail  (header) Adress   | AddrType  | Street   | Streetno ...(repetitive area) I have inserted only one filed sucessfully usin

  • What would be the advantage of using Arch Hurd?

    Would all the current packages work or would there be some incompatibilities? What are the main benefits? Just curious Last edited by trusktr (2010-08-11 06:41:37)