SelectOneMenu with properties file

hi guys,
I've got a problem with selectOneMenu.
Basically setting the itemValue to static text is ok and everything works fine
<f:selectItem itemLabel="#{others['dr']}" itemValue="Dr" />but if I set the itemValue to a property, I get a NullPointerException
<f:selectItem itemLabel="#{others['dr']}" itemValue="#{others['dr']}" />here's the exception
java.lang.NullPointerException
     javax.faces.component._SelectItemsIterator.hasNext(_SelectItemsIterator.java:73)
     javax.faces.component._SelectItemsUtil.matchValue(_SelectItemsUtil.java:47)
     javax.faces.component.UISelectOne.validateValue(UISelectOne.java:56)
     javax.faces.component.UIInput.validate(UIInput.java:354)
     javax.faces.component.UIInput.processValidators(UIInput.java:184)any suggestions?
cheers
c

Looking at the source for MyFaces 1.1.5 it looks as though the select item is reporting both itemLabel and itemValue as null in order to generate the given stack trace. When does the error occur? I.e. during rendering or during submit? It looks as if it is during submit, are you sure the necessary beans are in place to resolve the EL expression upon submit?

Similar Messages

  • Problems with properties files and war files in weblogic 5.1

              I work with WebLogic 5.1 and I'm trying to deploy a web application which gets
              a properties file. If I deploy it as an expanded directory hierarchy (with the
              properties files into WEB-INF/classes) I have no problems. While deploying it
              by a .war file I get this message: "en_GB java.util.MissingResourceException:
              Can't find resource for base name Agent, locale en " (the getBundle() method is
              trying to get an english property file). What could I do? Is it really a weblogic
              5.1 bug?
              Thanks,
              David
              

    This issue comes up repeatably. It's a real bug.
              I believe this problem was fixed in a 5.1 service pack, but I'm trying to
              find out the exact disposition of the issue. Noone seems to be complaining
              about this under 6.x, so a fix seems to have been made, the only question is
              whether or not it got back-ported to a 5.1 service pack.
              Gary
              david <[email protected]> wrote in message
              news:3ac4a39a$[email protected]..
              >
              > I work with WebLogic 5.1 and I'm trying to deploy a web application which
              gets
              > a properties file. If I deploy it as an expanded directory hierarchy (with
              the
              > properties files into WEB-INF/classes) I have no problems. While deploying
              it
              > by a .war file I get this message: "en_GB
              java.util.MissingResourceException:
              > Can't find resource for base name Agent, locale en " (the getBundle()
              method is
              > trying to get an english property file). What could I do? Is it really a
              weblogic
              > 5.1 bug?
              > Thanks,
              > David
              

  • Trouble with properties file (setMnemonic())

    I am trying to internationalize my code and I haven't had much trouble except with my JMenuBar. How do you use the setMnemonic(); method correctly so that it loads from the properties file? This is what I have:
            JMB = new JMenuBar();
            menuFile = new JMenu(props.getProperty("mystuff.file"));The following will not work.
            menuFile.setMnemonic(props.getProperty("mystuff.F"));

    it expects a character,Did you read the API. It says:
    This method is now obsolete, please use setMnemonic(int) to set the mnemonic for a button.
    but I don't know how to do the syntax to make it a character from the properties file What Object do you get from the Properties file?

  • Building EJB with properties file

    I have a EJB project with a properties file in BEA Weblogic Workshop. After building
    the project, the properties file is not included in the resulting JAR file. As
    a result, the resource bundle cannot get the property file and an exception is
    thrown. Is there any method to solve this problem? Thanks.

    I had similar problem. We were using ANT so all I did was to copy all the properties
    file to each
    ejbJar files and war files as well.
    copy the properties file into the top level dir of your ejb jar file. If you do
    jar tvf adsfEJB.jar you will see :
    weblogic-ejb-jar.xml in meta-inf
    wjb-jar.xml in meta-inf
    Mainifest.mf in meta-inf
    ad.java in com/.../.../....
    xxx.java in com/../...
    abc.properties in . (at the top level of the jar file)
    "Neville" <[email protected]> wrote:
    >
    I have a EJB project with a properties file in BEA Weblogic Workshop.
    After building
    the project, the properties file is not included in the resulting JAR
    file. As
    a result, the resource bundle cannot get the property file and an exception
    is
    thrown. Is there any method to solve this problem? Thanks.

  • Classpath problem with properties file in jar

    Hi,
    I am seeing a classpath error for my setup, as follows...
    A defaultFieldIDs.properties exists with numerous entries:
    projectID=10630
    issueTypeID=80
    closedStatusID=6My Spring applicationContext.xml file contains the following:
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
              <property name="locations">
                   <list>
                         <value>classpath:sqlScripts.properties</value>
                         <value>classpath:defaultFieldIDs.properties</value>
                    </list>
              </property>
              <property name="ignoreUnresolvablePlaceholders" value="false"/>
         </bean>     
    <util:map id="defaultQueryParameters">
              <entry key="projectID" value="${projectID}"/>
              <entry key="issueTypeID" value="${issueTypeID}"/>
              <entry key="closedStatusID" value="${closedStatusID}"/>
              <entry key="statusFieldName" value="${statusFieldName}"/>
              <entry key="numberOfExpenseLinesFieldID" value="${numberOfExpenseLinesFieldID}"/>
         </util:map>My compiled jar contains the above properties directory in its root directory, and is placed in the lib directory of the application
    However, when I start my application I get the following error:
    Invalid bean definition with name 'defaultQueryParameters' defined in null: Could not resolve placeholder 'projectID'
    What is going wrong here?

    Then presumably that jar file isn't in the classpath for your application. Perhaps just dropping it into the lib directory isn't sufficient.
    You didn't say anything about what kind of application it is. For web applications, all jars in the WEB-INF/lib directory are in the classpath. But you didn't say this was a web application and you didn't say you put it in the WEB-INF/lib directory. So if you don't care to put sufficient information into your posts, I recommend you read up on the rules for whatever type of application you have, in particular the rules for how to set its classpath.

  • Properties file not deploys the path correctly

    Hello,
    I am deploying a Web dynpro application with properties file.
    One of the properties contains a path that I am later using in my app, something like this:
    PATH =
    myserver
    folder1
    folder2
    The problem is that after deployment I see this property in the config tool with one backwards slash like this:
    PATH = \myserver
    older1\folder2\
    And I need it with
    in my app.
    Even after applying a custom value: "
    myserver
    folder1
    folder2
    " and clearing the cache it doesn't seem to work.
    I know that in java \ states that the char afterwards is special so
    realy means \ so I even tried to deploy this : PATH =
    myserver
    folder1
    folder2
    but got the same behaviour.
    Any idea why is this happening?

    Hi,
    Since you have already tried using four slashes and it didnt work.
    I thot putting space in between will give different result.
    For me, the four slash option shud have worked.
    Ashu

  • Get the pc name with domain name and add it to my properties file using commands

    i want to get the pc name with domain name and add it to my properties file using powershell  .
    sid

    function Get-Environment{
    [environment]|Get-Member -Static -MemberType Properties |
    ForEach-Object{
    if($_.Name -ne 'StackTrace'){
    $v=[scriptblock]::Create("[environment]::$($_.Name)").Invoke()
    New-Object PsCustomObject -Property ([ordered]@{Name=$_.Name;Value=$v[0]})
    Get-Environment
    Get-Environment | Out-String | Out-File environment.txt
    ¯\_(ツ)_/¯

  • Problem with placing of properties file

    Hi all,
    Iam using a properties file.
    From a jsp, Iam reading the property file.....
    Its giving FileNotFoundException....
    I hope its problem with placing of my properties file...
    I placed the properties file in WEB-INF/classes..folder.....
    But still iam getting the FileNotFoundException...
    PLz tell me where exactly should I place my properties file...
    Thanks ....

    first rule of using a forum: read recent topics !
    http://forum.java.sun.com/thread.jspa?threadID=668488&tstart=0

  • Character encoding problem with german umlaut in propertie files

    Hi,
    I use propertie files to translate application to multiple languages.
    These files contains german umlaut (e.g.: Wareneingänge).
    If I rebuild my application then this files are copied from ../src/view to ../classes/view.
    The file in ../classes/view contains "Wareneing\ufffdnge" instead of "Wareneingänge" which is displayed as "Wareneing�nge".
    My browser-, project- and application settings are UTF8.
    Previously the settings for project and application where "Windows-1252"
    I have found an workarounds but maybe this is a bug in Jdeveloper TP4.
    Therefore I post this problem. Maybe someone can confirm this behaviour.
    Workaround:
    Replace "Wareneingänge" with "Wareneing\u00e4nge" in the ../src/view file
    (Zaval JRC Editior does this for you :-) )
    regards
    Peter

    Hi,
    I think to remember that the same was required for properties in 10.1.3 as well. Not sure if this is an issue in JDeveloper 11. I'll take anot and have a look though
    Frank

  • Very weird issue with server logging when using log4j.properties file

    I'm using log4j logging. In log4j.properties the root logger is set up to use the ServerLoggingAppender class so that all our application logs go to the main server logfile. In addition, there are several appenders defined for specific components, with output going to specific per-component log files. Everything is going fine until I launch the server console. At this point all of those per-component log files get wiped out (zero length) and some non-ASCII lines are written to at least one of these files, after which the logs appear to be fine. The main server log file does not appear to be affected (because the root logger is set to "warn" level, while component-specific loggers are set to trace, the contents in these files is different; however I tried disabling all the other appenders and turning the root logger up to trace, and that still did not re-create the problem in the main server log file.
    And here's the really weird part -- if I use the same configuration, but in a log4j.xml file, the problem does not happen.

    Figured it out.
    We were passing in the configuration for log4j as -Dlog4j.configuration=file:/<properties file> and this was added to the command line for both the managed and admin servers. Problem is that the console app starts its own instance of log4j, and when it reads the configuration for the appenders it initializes or rolls over the files. At some point we have two JVMs accessing the same files, so some corruption is bound to happen.
    I'm not clear why the .xml file made a difference, but earlier we had been passing the log4j configuration as a jar file placed in the domain/lib folder, so perhaps the designer reverted to that (placed the log4j.xml file in a jar in lib, and not simply changed the -Dlog4j.configuration=file:/ option.

  • Updating properties file with values containing characters like slash (/)

    Hi,
    I am writing a java class that would create/update properties file. I am passing a string that contains colons. e.g. a path like
    http://xyz.com
    I am using the java.util.Properties.setProperty(String arg0, String arg1) method to set the key value and the java.util.Properties.store(OutputStream arg0, String arg1) to create/update the properties file.
    The resulting property file contains the value as http\://xyz.com
    A slash preappended to the colon.
    I do not want this slash to be preappended.
    How can I achieve that?

    If you don't want this escaping to happend, then you don't want to be using java.util.Properties. Those define the file format in a certain way that includes escaping those characters.
    If you don't want this, you'll have to write them using normal Writers (and read them using Readers) with your own parsing/storing logic added.

  • Modifying properties with a file for Web Service Stub used for Oracle Forms

    I have created a stubbed-out web service in JDeveloper (10.1.3.4) and imported into Oracle Forms.
    However, I would like to use a properties file to call the appropriate endpoint based on if the environment is dev, test, UAT or prod. I see that a properties file is referenced in the _Stub class. Here is a snippet of code from that class file:
    public CriticalChangeWS_Soap11_Stub(HandlerChain handlerChain) {
    super(handlerChain);
    setProperty(ENDPOINTADDRESS_PROPERTY, "http://epw-01.gds.graebel.com:8087/CriticalChange.svc/Soap11");
    setSoapVersion(SOAPVersion.SOAP_11);
    setServiceName( new QName("http://tempuri.org/","CriticalChangeService"));
    setPortName( new QName("http://tempuri.org/","CriticalChangeWS_Soap11"));
    setupConfig("wsquery/proxy/runtime/CriticalChangeWS_Soap11_Stub.xml");
    How can I use the XML file to set the ENDPOINT_ADDRESS_PROPERTY?
    Thanks.
    Jim O

    Hi Frank,
    I got the following two lines of code just to check if WebServiceConnection was able to read the connections file alright.
                String urlString = wsc.getWsdlUrlStr();
                System.out.println("WSDL URL: "+urlString);
    I am not using urlString for further processing.
    The output is
    WSDL URL: http://<host>/PSIGW/PeopleSoftServiceListeningConnector/MyService.1.wsdl
    java.lang.NullPointerException
            at java.lang.Class.isAssignableFrom(Native Method)
            at oracle.j2ee.ws.common.jaxws.runtime.GenericJavaType.create(GenericJavaType.java:97)
            at oracle.j2ee.ws.common.jaxws.runtime.GenericJavaType.create(GenericJavaType.java:118)
    The WSDL Url pointed to is the one that I configure in the connection while deploying the App.
    Ran a test and WSDL Url is accessible by the app.

  • Properties-file with a relative path...

    Hello everybody,
    my question is as follows:
    I have a directory-structure like below:
    root_dir
    |
    -- source
    |
    -- classes
    |
    -- libs
    |
    -- xmlfiles
    |
    myproperties.propsIn words: my root_dir (is actually a subdirectory in my fs) contains folders like source (java-files), classes (class-files)... and a properties-file myproperties.props. The source-dir has subdirs like com/xyz/bla/Mainclass.java...
    I want to load the properties-file from the main-class, but without using the absolute path. That's the way I do it at the moment:
    Properties props = new Properties();
    props.load(new FileInputStream("d:\\foo\\something\\root_dir\\myproperties.props"));But I don't want to write the whole path, because of portability (forget the \\ :) )!
    How can I obtain the root_dir?
    Thanx for helping!
    Regards, Robert4

    Well I was already working on a replacer for /../ stuff before I was pointed to the File class. Not the best code I've written, but works fine. Perhaps it could be of use to you.
        public void setCoordinatesFileURL(String coordFileURL)
            coordinatesFileURL=coordFileURL;
            //replace .. to get canonical path
            StringTokenizer st = new StringTokenizer(coordinatesFileURL,"/");
            String[] stringURL= new String[st.countTokens()];
            int teller=0;
            while(st.hasMoreTokens())
                String token=st.nextToken();
                if(!token.equals(".."))
                    stringURL[teller]=token;
                    teller++;
                else
                    teller--;
            coordinatesFileURL="";
            for(int i=0; i<teller-1;i++)
                coordinatesFileURL+=stringURL[i]+"/";
            coordinatesFileURL+=stringURL[teller-1];
        }

  • Encoding issue in properties files generated with l10n tooling

    Hello,
    I recently try to alter my encoding settings as follows :
    * UTF-8 as workbench default, and for all content types
    * one exception : ISO-8859-1 for *.properties files (in order to conform to the specs of this format).
    Now this gives me an issue when using the l10n tooling: apparently, all the generated properties files are encoded in UTF-8 (the new workbench default), ignoring the content type specific settings.
    The sad result : hieroglyps.
    Isn't there any way for me to specify the generated properties files should be encoded in ISO-8859-1... ?
    Thomas

    please file a bug we need generate those files in 8859-1 all time
    because this is what the spec says.
    Tom
    On 27.07.15 17:18, Thomas Elskens wrote:
    > Hello,
    >
    > I recently try to alter my encoding settings as follows :
    > * UTF-8 as workbench default, and for all content types
    > * one exception : ISO-8859-1 for *.properties files (in order to conform
    > to the specs of this format).
    > Now this gives me an issue when using the l10n tooling: apparently, all
    > the generated properties files are encoded in UTF-8 (the new workbench
    > default), ignoring the content type specific settings.
    > The sad result : hieroglyps.
    > Isn't there any way for me to specify the generated properties files
    > should be encoded in ISO-8859-1... ?
    >
    > Thomas

  • Properties files with Tomcat 4.0.1

    I'm having trouble finding properties files using Class.getResourceAsStream
    Properties props = new Properties();
    try {
      props.load(Class.class.getResourceAsStream("/Database.properties"));
    catch (IOException e) {
      //error reading from stream
    }The above code works fine on several web server (including Tomcat 3.2.3), but fails on Tomcat 4.0.1 - the server takes around 50 seconds to return a response, then throws a StackOverflowError. The properties file is in WEB-INF/classes.
    Has anybody else had the same problem?

    Thanks for the reply Guido.
    However, I can't use the ServletContext to load the files I'm after, because the code is part of the data tier and should not be dependent upon the controller (in fact I have no reference to the ServletContext).
    If I can't use Class.getResourceAsStream in Tomcat 4, does that mean that any third party APIs that rely on it will fail? - seems a little strange to me!
    The Tomcat 4.0 documentation says:
    "All unpacked classes and resources in the /WEB-INF/classes directory of your web application archive, plus classes and resources in JAR files under the /WEB-INF/lib directory of your web application archive, are made visible to the containing web application, but to no others."
    I would expect "All unpacked classes and resources" to include all unpacked resources (such as properties files)
    I've now managed to load the properties file using this code:
    props.load(new FileInputStream(getClass().getResource("/Database.properties").getFile()));(don't know why getResource should work when getResourceAsStream doesn't, but that's what appears to be happening).
    Now I have a new problem - loading a JDBC driver. I get:
    java.lang.NoClassDefFoundError: oracle/jdbc/pool/OracleDataSource
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:120)
    when I call
    new OracleConnectionCacheImpl()
    but the class does exist, in a zip file (OracleThinClientJDBCDriver_901.zip) in WEB-INF/lib. It looks to me like the oracle code in the lib directory has been found by the ClassLoader, but that Class.forName does not work...eh?!?

Maybe you are looking for

  • Error while Debugging MSA  'Creation of Login Object Failed'

    Dear Friends, I am working on CRM Mobile Sales 5.0 SP 5. I have setup my Mobile Client and Mobile Application Studion On the same machine. I have perform the initial generation of the application from Mobile Repository server to my machine. it gave m

  • Can I possible to use dual boot(windows 7 in internal hard disk and windows 8 in external hard disk)?

    i want to create dual boot(2 OS in 1 laptop) in my laptop but my internal hard disk reach maximum(3) logical partition so my genuine windows 7 os is not allow me to create new logical partition and install win8 pro. i planed to purchase one external

  • Change to OTR Text in Title changes UI look and feel

    We are running: ECC 6 EhP3 NW7 LSO 603 We were asked to change the title of Package:  LSO_FRONTEND Alias: LSO_FRONTEND/ACTIVITIES When I tried to change it in the OTR it allowed the change but removed the tray around the title in the portal screen. 

  • Source system connection

    Dear BW mates, When i try to make a connenction from BW to a source sytem i get the following message: R/3 System does not allow any changes to be made to object IDOC ZSBE068. I think that the suggestion for a solution by SAP blow doesn't help anway.

  • Safari Ignores Downloads

    If I click a link to start downloading files (even the ones on Apple's website), the file doesn't start, the page simply reloads. This is irritating because I have to Ctrl-click the link and select Save File to Desktop, and even more irritating for w