.war file vs properties 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
          

Similar Messages

  • EAR file and properties file

    Hello,
    I am wondering if an application (java classes for instance) can read a .properties file inside the ear package, when the application is deployed ?
    (only reading of course)
    Thank you

    I'd recommend using ClassLoader.getResourceAsStream to access the properties file.
    This means the file needs to be in the resource path of your classloader. In WLS, an easy way to do this is to have it in the APP-INF/classes directory of your EAR file.
    -- Rob
    WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • Jar file and properties file

    Hi all,
    I have a jar file packaged as com.company.java located in $JAVA_HOME/jre/lib/ext. It will read a properties file when it is initialized. As I know, properties file needed to put under $CLASS_PATH. So I put it under $JAVA_HOME/jre/lib/ext also. However, the JAR file failed to load the properties file.
    Below is a part that in JAR file for getting properties file.
    ResourceBundle rb = ResourceBundle.getBundle("abc",Locale.getDefault());
    s=rb.getString("key1");
    } catch (MissingResourceException e) {
    s=null;
    e.printStackTrace();
    Do I put the properties file in wrong location?
    Where do I put it to make it work?
    Rgds,
    unplug

    by default you have 3 class loaders that load classes as well as read resources:
    The bootstrap classloader (for the core classes)
    The extension class loader (finds anything in any .JAR placed in $JAVA_HOME/jre/lib/ext/ [which is the home directory for "extension modules"])
    And the system class loader (looks along the classpath, finds files inside JARs [listed in the classpath] and in normal subdirectory structures [of base directories listed in the classpath] that mirror the hierarchy of Java packages)
    Any of these is supposed to consult the previous loader on the above list first, and try a lookup on its own only if the previous loaders did not find a class.
    ResourceBundle.getBundle(String, Locale) uses the classloader of its caller to look for the properties. If your method calling getBundle() was called from another method inside your extension module it will first consult the extension classloader (which first consults the bootstrap classloader) and will not be able to use the system classloader. So you can place anything in the classpath but it won't help. And the extension class loader can only look into JARs, not plain package directories.
    If the getBundle() method were called directly from the application code, however, it will use the system class loader to locate the properties file.
    There is a method ResourceBundle.getBundle(String, Locale, ClassLoader) where you can pass in e.g. the system class loader if you know how to get it, so this might help. The application code would determine its own class loader and pass it to the method of your your extension module.
    But I am not sure that you should place the properties file in $JAVA_HOME/jre/lib/ext/ since this is intended for Java extensions rather than normal user code, it normally does not show up on the classpath. Also, if you place it along the classpath, you have to pass in the classloader to be used since your code was loaded by the extension classloader and has no immediate knowledge of the system classloader.
    But perhaps it would be wiser to load your resource bundle reader in the system classloader, like any other application code: Remember that classes loaded by the extension classloader have higher security privileges than normal application code (the security policy file that you can edit refers to application code!) and it is questionable whether a resource bundle reader needs that privileges. If it does not, you might just place it in the classpath rather than the extension directory. Then it is quite natural that a properties file will also be found on the classpath.

  • WAR file and Properties file

    Hey guys,
    I have a WAR file( for my web application) . Its basically a Struts application running on weblogic7.0 server There is a MyXXX.Propeties file in web-inf/classes folder and when i run the application the property file is not recognized( unable to read it) i get something like this
    ???en_US.label.xxx???
    Do i need to set some classpath for the server ?
    Regards,
    KM

    Any answer ??

  • "The system cannot find the file specified" - error reading properties file

    I have packaged a class file and a .properties file in the same folder as a ejb-jar file and in the class file i try reading the properties file and it throws me the error - "The system cannot find the file specified". But when I put the complete path, it has no problem finding the file.
    I know that this must be the problem with classpath, but can anybody tell me why it is not finding the properties file even if they are in the same folder. How do I make class files find .properties file which are in a folder.
    Any help will be greatly appreciated.

    Hi,
    I am not sure if your question is realted to the Oracle Application Server - anyway, if you are packaging a class file and a properties file in a JAR File, you need to read the contents in a different manner...something like this... :
    URL url = new URL("jar:file:/home/duke/duke.jar!/");
    JarURLConnection jarConnection = (JarURLConnection)url.openConnection();
    You might want to have a look at this link for more information :
    http://java.sun.com/docs/books/tutorial/index.html
    You may also get better responses if you post your question in one of the Java Forums.
    Regards,
    Sandeep

  • Retreive contents of "*.properties" file loaded into jvm in oracle 10.2.0.1

    Hi,
    I have a 10g database with a few jars loaded. One of the files, a .properties file is required to be changed. Whilst I understand how to use loadjava and dropjava, I would like to retrieve the "*.properties" file that is currenly installed in the db.
    Any thoughts on how to do this would be much appreciated....
    regards
    Sc0tt...

    Scott,
    As far as I know, when loading JAR files into the Oracle database, the files contained in the JAR are extracted and stored separately. Hence you should be able to drop and load only your desired properties file. The following query may help verify this:
    (Assuming the properties file is in the schema of the current user.)
    select *
      from USER_OBJECTS
    where DBMS_JAVA.LONGNAME(OBJECT_NAME) = 'name of your properties file'Good Luck,
    Avi.

  • JSF properties file

    Using JSF and JSTL, i am trying to use a properties file, to import an xml file.
    PROPERTIES FILE:
    name > messages.properties
    content > url=/home/index.xml
    JSP FILE:
    <f:loadBundle basename="jsfks.bundle.messages" var="msg"/>
    <h:outputText value="#{msg.url}"/>
    <c:import url="#{msg.url}" var="xmlSource" />
    <x:parse xml="${xmlSource}" var="xmlDocument" />
    The outputText works, it does display my URL, but the c:import dont work.
    I want to value that is in my properties file, to be imported i.e
    <c:import url="/home/index.xml" var="xmlSource" />
    how can i do this using the above method?
    Thanks

    Like I said here http://forum.java.sun.com/thread.jspa?threadID=5175073
    Your approach won't work as the value is completely out of the scope.
    Load it manually in the same scope, using java.util.ResourceBundle for example.

  • How to Add JAR files and Config files to CLASSPATH at runtime?

    QUERY:
    During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.
    Please advise me any relevant Java API details or a sample java program to implement the above use case.
    Thanks in advance.

    During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.
    Please advise me any relevant Java API details or a sample java program to implement the above use case.
    You don't add to YOUR classpath once your app is launched.
    You create a NEW process for the app you want to run and provide the proper environment for it to run in - including any PATH or CLASSPATH environment variables.
    The Java API for the ProcessBuilder class has a simple example that shows how to create the arguments and launch an external application.
    ProcessBuilder (Java Platform SE 7 )
    There are also PLENTY of other examples of using ProcessBuilder; just search the net.

  • 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
              

  • Deploying properties files outside of the web application in WebLogic 8.1

    Hi
              I am wondering if it is possible to deploy a web application and place configuration files (properties files, log4j xml files etc...) in a folder somewhere within WebLogic that is on the Server instance classpath. This would allow me to edit the config files and restart the server without having to hack into the web application .war file and then redeploy.
              I am really looking for an equivalent of the /applib folder in Oracle 10gAS (each OC4J server instance has an /applib folder which is on the classpath of the server).
              Is there an equivalent for a weblogic server instance?? (i.e. not just for the entire weblogic server but for individual sever instances).
              thanks
              Will

    WLS 9.2 includes pretty advanced features in this area. Both deployment plans and application libraries could be used. There's also a domain/lib directory where jar files can be placed and are visible throughout the server instance.
              Unfortunately 8.1 has none of these features. In 8.1, your choices are to either add these into the $CLASSPATH, or package them in the application.
              -- Rob
              WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • Weblogic Classpath setting error not able to pick the properties file

    Hi All,
    We are using a third party jar and create a java Web service on the top of that jar. This jar file need two configuration file .properties and .xml when we deploy war for the application into weblogic server it will give file not found error. Though this file already exists inside the .war but from the application it is not able to pick the files.
    We find that these file need to be put in weblogic domain home and we put it there and application works.
    I decompile the jar and found that inside java class they use FileReader("allXXX.xml") path and when I Google it and found that it will pick the file from weblogic domain directory.
    The issue is that we need to put properties file in specific weblogic folder like /3party/config by setting the class path inside startWebLogic.cmd. Please let us know solution for same
    Thanks in advance
    Edited by: sb**** on Mar 19, 2012 9:08 AM

    Hi , I am also facing the similer issue. I am deploying war file of my Spring MVC application , but its not picking resource bundle .properties files from one of the configuration file.
    <bean id="PropertiesRepository"
              class="LanguageBasedPropertiesRepository">
              <property name="propertiesFiles">
                   <map>
                        <entry key="en" value="classpath:/exceptionMessages.properties" />
                        <entry key="es" value="classpath:/exceptionMessages_es.properties" />
                        <entry key="default" value="classpath:/exceptionMessages.properties" />
                   </map>
              </property>
         </bean>
    Please let me know how we can modify this to make it work.
    thanks .

  • How to load Java properties file dynamically using weblogic server

    Hi,
    We are using Java properties file in Java code. Properties in java properties file are frequently modified. If I keep these properties file in project classpath or as part of war, I will have to redeploy application after each change.
    We are using Weblogic Server.
    Can you please suggest me how can this properties file be loaded at weblogic server startup. Then in that case, how to refer property file in Java code?
    What is the best practice for this?
    Thanks,
    Parshant

    Another alternative is, keep the property file in any pre-defined location. Write a class which reads the properties from the file and returns the one which is requested by caller and deploy this class. Whenever you have to change the properties just update the property file on server and next call to fetch the property should return the updated one.
    Downside of this approach is file I/O everytime. To overcome that you can actually "cache" the properties in a hashmap. Basically when any property if requested, first check the hashmap, if not found then only read from property file and also update in hash map. Next time same property will be returned from hash map itself. The hash map will be cleared at every server restart since its in the memory. You will also need to build a method to clear the hashmap when you update the values in the property file on server.
    This solution would be suitable for small size files and when network overhead of calling a DB needs to be avoided.

  • War file and access control with WebLogic

    I am trying to put some access control on different files in my war-file, but just can't get it to work... It seems like all roles defined in weblogic.properties gives the user access to all files in the war. I just don't understand the connections between the security realm, the weblogicURL.policy file and the web.xml file... If I do not specify a weblogic.security.URLAclFile, no access control is done at all.
    This is how my weblogic.properties file looks like:
    weblogic.security.URLAclFile=e:\\weblogic\\weblogicURL.policy
    weblogic.password.koko=kokokoko
    weblogic.password.arnebelinda=arne1234
    weblogic.security.group.ppuseradmins=arnebelinda
    and my weblogicURL.policy:
    deny Principal weblogic.security.acl.GroupImpl "everyone" {
    Permission weblogic.security.acl.URLAcl "weblogic.url", "/admin/-";
    and finally, my web.xml-file:
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
         <session-config>
              <session-timeout>30</session-timeout>
         </session-config>
         <welcome-file-list>
              <welcome-file>index.jsp</welcome-file>
         </welcome-file-list>
         <security-constraint>
              <web-resource-collection>
                   <web-resource-name>admin</web-resource-name>
                   <url-pattern>index.jsp</url-pattern>          </web-resource-collection>
              <auth-constraint>
                   <role-name>ppuseradmins</role-name>
              </auth-constraint>
         </security-constraint>
         <login-config>
              <auth-method>BASIC</auth-method>
              <realm-name>WebLogic Server</realm-name>
         </login-config>
         <security-role>
              <role-name>ppuseradmins</role-name>
         </security-role>
    </web-app>
    it does not matter which user is part of the ppuseradmins group. The user koko is not a member, but is given access to my whole .war anyway (after submitting correct username/password). Omitting the <realm-name> does not seem to work either; the default realm is not used, instead null is used.
    Does anybody have a clue? I would really appreciate it!
    I am using WebLogic 5.1 sp 9
    best regards,
    PJ

    In you pocily file entry, you have specified "/admin/-"
    However, in the <security-constraint> element in web.xml, your <url-pattern> is not set to /admin
    Could that be the problem ?

  • How can configure .properties file and  log4j on weblogic 8.1 SP5

    Hi,
    I know this is not right forum for post this question.But I hope I'll get my perfect answer here.
    I have 2 questions.
    1. Where I'll keep my .properties file in weblogic 8.1 SP 5. means I have one own .properties file which is contains some proxy settings and this .properties resides on .war file(now), But I want move this propeties file outside .war file. So Where I'll keep in weblogic 8.1 SP 5.
    2. How can we configure log4j in weblogic?
    Please reply me.
    Regards,
    Pattanaik

    You can add your.properties and log4j.properties to the classpath cant you?
    You just need to edit setEnv.cmd (if i remember correctly) in your weblogic server folder to add the folder containing the properties files to the classpath variable.

  • Weblogic 6.0 install on unix:: conversion of properties file.

    I followed the instructions to convert my weblogic properties file from a WL5.1
    install. Copied the *.war file from the default domain into the new domain and
    tried to start the application server with the script for the domain. It asks
    for a boot password which I am assuming should be the same one that I set during
    the weblogic install. When I enter the password, it refuses to boot the application
    server complaining about the password. Yet when I try to start the default server,
    it boots up
    fine with the same password. Now my question is, it the password
    the same or not? If not then what is the boot password for the
    new domain and where is it set?
    Any help will be appreciated
    Thanks,
    Hemant

    "Hemant Varma" <[email protected]> wrote:
    >
    I followed the instructions to convert my weblogic properties file from
    a WL5.1
    install. Copied the *.war file from the default domain into the new domain
    and
    tried to start the application server with the script for the domain.
    It asks
    for a boot password which I am assuming should be the same one that I
    set during
    the weblogic install. When I enter the password, it refuses to boot the
    application
    server complaining about the password. Yet when I try to start the default
    server,
    it boots up
    fine with the same password. Now my question is, it the password
    the same or not? If not then what is the boot password for the
    new domain and where is it set?
    Any help will be appreciated
    Thanks,
    Hemant
    Sorry for my english. I am french
    The user/password is coming from your properties file that you
    have converted

Maybe you are looking for

  • KeyPressed / collision detection

    I have a tile based platformer I am making and am having some trouble with the collision detection. I have it so that the game detects a collision before it actually occurs so that it wont happen in the game. However, it only appears to works right i

  • What is the impact of field status in Field Status Group

    Hi, In MIR7, we want to make Cost Center Mandatory. For this we found the option of "Field Status Varient".  We are using "Z004" Field status group in G/L account. In this FSG, we want to change the status of field "Cost Center" as mandatory from Opt

  • Computer sleeps when iTune library is shared

    Hello: Running a G5 and PowerBook on Airport Extreme Wireless network. I use the G5 to make all my iTunes Store purchases and often like to share the library with the PowerBook so I can listen to tunes in the other room. The G5, however, will go to s

  • Help pls! iPod hangs

    I was trying to jailbreak my ipod ( i know i should not do it ) and it was going smooth but it suddenly hanged on a black screen with no apple logo. My home button is also broken. I triedplugging it in into my computer but itunes wont recognise it pl

  • Updating or changing the outbound delivery

    Hi we have created a outbound delivery in the system, I want to update some of the detials like route, no of packages using a program. is there any FM or BAPI for that. I have tried using the  BAPI_OUTB_DELIVERY_CHANGE to update the route in the deli