Property (config) files inside an EAR

I would like to deploy the configuration files for my application inside an EAR
file so I do not have to modify the classpath for my server (WLS 8.1 sp2).
My quesion is can I make all the property files available to all the EAR components
(WAR and JAR) by putting them somewhere in the EAR or do they need to be on the
class path?

They don't need to be in the classpath.
If you're on 8.1, then placing the properties file in the
APP-INF/classes directory would make it accessible for anything in the
EAR. I'd probably use an ApplicationLifecycleListener to read it when
the app deployed.
If you're using < 8.1, I'd use either a ServletContextListener or a
load-on-startup servlet in a "fake" webapp to read the file.
Let me know if you need more details.
-- Rob
Pete wrote:
I would like to deploy the configuration files for my application inside an EAR
file so I do not have to modify the classpath for my server (WLS 8.1 sp2).
My quesion is can I make all the property files available to all the EAR components
(WAR and JAR) by putting them somewhere in the EAR or do they need to be on the
class path?

Similar Messages

  • Specify a property file inside a ear file

    Hi guys I have this myApplication.ear file.
    All the project inside the ear file are using myProperties.properties file.
    I have been told that this property file has to be inside the ear file.In websphere 7.0 ,the administrator will specify a jvm classpath like /webAS/installedApps/myApplication.ear/myProperties.properties.During runtime my code will find the property file using this class path
    I am using RAD 7.5 to generate the ear file.Can some one tell me how to achieve this.Basically my ear file has to be bundled with the property file.
    thanks
    m

    You might get better results from a RAD forum if you a havent already figured out your issue.

  • Session sharing among multiple WAR files inside an EAR file

    Hi all,
    Is there a way where I can share my session object among multiple WAR files which are inside an EAR file?
    Please suggest.

    r035198x wrote:
    Some application servers (like Weblogic) allow to configure session sharing when you deploy the application.Sidenote: which is completely against the servlet spec.

  • ClassNotFoundException trying to load classes in a .war file inside an .ear file

    Hi. I've deployed an EJB2 enterprise app as an ear file on WebLogic 6
              without errors. The ear file contains web app and ejb components in war and
              jar files. The web component is set to be the default web app in the
              config.xml file. Everything deploys without error messages.
              My problem is that I get ClassNotFoundExceptions when I try to invoke a
              servlet (via its servlet-mapping) or do Class.forName() on any class file in
              the war file.
              I see in '.wl_temp_do_not_delete' that the ear file has been decomposed into
              the ejb jar and web war files. The war file is not 'exploded' into a
              directory structure, however (as the console.war is). Is this an error
              (should the class packages in the war file be 'exploded'?)
              I don't see a tag in the web.xml, config.xml, or application.xml that tells
              the server to explode the war file--is there one?
              Note that if I manually copy the exploded class folders into the
              '_tmp_war_myserver_myserver_<<webappname>>' directory (and not, curiously,
              into a WEB-INF/classes subdirectory of that directory), the servlets and
              other classes load correctly. Also, jsps and html files load just fine
              without exploding the war file.
              Note also that the server complains about not being able to find the
              classes, even though it reports that the decomposed war file is in the
              classpath. Is there a problem loading class files from a .war file (because
              the namespace is different, with root classes located in WEB-INF/classes
              rather than the .war file's root?)
              Also, in the application.xml file, what is the meaning of the
              <context-root></context-root> element? What should its value be? What if
              you leave it blank?
              Thanks for any help,
              Reid
              

    Is there a way to add jar libraries to the Oracle JVM CLASSPATH? Is this the same as the system's CLASSPATH env. variable?
    Thank you!
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Alex McClennan ([email protected]):
    The package prefix in the code extract was correct - i.e. "oracle.aurora.jndi". A value of "oracle.aurora.jndi.*" would be incorrect.
    The problem is that the context factory implementation specified (com.evermind.server.ApplicationClientInitialContextFactory
    ) can't be found, the mostly likely reason being that the library containing the class isn't on the classpath.
    Cheers,
    ax<HR></BLOCKQUOTE>
    null

  • Can I place jar files inside ejb-jar.jar?

    Hi,
    I'm reading about the packaging rules for creating an ejb-jar.jar file, and I'm wondering whether it's possible to include a jar file (containing helper classes) inside of the ejb-jar file. A "lib" dir (for containing such helper jars) doesn't seem to be part of the ejb-jar file format.
    The EJB 3 spec has this to say (Ch 20, "Enterprise JavaBeans 3.0, Final Release):
    "The ejb-jar file must also contain, either by inclusion or by reference, the class files for all the classes and interfaces that each enterprise bean class and the home interfaces, component interfaces, and/or web service endpoints depend on, except Java EE and J2SE classes. This includes their superclasses and superinterfaces, dependent classes, and the classes and interfaces used as method parameters, results, and exceptions"
    Now, it seems that the root of the the ejb-jar file contains all the classes (in the appropriate Java package layout). But what about including JAR files? The ejb-jar spec seems to have nothing to say about a "lib" dir that can contain jars (as a WAR file can).
    Summary of questions:
    1) Can an ejb-jar file contain a jar file? If so, how/where?
    2) Can the ejb-jar file's META-INF/MANIFEST.MF file contain a reference to a JAR file?
    I'm not considering correct design at the point... I'd just like to know if these 2 scenarios are possible.
    Thank you!
    kamuifx

    Yes, I have an ear file..................
    I have an EAR file; inside the EAR I have a WAR file (web module) and an EJB-jar file (EJB module).......... the EJB need some classes placed in a jar file (a helper .jar or an util .jar)...........
    my question is: How can I use the classes of the .jar files in te EJB??????
    thanks

  • Changing values in property file inside a jar in an ear

    Hi,
    I have an application that contains EJB. The environment values needed for initial context of the ejb is kept in a .properties file. I have created an ear of the application. Inside the ear there is a jar which contains the .properties file. I need to deploy the ear to different environments. However before deploying I need some kind of script to change the values in the .properties file inside the jar in the ear.
    Can anyone provide some help/pointers about how can I achieve it (Using ANT/WLST)

    WLST does not have any capability to update a JAR.
    WLS 10.3 (still in tech preview) has the ability to override properties
    files inside the jar with an external properties file. This would allow you
    to deploy the same ear to different environments, and then only deploy a
    different properties file in the plan directory.
    <Rishi Shah> wrote in message news:[email protected]..
    Hi,
    I have an application that contains EJB. The environment values needed for
    initial context of the ejb is kept in a .properties file. I have created an
    ear of the application. Inside the ear there is a jar which contains the
    .properties file. I need to deploy the ear to different environments.
    However before deploying I need some kind of script to change the values in
    the .properties file inside the jar in the ear.
    Can anyone provide some help/pointers about how can I achieve it (Using
    ANT/WLST)

  • Unable to load classes from jar files inside APP-INF/lib in EAR.

    Weblogic version: 10.3.3
    Platform: Linux x86-64 bit
    We deployed an ear packaged with all the common library jars inside APP-INF/lib. Deployment was successful.
    for some reason, it is always giving ClassNotFoundException for the classes inside the jars. This does not happen
    in 10.3.2 version of weblogic.
    We tried to add them to domain/lib directory (instead of APP-INF/lib) but still it is not able to resolve the classes.
    Any pointers would be appreciated.

    try using prefer-web-inf-classes in the weblogic.xml file in your WAR file
    or using prefer-application-packages in the weblogic-application.xml file in your EAR.

  • Can any one suggest me how can I use relative path inside SSIS pacakge to access config file ?

    Can any one suggest me how can I use relative path inside SSIS pacakge to access config file ? Please help me as its urgent.THanks for your help in advance.

    Hi Jay,
    SSIS can only recognize the absolute path of a XML Configuration file, the relative path is not supported. Furthermore, if the XML Configuration file is already generated, we can use the Environment variable package configuration type instead so that
    SSIS runtime automatically looks for the configuration file from the path defined in the environment variable. This is convenient when we need to deploy a package to different environment. We only need to define the environment variable for package configurations
    once on each server, and then the variable can be used by all the packages on this server.
    Regards,
    Mike Yin
    TechNet Community Support

  • Java files from a EAR file and from inner (inside EAR)

    I want to read all Java files from a EAR file and from inner (inside EAR) EAR or WAR file with out unpacking.
    suppose "Demo.ear" contaions the following files:
    abc.java
    programs / a.java
    programs / b.java
    src / index.java
    src / com / myFolder / main.java
    src.war
    and suppose "src.war" again contains some java files inside differenet folders.
    The main problem is that i can read all java files from "Demo.ear" but unable to reading from "src.war" b'coz my program is using JarFile class constructor which needs a archive file path, So only top level archive having the path but not the inner archives.
    So, pls help me out to this problems
    Thanks in advance

    Firstly Sorry to writing long letter. but i was unable to express my problem.
    see my code==============================
    JarFile jarFile = new JarFile("Demo.ear");
    Enumeration e=jarFile.entries();
    while (e.hasMoreElements())
    JarEntry entry=(JarEntry)e.nextElement();
    if (entry.getName().endsWith(".war"))
    // Then what Next to do...........
    ===========================================
    you have mentioned "theFile" , What is this?...............
    InputStream in = theFile.getInputStream(theEntryOfTheWAR);
    This line is not a compatible type casting in Java..........
    ZipOutputStream theWar = new ZipInputStream(in);

  • Changing faces-config.xml after deploying ear file

    Hi,
    What would be the steps to follow if we want to change contenets of web application configuration files (for example, faces-config.xml) after app.ear file has been deployed?
    The app.ear file contains the faces-config.xml, and we are using Oracle AS 10.1.3.
    Thanks,
    Jean

    see my answer at
    Change web app config file of deployed app

  • Is there will be any impact on chaging below property in config file

    Hi,
    I need one help on RequestValidation property in config file.
    I have Changed property in config file RequestValidation=”true” from RequestValidation=”false” .Please let us know is there is any impact on changing this property.If there is an impact then how it needs to be tested and what areas will be impacted.
    I am thinking this would only restrict the scirpts not being submitted to page.
    Please help me in this.
     Thanks,
    Vijay.

    Hi Vijay,
    Welcome to MSDN forum.
    Your issue is out of support range of VS General Question forum which mainly discusses
    the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    Because the RequestValidation property is related to ASP.NET, I suggest that you can consult your issue on ASP.NET forum:
    http://forums.asp.net/
     for better solution and support.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Using Custom Config Files with WinForms

    I have created a new .config file for my application called "MyConfigFile.config" but I do not know how to reference, read or update it. Should I treat it as any other generic XML file?
    Rob E.

    The configuration file should be in the same directory as the application. The name of the configuration file should have the same name as the application with .config at the end. For example, an application called Watcher.exe should have
    a configuration file called Watcher.exe.config.
    To access the appSettings values from inside the program, use the AppSetting property of the ConfigurationSettings class.
    string title = System.Configuration.ConfigurationSettings.AppSettings["Title"];
    Two things should be kept in mind when accessing appSettings from the configuration file.One, the AppSetting could be null. Two, the AppSetting property always returns a string.When getting values from the configuration file, the code needs
    to handle these situations.
    One way to approach this is as follows:
    int AppSetValueMax = 0;
    if (ConfigurationSettings.AppSettings[key] != null)
    try
    AppSetValueMax = Convert.ToInt32(ConfigurationSettings.AppSettings["Max"]);
    catch(Exception e)
    //Exception Handling

  • Referencing a jar inside an ear

    Hi,
    I have a program where I need to get a reference to a jar inside an ear
    file. For example, I have this variable set:
    $WL_HOME/config/mydomain/applications/test.ear and I want to set a variable
    for a jar inside this ear.
    Does anyone know the best way to do that?
    Thanks

    When you say "set a variable", do you mean read an XML or properties file
    and modify it and write it back?
    It is relatively simple using the java.util.zip / java.util.jar packages.
    Editing XML is a little harder; I would suggest relying on something like
    JDOM or the libs from The Mind Electric.
    Peace,
    Cameron Purdy
    Tangosol Inc.
    Tangosol Coherence: Clustered Coherent Cache for J2EE
    Information at http://www.tangosol.com/
    "Diane Curley" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I have a program where I need to get a reference to a jar inside an ear
    file. For example, I have this variable set:
    $WL_HOME/config/mydomain/applications/test.ear and I want to set avariable
    for a jar inside this ear.
    Does anyone know the best way to do that?
    Thanks

  • Startup class not found if included in a jar inside the ear

    I have written a startup class, i have packed it in a jar file(along with some
    other classes). This jar is then packed in side an ear file.(This way i get one
    single distribution file). I have added the startup class in the config.xml using
    weblogic console.But at start up weblogic is unable to find the class. How to
    tell weblogic about the location of the class(classpath) which is inside the ear
    file. Error i get is as follows
    <Aug 21, 2003 8:07:23 PM IST> <Emergency> <WebLogicServer> <BEA-000342> <Unable
    to initialize the server: weblogic.t3. srvr.FatalStartupException: Can't start
    server due to startup class failure WISORCODES_SERVER - with nested exception:
    [java.lang.ClassNotFoundException: com.wisor.common.wisorcodes.rmi.WisorCodesServer]>
    *************************************************************************** The
    WebLogic Server did not start up properly. Exception raised: 'weblogic.t3.srvr.FatalStartupException:
    Can't start server due to startup class failure WISORCODES_ SERVER - with nested
    exception: [java.lang.ClassNotFoundException: com.wisor.common.wisorcodes.rmi.WisorCodesServer]'
    Reason: weblogic.t3.srvr.FatalStartupException: Can't start server due to startup
    class failure WISORCODES_SERVER - wi th nested exception: [java.lang.ClassNotFoundException:
    com.wisor.common.wisorcodes.rmi.WisorCodesServer] ***************************************************************************

    Shirish:
    Classes that are scoped in the application are only visible within the
    application, not to the system classloader.
    If you want to have startup classses scoped inside an EAR then you need to
    use Application lifecycle listeners to actually activate these startup
    classes. Application lifecycle listeners are a replacement for startup
    classes.
    You can check out an example of this in 8.1:
    $BEA_HOME/weblogic81/samples/server/examples/src/examples/splitdir/helloWorl
    dEar
    Docs for it are:
    $BEA_HOME\weblogic81\samples\server\examples\src\examples\splitdir\helloWorl
    dEar\javadoc\index.html
    Check out:
    $BEA_HOME\weblogic81\samples\server\examples\src\examples\splitdir\helloWorl
    dEar\META-INF\weblogic-applcation.xml
    <weblogic-application>
    <listener>
    <listener-class>examples.splitdir.hello.startup.ApplicationStartup</listener
    -class>
    </listener>
    </weblogic-application>
    and
    $BEA_HOME\weblogic81\samples\server\examples\src\examples\splitdir\helloWorl
    dEar
    /appStartup/examples/splitdir/hello/startup/ApplicationStartup.java
    Now if you have a "startup class" that needs to be accessible for the entire
    Server for a set of applications, I suggest just writing a single EAR with a
    dummy web-app (I think you may need a dummy module) and an applicaiton
    lifecycle listener, and have this EAR deploy before any other apps.
    Cheers
    mbg
    "Shirish" <[email protected]> wrote in message
    news:[email protected]...
    >
    I have written a startup class, i have packed it in a jar file(along withsome
    other classes). This jar is then packed in side an ear file.(This way iget one
    single distribution file). I have added the startup class in theconfig.xml using
    weblogic console.But at start up weblogic is unable to find the class. Howto
    tell weblogic about the location of the class(classpath) which is insidethe ear
    file. Error i get is as follows
    <Aug 21, 2003 8:07:23 PM IST> <Emergency> <WebLogicServer> <BEA-000342><Unable
    to initialize the server: weblogic.t3. srvr.FatalStartupException: Can'tstart
    server due to startup class failure WISORCODES_SERVER - with nestedexception:
    >
    >
    [java.lang.ClassNotFoundException:com.wisor.common.wisorcodes.rmi.WisorCodesServer]>
    >
    The
    WebLogic Server did not start up properly. Exception raised:'weblogic.t3.srvr.FatalStartupException:
    Can't start server due to startup class failure WISORCODES_ SERVER - withnested
    exception: [java.lang.ClassNotFoundException:com.wisor.common.wisorcodes.rmi.WisorCodesServer]'
    Reason: weblogic.t3.srvr.FatalStartupException: Can't start server due tostartup
    class failure WISORCODES_SERVER - wi th nested exception:[java.lang.ClassNotFoundException:
    com.wisor.common.wisorcodes.rmi.WisorCodesServer]***************************************************************************
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >

  • Jars files inside atglib folder

    HI Guys
    I am creating ear file in atg by using ant script ,inside ear file i found atglib files with some jar files different files
    from where it is picking those jar files inside atglib folder
    please give me clear picture on this

    HI David,
    Will it follow config path layering while build the ear file ?
    or do we need to provide explicitly each module to build?
    in my application i didnot find some ootb modules in build script but inside ear file those modules jar files are i am able to see
    how  it is possible ? is it because of config path layering?

Maybe you are looking for

  • How do I spread one image across 2 pages?

    How do I spread one image across 2 pages?

  • Account determination for entry CASI DIF not possible.

    Hi Friends, While doing Invoice (MIRO) against PO, I have encountered below error. IR Error: Account determination for entry CASI DIF not possible.  Please help to how to resolve. Warm regds, Raman,

  • Query regarding Idoc extention

    hi, when we do idoc extenstion , is there any restriction on number fields that the extention can have ? I have a problem I have extened and Idoc. when I create n inbound idoc for it thrgh test tool in r/3 by passing the fields that i have extened, i

  • ACS version 4.0 SE - HTTP 500 internal server error

    When I try to authenticate (by SSL/HTTPS) to my ACS v4.0 SE with IE6.0 browser, I get a HTTP 500 internal server error. I already tried to restart all services, reboot the ACS appliance and delete and reimport my certificates. What can I do more? I n

  • Limit the no. of PO items

    Folks, I would need to have maximum of 300 PO items in a PO during PReq conversion. The PO's are sent to an external system which cannot handle >300 items. Is there a possibility to make these settings in standard SAP? PO's are converted through ME59