Title: RE: how to access config file from an ear in weblogic 7 ..0

Other solution : would be to package xml file in a jar file
and access it via :

MyClass.class.getResourceAsStream("/com/something/common/config/config.xml")

May it helps you !

S�bastien Boutt�

-----Message d'origine-----
De : Ihar Makushynski [mailto:[EMAIL PROTECTED]]
Envoy� : vendredi 13 septembre 2002 11:27
� : [EMAIL PROTECTED]
Objet : Re: how to access config file from an ear in weblogic 7 .0


Can you store your information in the plain format?
In this case you can do it in 2 ways:

1. your_props.properties file. You can create this file (parameter=value)
and add into any directory that is included into classpath. Then you can
retrieve it in Java by:
PropertyResourceBundle configBundle =
(PropertyResourceBundle)PropertyResourceBundle.getBundle("your_props");
String param1 = configBundle.getString("param1");

2. <env-entry> tag:
<!--
This element contains a single environment property.
The property is only accessible from the Init.
-->
<env-entry>
<description>
Description of the parameter.
</description>
<!--
The JNDI location that Init uses to look up
the environment property.
-->
<env-entry-name>Init/myParam</env-entry-name>
<!-- The type for this environment property -->
<env-entry-type>java.lang.String</env-entry-type>
<!-- The environment property value -->
<env-entry-value>myValue</env-entry-value>
</env-entry>

In Java:
Context ctx = new InitialContext();
String myParam = (String) ctx.lookup("java:comp/env/Init/myParam");




To all: Is variant 1 correct from the EJB specification point of view?

Igor.


-----Original Message-----
From: Vikram Naik [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 13, 2002 7:07 AM
To: [EMAIL PROTECTED]
Subject: [EJB-INT] how to access config file from an ear in weblogic 7.0


Hello,

        We are having problems accessing  configuration file (which is in
xml
format) from an ear in weblogic 7.0.
We store configuration for datasource , jndi names  and necessary mapping in
this file.

Please guide me through.

TIA
Vikram Naik

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".



Ce message est prot�g� par les r�gles relatives au secret des correspondances ; il peut en outre contenir des informations � caract�re confidentiel ou prot�g�es par diff�rentes r�gles et notamment le secret des affaires ; il est �tabli � destination exclusive de son destinataire. Toute divulgation, utilisation, diffusion ou reproduction (totale ou partielle) de ce message, ou des informations qu'il contient, doit �tre pr�alablement autoris�e Tout message �lectronique est susceptible d'alt�ration et son int�grit� ne peut �tre assur�e. WFinance et WFinance Conseil d�clinent toute responsabilit� au titre de ce message s'il a �t� modifi� ou falsifi�. Si vous n'�tes pas destinataire de ce message, merci de le d�truire imm�diatement et d'avertir l'exp�diteur de l'erreur de distribution et de la destruction du message.

This message is protected by the secrecy of correspondence rules ; furthermore it may contain privileged or confidential information that is protected by law, notably by the secrecy of business relations rule ; it is intended solely for the attention of the addressee . Any disclosure, use, dissemination or reproduction (either whole or partial) of this message or the information contained herein is strictly prohibited without prior consent. Any electronic message is susceptible to alteration and its integrity can not be assured. WFinance and WFinance Conseil declines any responsibility for this message in the event of alteration or falsification.. If you are not the intended recipient, please destroy it immediately and notify the sender of the wrong delivery and the mail deletion.


Reply via email to