Where property files should go for *.ear

I am trying to get log4j to work with my J2EE application for the web part of it.
Where should I put log4j.properties for web application in the *.ear file.
I have tried WEB-INF\classes under the document root, but it did not work, then I tried to put log4j.properties at the same level as web jar file (just directly in *.ear file) and specify the class path in manifest for web jar file as �./�, but it still does not work.
Any other ideas?
Janusz

Hi
This is due to Class loading..
I suggest u to read the sample chapter Classloaders and J2EE available at the following link.
http://www.theserverside.com/books/review/J2EESurvivalGuide.jsp
This will give u an good insight into ur problem and will give u an solution ofcourse
Thanx
Sathish

Similar Messages

  • Property file should be externalize and outside the archive (say ear) ?

    My team architect is suggesting me to externalize the property files like locale resources (e.g messages.en.properties ), log4j (e.g log.properties) etc .The reason is to avoid recompiling incase of changes to this resources.
    Example tomorrow if something goes wrong in production and we want to enable the debug log,then we can change the property file ,restart the server and we are good.If it was inside the archive file we have to create a brand new
    a brand new archive file ,redeploy it and restart the server again.
    In my entire work experience I never externalized this resources because they are inherent part of the archive file.Hence any changes then recreate the archive file and redeploy.
    The team architect might have some good reason.
    Please advice.
    Thanks
    m

    Manjit wrote:
    My team architect is suggesting me to externalize the property files like locale resources (e.g messages.en.properties ), log4j (e.g log.properties) etc .The reason is to avoid recompiling incase of changes to this resources.
    Example tomorrow if something goes wrong in production and we want to enable the debug log,then we can change the property file ,restart the server and we are good.If it was inside the archive file we have to create a brand new
    a brand new archive file ,redeploy it and restart the server again.
    In my entire work experience I never externalized this resources because they are inherent part of the archive file.Hence any changes then recreate the archive file and redeploy.
    The team architect might have some good reason.
    Please advice.
    Thanks
    mIf the major hurdle is changing log levels dynamically..you could look at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PropertyConfigurator.html#configureAndWatch%28java.lang.String%29

  • Where REP files should be placed ?

    Hi All,
    I'm a newbie in Forms & Reports. Now I'm facing a situation. I have a form with the following procedure on button:
    RP2RRO.RP2RRO_RUN_PRODUCT(REPORTS,'MYREPORT',SYNCHRONOUS,RUNTIME,FILESYSTEM,TO_CHAR(NULL),NULL);
    Whenever this button is pressed , a exception raises (Frm-40735: when-button=pressed trigger raise unhandled exception ora-06508). I think that exception is raised due to the location of MYREPORT.rep file. I don't know where it should be placed.
    That's is my question: Where *.rep files must be placed?
    I'm running Oracle Forms & Reports 11g R2 on Windows 7 64 bit.
    Thanks a lot.

    That would depend on the source directory of your reports server:
    http://docs.oracle.com/cd/E24269_01/doc.11120/e24479/pbr_conf002.htm
    cheers

  • I built a website with iWeb on my older mac and launched it on the internet. The hardrive crashed which was where the files were saved for the website. Is there any way to recover it through the internet onto my newer computer?

    Is there any way to recover this website? I need to edit it but the original files were wiped clean even after recovering what was left on the hard drive.

    iWeb stores its sites and pages in a proprietary package format on the HDD in the user library, and when FTP'ing it to the server, it's a set of PHP and other file types. So, there is no way you can re-build from what's on the server.
    But you may double-check, the file in question on the HDD is ~/Library/Application Support/iWeb/Domain.sites2 (where ~ is your user home folder). Maybe it's somewhere among your recovered files? Restoring it into the same location and copying iWeb into the Applications folder will get you going again.
    Other than that, here is a discussion forum dedicated to iWeb.

  • How to know if a property file that I use in my program is updated

    Hi everyone,
    I was wondering how my program can know as soon as the property file/any file that I'm intersted in, has been updated at runtime. Something like JBoss descriptor etc, as soon as we make a change the app server knows of that change ?
    I need this technique for updateing my static variables in memory as soon as there was a manual change to any properties at runtime.
    Any help will be appreciated.
    Thanks,
    - Liju P.Oommen.

    One way to do it would be to wrap the process used to update the property file itself. For example if you provided a GUI that people used to change the properties and this GUI also notified your program when the properties changed you could maintain consistency.

  • JSP Registry could not locate runtime property file

              At runtime, my JSP is throwing an exception claiming to be not able to find the property
              file. I have found the exact property file in the jar located on the server. I've
              tried extracting it and placing it in different places and adding the file and directory
              to the WebLogic classpath. I'm not sure what else to try.
              Here's the exception:
              Loading from CLASSPATH cat_test4_cat_pkg_Cat_pkgModule.properties
              java.lang.RuntimeException: JSP Registry could not locate runtime property file:
              cat_test4_cat_pkg_Cat_pkgModule.properties
              at java.lang.Throwable.fillInStackTrace(Native Method)
              at java.lang.Throwable.fillInStackTrace(Compiled Code)
              at java.lang.Throwable.<init>(Compiled Code)
              at java.lang.Exception.<init>(Compiled Code)
              Thanks.
              

    When you generate a webapp or use the JSP element wizard , a property file is created for you that contains some startup parameters. This file needs to be available in the classpath. This errors comes up becuase the file is not avalable in the classpath.

  • Generic Message Bundle Property Files

    Hi
    I am using a generic message properties file, which is contained in a seperate java project too the model and view controller projects. In our custom validations on the entities I am referencing the custom messages from the resources project. When running the application module the correct error messages are displayed. However the error messages are not correctley displayed in the UI and the following error message is displayed,
    Error: STRINGMANAGER: Message file: 'java.util.ResourceBundle.msg_en_ZA' not found. (Looking for 'InvalidJobId').
    I have tried including the resource bundle in the view controller project, firstly in the project properties as a Resource Bundle and as a jar file without succes.
    Any help in resolving this would be appreciated.
    Regards.
    Leon.

    Leond wrote:
    Error: STRINGMANAGER: Message file: 'java.util.ResourceBundle.msg_en_ZA' not found. (Looking for 'InvalidJobId').
    I suggest that you verify your browser locale. It seems that it is set to ZA and you don't have a property file (ResourceBundle.msg_en_ZA) for that locale.
    Alternatively, rename to or create the file ResourceBundle.msg_en_ZA.

  • Where to put property files used by XSLT extensions?

    Still fighting with Java XSLT extensions. I have narrowed the
    problem down: my XSLT extension cannot find its property file,
    which I use to store JDBC connect strings etc.
    What is the proper directory to put this file so the XSLT
    extension class can find it? I am using Oracle HTTP Server with
    XDK 9.0.

    Thanks for the answer, Steve!
    Depends on what call you're using in your extension function to
    read your properties.Maybe I tried a too simplistic approach. I'm just using this:
    Properties props = new Properties();
    try {
    props.load(new FileInputStream("/foo.properties"));
    etc.
    This (with the slash) works if the properties file is in the root
    directory of the filesystem, but it's a kludge.
    If you read your properties as a resource using
    getResourceAsStream(), then where the classloader expects to
    find your file depends on the resource name that you specify.So maybe I should use getResourceAsStream() then? What if I put
    the properties file inside the JAR with the extension classes?
    Or is there any way to reference the web root?
    --Jere

  • New to EAR/WAR - where do files go?

     

    posting to servlet newsgroup.
              "Frank Rachel" <[email protected]> wrote in message
              news:[email protected]..
              > We've been successfully running under WebSphere 3.5 and Weblogic 5.1 for a
              > while. However, in this mode we are not using EAR/WAR files. Our login.jsp
              > page gets information from a properties file (in our case,
              > general.properties). Under the older versions, there was a "working
              > directory" concept, so thats where the property file needed to be. Where
              > does this go when I package everything up as a WAR?
              >
              > I have the WAR made, and it deploys. But when I go to the login.jsp (it
              > compiles) I get a filenotfound exception on my general.properties. Exactly
              > where is it looking for the file?
              >
              > Since our code it littered in a directory structure that doesn't match the
              > WAR structure, I manually create the war, so if I know where this goes
              > relative to the root of the WAR i can easily add it.
              >
              > Thanks.
              >
              >
              

  • Relative path for servlet property file.

    I have the following java file. When I use the absolute path for the configFile, it works. I would like to know how I could use it as relative path as in installation, the name of the directory could change.
    How do I fix the problem? Thank you.
    ---------------------- LoadProperties.java ----------------
    import java.util.*;
    import java.io.*;
    public class LoadProperties {
    private String driver="";
    private String dbURL="";
    private String login="";
    private String password="";
    static public void main(String[] args) {
    LoadProperties lp = new LoadProperties();
    } // main
    public LoadProperties() {
    //String configFile = "C:/1LMS/web-app/WEB-INF/config/db.properties";
    String configFile = getClass().getResource("config/db.properties").toString(); <--- This line could not find the db.properties file.
    Properties Prop = new Properties();
    try {
    FileInputStream configStream = new FileInputStream(configFile);
    Prop.load(configStream);
    configStream.close();
    } catch(IOException e) {
              System.out.println("Error: Cannot laod configuration file ");
    driver =Prop.getProperty("driver");
         dbURL = Prop.getProperty("dbURL");
         login = Prop.getProperty("login");
    password = Prop.getProperty("password");
    printResult();
    } //Load Property
    private void printResult() {
         System.out.println("Driver = " + driver);
         System.out.println("dbURL = " + dbURL);
         System.out.println("Login = " + login);
    System.out.println("PSWD = " + password);
    } // class

    hi there,
    had the same problem... you need to use following API:
    http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String)
    In your case something like that:
    // get the servlet context
    ServletContext context = getServletContext();
    // directory name where the file is located
    String realPath = context.getRealPath("/config");
    // get real path to your file
    String propertyPath = real+"filename.txt";
    hope that helps!!
    minu

  • I need help every time my iTunes library updates i get this error messege: The iTunes.itl file cannot be found or created. The default location for this file is in the "iTunes" folder in the "Music" folder. but the file should be there.

    Every time I have to upgrade iTunes it gives me this messege:'The default location for this file is in the "iTunes" folder in the "Music" folder.' the file should be there but I don't understand why it does this every time Apple upgrades the Itunes library. Its on the computer somewhere but it only affects this login on my computer (meaning on this Windows Account). Why does my iTunes do this? Then I have to spend hours placing all my libraries back together and all my music back into the library. Which usually takes me a few days to sort all out. What is wrong with my iTunes? The iTunes folder is a folder in my Music folder where I store the iTunes music/files/libraries at on my computer so I can have all of the iTunes files in one place on my computer.

    I have a Windows 7 operating system my computer runs from.

  • JDeveloper 10g, ADF, ANT:How to define ant task for EAR & WAR file creation

    I am trying to automate the deployment process of our ADF Faces & BC application. I have reviewed this doc:
    http://download.oracle.com/docs/cd/B31017_01/web.1013/b28951/anttasks.htm
    and followed the procedure for integrating ant onto the server. I can build the project and also successfully deploy the ear file. Howerver, I did not find any instruction on how to generate the EAR file. Can anyone point me to the right place for this task definition?
    Here is my current build.xml file.
    <?xml version="1.0" encoding="windows-1252" ?>
    <!--Ant buildfile generated by Oracle JDeveloper-->
    <!--Generated Jul 16, 2007 12:20:13 PM-->
    <project name="CRDBApps" default="build-all" basedir="." xmlns:oracle="antlib:oracle">
    <property file="build.properties"/>
    <property file="ant-oracle.properties"/>
    <target name="clean-all" depends="">
    <ant antfile="build.xml" dir="CRDBView" target="clean"/>
    <ant antfile="build.xml" dir="CRDBLib" target="clean"/>
    <ant antfile="build.xml" dir="CRDBModel" target="clean"/>
    </target>
    <target name="build-all" depends="clean-all">
    <ant antfile="build.xml" dir="CRDBView" target="compile"/>
    <ant antfile="build.xml" dir="CRDBLib" target="compile"/>
    <ant antfile="build.xml" dir="CRDBModel" target="compile"/>
    </target>
    <target name="deployear" depends="">
    <echo message="-----> Deploying the application module deployment (ear) file"/>
    <oracle:deploy deployerUri="deployer:oc4j:opmn://myserver/home"
    userid="oc4jadmin"
    password="password"
    file="CRDBView/deploy/CRDBApps.ear"
    deploymentName="CRDBApps"
    bindAllWebApps="default-web-site"/>
    </target>
    </project>
    thanks!
    Wes

    Thanks all for the tips. After reading up a bit today on ear/war files and ant. I ended up just creating a task to mimic the ear/war file structure. My script isnt pretty but I'll work on refining that later. Here is what I have if anyone ever is interested:
    <target name="war" depends="">
    <echo message="Executing target war..."/>
    <mkdir dir="war"/>
    <copydir src="CRDBView\public_html" dest="war\"/>
    <copydir src="CRDBView\classes" dest="war\WEB-INF\classes"/>
    <copydir src="CRDBModel\classes" dest="war\WEB-INF\classes"/>
    <copydir src="CRDBLib\classes" dest="war\WEB-INF\classes"/>
    <echo message="Creating war file..."/>
    <jar basedir ="war" destfile="CRDBApps.war"/>
    <echo message="Done executing target war..."/>
    </target>
    <target name="ear" depends="war">
    <echo message="Executing target ear..."/>
    <mkdir dir="ear\META-INF"/>
    <copydir src="CRDBView\deploy\META-INF" dest="ear\META-INF"/>
    <copy file="CRDBApps.war" todir="ear\"/>
    <jar basedir ="ear" destfile="CRDBApps.ear"/>
    <echo message="Done executing target ear..."/>
    </target>
    <target name="cleanAndDeployCRDBApps" depends="build-all,deployear">
    <echo message="Executing target cleanAndDeployCRDBApps..."/>
    <delete dir="war"/>
    <delete dir="ear"/>
    <echo message="Done executing target cleanAndDeployCRDBApps..."/>
    </target>
    <target name="deployear" depends="ear">
    <echo message="Executing target deployear"/>
    <oracle:deploy deployerUri="deployer:oc4j:opmn://myserver:6003/home"
    userid="oc4jadmin"
    password="password"
    file="CRDBApps.ear"
    deploymentName="CRDBApps"
    bindAllWebApps="default-web-site"/>
    <delete file="CRDBApps.ear"/>
    <delete file="CRDBApps.war"/>
    <echo message="Done executing target deployear"/>
    </target>
    ...

  • Creating cache for multiple property files run time/dynamically.

    Hi,
    I have a requirement, where in I need to create cache for each property file present in a folder at server side or in the lib or resources directory. Please help me how I can do this?
    Thanks.

    ok thank you.
    I follwed this method implementation:
    static HashMap<String, HashMap<Object, String>> cacheHolder = new HashMap<String, HashMap<Object, String>>();
         static HashMap<Object, String>[] cache = new HashMap[2];
         static Integer fileCount = 0;
         static int incrementSize = 2;
    public method1(Map<Object,String>map){
    File file = new File((new StringBuilder(
                             "ABC/XYZ/")).append(value)
                             .toString()); // where value is the file name returned from the external method
                   int newSize = existingMapLength+incrementSize;
                   if (someVal== null) {                    
                        synchronized (fileCount) {
                             int oldSize = cache.length;
                             if(fileCount==cache.length){
                                  HashMap[] oldData = new HashMap[oldSize];
                                  oldData = cache;                              
                                  cache = new HashMap[newSize];
                                  LOGGER.info("New Size added:==>"+cache.length);
                                  for(int i=0;i<oldSize;i++){                                   
                                       cache[i] = oldData;
                                  cache[fileCount] = readExternalPropertiesFile(file); // external method which returns the properties of the file in hashmap
                                  cacheHolder.put(value, cache[fileCount]);                    
                                  keys = cache[fileCount].keySet();
                             else{                         
                             cache[fileCount] = readPropertiesFile(file);
                             cacheHolder.put(value, cache[fileCount]);                    
                             keys = cache[fileCount].keySet();
                             someVal= cache[fileCount];
    fileCount = fileCount + 1;
    Please let me know if any improvemnets are possible.

  • Where is a good source for text files?

    Hi
    I've just finished implementing a huffman tree and been testing it out. It seems to be working fine - encoding and decoding results look correct.
    However, I really want to test this tree out with a larger 'dictionary', so that I can construct a larger tree and check if performance is any slower. Does anyone know where I can find a collection of large text documents that I can easily download and have my code run over it?
    I tried googling, but haven't came across anything useful. Ideally, I would like to find documents of different topics. e.g. medical, computing, and a more general type that resembles everyday language. The reason I am wanting these is so I can test the encoding of different text on different tree types. Thus, encoding a computer journal on a tree constructed from the frequencies of a medical text file, should yield poorer compression than encoding the same computer journal on a tree constructed from the frequencies of a computing text file.
    Thanks

    Google "project gutenberg" for a bunch of text.
    Plain ASCII isn't enough for pictures and many fields' texts. So a lot of modern texts tend to be PDFs and such, which might not suit your purpose.
    Maybe you could also use web pages as test data. Write a program that googles for "medical", downloads the first 100 hits, optionally replaces <.*> with a space, and runs your program on that.

  • Where can I find the backup files in iTunes for my iPhone, I want a copy

    Where can I find the backup files in iTunes for my iPhone, I want to copy the backup files for all app's and phone numbers, I'm using Windows XP
    I just need to know where its hiding, a link that shows an address where would sure help

    First you'll need to make sure your XP is set up to view hidden files and folders.
    1. Open My Computer from the desktop or Start menu.
    2. In the Tools menu, click Folder Options.
    3. Click the View tab.
    4. In the "Advanced settings" pane under "Hidden files and folders" make sure that the "Show hidden files and folders" option is selected.
    5. Click OK.
    Now you should be able to track down your backup file at the location in the following document:
    [iTunes: "Backup could not be saved on the computer" alert message|http://support.apple.com/kb/TS2529]

Maybe you are looking for

  • I can't drag and drop files...

    Hello!      Out of nowhere, I can no longer drag and drop files on my desktop or within my Finder windows.  I also cannot drag pictures from Safari onto my Desktop.  I do not think there is a problem with my Trackpad as I can still move Safari window

  • Building dynamic URLS in jsp

    Hello, I wonder if you could help , please. I have prepared a JSP page which has three different combo boxes. Depending on the option chosen , I have to submit the form to an html page that it is located in a different server. So I have to make the u

  • Error during the Installation of WAS 6.40

    i got the following error while i tried to install WAS 6.40 on a machine. My database is Oracle OraHome81. I finished installing the Central Instance Installation(ABAP). I incurred this Problem during the Database Instance Installation(ABAP stack). <

  • GC Logs do not log to the specified file

    Hi, I am facing a wierd problem while logging GC Logs to a log file. The Command line I use is this - -Xloggc:D:\gc_logs\gc_logs-%date:~4,2%%date:~7,2%%date:~10,4%-%time:~0,2%-%time:~3,2%-%time:~6,2%.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -ve

  • I want to run my itunes from my EHD and remove my music from my computer... How can i make this work?

    So i already tranferd my itunes library to my seagate freeagent EHD, and i  want to remove all my music from my laptop to free up space. How can i have all my music show up on my itunes when i plug in my EHD?