Custom properties files in enterprise project

Hi,
I created a enterprise application containing 3 projects:
- EAR project
- EJB project
- Web project
And I added a properties file in :
-EAR project/EarContent/APP-INF/afile.properties
The content of this file is :
Host=<path to host>
Port=389
And I have a .jar file that uses this properties file that is located in :
-EAR project/EarContent/APP-INF/lib/afile.jar
Then I add .jar file, through EAR project --> Right click --> Properties --> Deployment Assembly --> Add --> Archives from workspace
It is then shown under EAR porject - Deployment Descriptor - Bundled Libraries - Library Directory
When running the application, the JAR file executes as it should, but it cant find the properties file.
In the .jar file I have a java file that locates the properties file and elements like this :
private static final String BROKER_PROPERTY_NAME = "afile";
brokerResources = PropertyResourceBundle.getBundle(BROKER_PROPERTY_NAME);
String host = brokerResources.getString("host");
int port = Integer.parseInt(brokerResources.getString("port"));
Anyone know where to put the properties file to be able to get this to work?
Regards, reZer

Hi, thanks, it works :)
After Clean, and Publish, and restart , remove, add it runs :)
Is the Classes directory available when deploying to an production environment? So that I can change the content without the need for å redeployment?
I could figure out where Weblogic stores deploymentfiles in my domain, EAR, WAR, EJB files, and lib and classes dir.
-regards reZer

Similar Messages

  • WSAD : loading properties file from EBJ project

    Hi,
    I am trying to load properties file contains database parameters into my EJB project. I am using WSAD as IDE tool
    can you please help me with following.
    1. where to place the .properties file physically ?
    2.how to load the file to my EJB/DAO classes
    3.can i use the same location to place log4j.properties file as well ?
    I have tried doing in different ways but none is working.
    thank you
    Narendra

    got it working , for information pl go to the following page and section "Using log4j in an EJB Application"
    i have followd same steps for loading my properties file .
    http://sys-con.com/story/?storyid=43413&DE=1

  • Where to store a custom properties file in an EJB 3 deployment

    In a web application I can store my own properties file in WEB-INF. However a EJB 3 deployment does not have such a directory.
    Where is the correct place within [an ejb 3 jar file] to store my properties file, and how do I retrieve it. (Do I need an absolute url or just a url that checks the classpath?)
    Thanks,
    nat

    For JBoss they use something like :
    String filename = System.getProperty("jboss.server.home.dir") + "/conf/application.properties";
    It will be located in jboss/server/[server-name]/conf/application.properties

  • Use resourceBundle properties file from KM

    Hi,
    I have a properties file called com.mycomp.apps.phonebook.properties in the KM Content of the portal in KM Content => root => mycomp => apps => phonebook => customizing
    Now I'm developing a new LinkCommand service for the UserDetails.
    http://help.sap.com/saphelp_nw04/helpdata/en/65/29b24053c13f5fe10000000a155106/frameset.htm
    The already existing LinkCommand "Send E-mail..." is read from the original resourceBundle com.sap.ip.collaboration.gwui.api.wdf.mail.SendTo
    For my new LinkCommand I would like to use the existing properties file. How do I have to define this file in the uicommand xml or properties xml sheet?
    Can anybody help me?
    With the local project resourceBundle it's working, but I would like to use the file in the KM. Andy ideas?
    Regards,
    Stefan

    Hi Praven,
    Copying all existing SendTo properties file to my project would be an option but I wouldn't win anything.
    I'm quite happy with the existing SAP collaboraton properties files using e.g. for "Send e-mail".
    I won't change this existing ones. I created a new LinkCommand. And for this new LinkCommand I'm looking for a solution how I can handle the translation for it.
    I would prefer e using my existing file which is located in the KM. The reason why it's located in the KM is, if I need to change a translation or add a new translation properties file I only need to change it in the KM. If it's a part of the project I need by every change to deploy the project new.

  • Read resourceBundle properties file from KM

    Hi,
    I have a properties file called com.mycomp.apps.phonebook.properties in the KM Content of the portal in KM Content => root => mycomp => apps => phonebook => customizing
    Now I'm developing a new LinkCommand service for the UserDetails.
    http://help.sap.com/saphelp_nw04/helpdata/en/65/29b24053c13f5fe10000000a155106/frameset.htm
    The already existing LinkCommand "Send E-mail..." is read from the original resourceBundle com.sap.ip.collaboration.gwui.api.wdf.mail.SendTo
    For my new LinkCommand I would like to use the existing properties file. How do I have to define this file in the uicommand xml or properties xml sheet?
    Can anybody help me?
    With the local project resourceBundle it's working, but I would like to use the file in the KM. Andy ideas?
    Regards,
    Stefan

    Hi Praven,
    Copying all existing SendTo properties file to my project would be an option but I wouldn't win anything.
    I'm quite happy with the existing SAP collaboraton properties files using e.g. for "Send e-mail".
    I won't change this existing ones. I created a new LinkCommand. And for this new LinkCommand I'm looking for a solution how I can handle the translation for it.
    I would prefer e using my existing file which is located in the KM. The reason why it's located in the KM is, if I need to change a translation or add a new translation properties file I only need to change it in the KM. If it's a part of the project I need by every change to deploy the project new.

  • Accessing .properties file from java code

    Hi,
    I want my java code in a Tomcat Web Application to access values in a custom .properties file.How can i do it.
    Any sample code / suggestions welcome.
    Thanks
    Vignesh.

    ResourceBundle vResourceBundle = ResourceBundle.getBundle("database", Locale.ENGLISH);
            sDriverName = vResourceBundle.getString("database.DriverName");
            sDbURL = vResourceBundle.getString("database.DriverUrl");
            sDbUser = vResourceBundle.getString("database.UserName");
            sDbPasswd = vResourceBundle.getString("database.PassWord");Where "database" is the name of the property file. ie., database.properties.
    the content of the database.properties file
    # Properties to access dabase                 
    database.UserName = scott
    database.PassWord = tiger
    database.DriverName = oracle.jdbc.driver.OracleDriver
    database.DriverUrl = jdbc:oracle:thin:@nn.nn.nn.nn:port:orartgnull

  • Robohelp 9 .properties file inserting non-printable characters @ export

    I have a mapped help file that I am generating for integration to an online application. When we export the .properties file from the Project Set-up pod, the mapped files appear to be fine, if viewed in Notepad (see below).
    However, when this is viewed in a different text editor, you can see that RoboHelp added additional non-printable characters to the .properties file (see below).
    We've tried generating this from different computers, exporting it to different locations, retyping the initial entry, and haven't found a solution to this issue.
    Does anyone know if there is a fix available? Are we doing something wrong?
    Thanks!!
    Kelly

    Ask your developers if they think these characters could be what are known as BOM (byte order marks).
    That is something can be seen in some files using the default encoding. There it can be changed by changing the encoding in the SSL dialog.
    Maybe that explains it and if that is the cause, I don't know how you would prevent it here in Rh. I think you will have to live with your own solution.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Appearance.properties file

    Hi there,
    I am trying to open the appearance.properties file for my project but it says "Windows can't open this file" - what program do I need to download to be able to open and edit this file?
    Thanks!

    You can open appearance.properties in any text editor, e.g. NotePad. My preference is to use NotePad++ which is a free download. Just Google "NotePad++" and you'll find it easily.
    Cheers,
    Jasmine

  • Use properties file out of EAR

    HI All,
    Generally we create an EAR file with all the property files embedded in it. Here the problem is as and when we change the property files we need to build a new ear file and redeploy to J2EE stack.
    Is there any way that this properties file is out of EAR application and changes done to the property file reflects in EAR? So that, no need to redeploy the application again and again. Means dynamic reflecting of property changes to already deployed EAR application. How it can be done?
    Actually this is our client requirement also...
    Hope am clear.
    Regards,
    Satish.

    Hi,
    There are ways to achieve this.
    I guess you can try following.
    You can define properties file in another project (like java project) and then include that project as a reference in your EAR application.
    Ashutosh

  • Create a properties file

    Hi
    How do I create a properties file in my project using JDeveloper 9.0.3.
    Right now, I'm creating the file through explorer and then adding it to the project, via the menu bar.
    But there has to be a simpler way to do this.
    Thanks,
    Sergio Bastos

    You can use File->Open... to create new files and add them to the project simultaneously. Just type in the filename of the file you want to create.
    Brian
    JDev Team

  • Project Server 2010 - create a custom enterprise project field for persons (no text, no lookup table...)

    I want to create a custom enterprise project field and would like to use instead of for example a text attribute or a look-up table a field for employees (e.g. project manager) which are coming e.g. from the Active Directory. But when creating this custom
    project field I cannot see such an option. What solution do you suggest as I want to avoid that everybody uses different names and spellings for e.g. the project manager and without having to fill the lookup table with all resources of the company.
    Thank you so much for your help!

    Hi,
    Are you using Proejct Server 2007, 2010, 2013?
    In case you're working with 2010 version, here is an excellent
    blog about how to insert a resource picker in a PDP (project detail page).
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • How to add the property file..ie(default.properties) to a webdynpro project

    Hi All,
    How to add the property file..ie(default.properties) to a webdynpro project.
    I urgently require the solution. Kindly get it for me.
    Regards
    DK

    Hi DK,
    this is described in the second Web Dynpro Java Tutorial
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/b1a3e990-0201-0010-aeb2-a2ef5bc3da8e">creating an Extended Web Dynpro Application</a>
    Regards, Bertram

  • EJB project IDE build dos not include properties files

    We have property files also which we want included as part of the build process
    for EJB projects but if we use the IDE build it does not include them. We have
    to therefore export the IDE build and customize it to include *.properties like
    this
    <zip basedir="${dest.path}" zipfile="${ejb.outputJar}" encoding="UTF8"> <!-- JARs
    filenames are encoded UTF8 --> <zipfileset dir="${project.local.directory}" includes="*.properties"
    /> </zip>
    which causes a problem for us because the exported build file is specific to a
    user's local PC and cannot be used in a team environment.
    How can we have the IDE build include all the files within an EJB project i.e.
    include properties files also.

    Hey Jamie,
    Currently there is no support to include other .properties files into
    the internal build. There's a build.properties that you get as part of
    an EJB project which you could place your values into and use that as
    your template for your team based development and check that into your
    source control.
    If you'd really like to get gross and hack Workshop a little bit you
    could modify the default EJB project template to use your .properties
    file for every EJB project you create. This would then splat a copy of
    your .properties file into the root of the EJB project.
    To do that you'd go to {your BEAHOME}\workshop\templates and crack open
    the ejb-project.zip template zip file and merge your settings into the
    existing build.properties file. This has the same
    effect as replacing the .properties file after you've created your
    project only it keeps you from having to perform that step each time.
    The downside of this is that each person on your team would then have to
    update that template zip file in their workshop installation. (I'd make
    sure to backup the original template file before performing this
    activity so you can always go back to the original template).
    Hope this helps,
    -Michael
    Jamie wrote:
    We have property files also which we want included as part of the build process
    for EJB projects but if we use the IDE build it does not include them. We have
    to therefore export the IDE build and customize it to include *.properties like
    this
    <zip basedir="${dest.path}" zipfile="${ejb.outputJar}" encoding="UTF8"> <!-- JARs
    filenames are encoded UTF8 --> <zipfileset dir="${project.local.directory}" includes="*.properties"
    /> </zip>
    which causes a problem for us because the exported build file is specific to a
    user's local PC and cannot be used in a team environment.
    How can we have the IDE build include all the files within an EJB project i.e.
    include properties files also.

  • Adding custom properties to a File system Repository

    Hi KM-Experts
    I have integrated a local file server in the portal, and need to attach some custom properties to the files located on the server.
    The documentation for a File System Repository displays that this task is not possible. Is there some kind of work around?
    I can se that you can attach standard meta data like “ratings” etc.
    Cheers
    John

    Hi Robert
    Thanks a lot; I think that this will solve most of my problems.
    Can I create a CM repository based on an existing fileserver, without deleting or changing any files?
    What will happened when files are changed manually on the fileserver, will the repository crash or will a lot of dead links occur?
    If you add some files directly on the file server, will they not be visible through the portal?
    I was hoping that there was some kind of “incremental” update, which could run during the night. I know that it’s not the best solution, but I am interesting in the limits of this repository solution, because the employees access the fileservers directly during the portal implementation period.
    Cheers
    John

  • Write a properties file in a package, of my own project.

    It is kinda hard for me to safe my checkSameFile.properties file inside a package of my own project.
                    Properties properties = new Properties();
              FileOutputStream fileOutputStream = null;
              try {
                   fileOutputStream = new FileOutputStream("checkSameFile.properties");
              } catch (FileNotFoundException e) {
                   e.printStackTrace();
              try {
                   properties.setProperty("directoryPathName", "K:/Muziek/Muziek");
                   properties.store(fileOutputStream, "Two directory path names");
                   fileOutputStream.close();
              } catch (IOException e) {
                   e.printStackTrace();
              }This does work, but my checkSameFile.properties is saved in my project map outside the src folder.
    I want to save checkSameFile.properties in my package 'application.checkSameFile' . It tried many things, but nothing works.
    The most beautiful solution would be something like this.
                    Properties properties = new Properties();
              FileOutputStream fileOutputStream = null;
              try {
                   fileOutputStream = new FileOutputStream("application.checkSameFile.checkSameFile.properties");
              } catch (FileNotFoundException e) {
                   e.printStackTrace();
              try {
                   properties.setProperty("directoryPathName", "K:/Muziek/Muziek");
                   properties.store(fileOutputStream, "Two directory path names");
                   fileOutputStream.close();
              } catch (IOException e) {
                   e.printStackTrace();
              }This doesn't work.
    I hope someone can help me out. I thank in advance.

    Ah ok thx for helping me. It was kinda stupid of me i guess.

Maybe you are looking for