Issue with [env-entry] element in web.xml

I know it's possible to define [env-entry] elements in web.xml for environment
properties of a web application. But how do you access [env-entry] elements from
classes that do not exist within a web application? In other words, this is my
problem:
I have an EAR file, enterprise.ear, which contains the following...
employee.jar
employeeSearchEJB.jar
webApp1.war
META-INF/
application.xml
The employee.jar file is a utility archive that contains common classes, one of
which is a class called LogManager. LogManager needs to read environment properties
in order to initialize itself. Currently, LogManager reads these properties from
a property file, and therefore it needs to know the name of the property file
in order to access it. I dont like this approach because I'm forced to hard-code
the name of the property file in LogManager. I would rather leverage the power
of J2EE deployment descriptors and use the [env-entry] element to define the environment
properties for the LogManager class. Then, I would simply use JNDI to get the
values of the [env-entry] elements without ever having to specify their location
aside from the default JNDI context; java:comp/env, which is standard anyway.
The problem I'm having is that you can define the [env-entry] element in only
2 types of deployment descriptors; namely, web.xml and ejb-jar.xml, neither of
which are available to LogManager because LogManager exists at the EAR root level.
I was hoping application.xml supported the [env-entry] element, but it doesn't.
Any suggestions?
SAF

SAF,
I am not sure if this applies to you situation but if you create an initial context
instance and then grab the value using the jndi name within that context then
you should be able to grab that environment variable.
I have a helper class that is used as part of a deployed application. The helper
class doesn't have access to the Servlet context but it is created as part of
the application workflow. When it gets initiated it grabs an env-entry created
in the web.xml deployment descriptor to find the default url for a content path.
After I create an initialContext, I perform a initContext.lookup("jndi.env.entry.here")
where "jndi.env.entry.here" is the name specified in the env-entry tag.
This returns the value of the entry.
This works under both Jrun and Weblogic so my guess is it should work for you.
Again, I am assuming that your class will at least be able to grab a context
object to communicate back to the server.
Hope this helps,
Troy
"SAF" <[email protected]> wrote:
>
I know it's possible to define [env-entry] elements in web.xml for environment
properties of a web application. But how do you access [env-entry] elements
from
classes that do not exist within a web application? In other words, this
is my
problem:
I have an EAR file, enterprise.ear, which contains the following...
employee.jar
employeeSearchEJB.jar
webApp1.war
META-INF/
application.xml
The employee.jar file is a utility archive that contains common classes,
one of
which is a class called LogManager. LogManager needs to read environment
properties
in order to initialize itself. Currently, LogManager reads these properties
from
a property file, and therefore it needs to know the name of the property
file
in order to access it. I dont like this approach because I'm forced to
hard-code
the name of the property file in LogManager. I would rather leverage
the power
of J2EE deployment descriptors and use the [env-entry] element to define
the environment
properties for the LogManager class. Then, I would simply use JNDI to
get the
values of the [env-entry] elements without ever having to specify their
location
aside from the default JNDI context; java:comp/env, which is standard
anyway.
The problem I'm having is that you can define the [env-entry] element
in only
2 types of deployment descriptors; namely, web.xml and ejb-jar.xml, neither
of
which are available to LogManager because LogManager exists at the EAR
root level.
I was hoping application.xml supported the [env-entry] element, but it
doesn't.
Any suggestions?
SAF

Similar Messages

  • Edit env-entry values from web.xml in the WLS console.

    Hi guys!
    Is it possible to define JNDI variables of type java.lang.String using WLS Console?
    Thanks

    I think this would require the use of a deployment plan, which you can learn about here: [http://e-docs.bea.com/wls/docs103/deployment/config.html] . This won't be as convenient as just editing the value directly in the admin console. In fact, it won't even prevent the requirement of redeploying the webapp. It will only allow you to make the change without rebuilding and repackaging the webapp.
    It's questionable whether it's practical or meaningful to change env-entry values in a web.xml without redeployment, because even if you could change the values without redeploying, you'd have to reinitialize the servlet/filter with the changed environment parameter.
    If you really need this dynamic reconfiguration ability, you might have to design the facility into your application, using some sort of polling or event handling capability.

  • When I open a new tab, an unwanted website opens instead of my desired home page. THIS IS ONLY AN ISSUE WITH NEW TABS; (opening the web browser AND clicking on the home button frings me to my desired home page.)

    When I open a new tab, an unwanted website opens instead of my desired home page. THIS IS ONLY AN ISSUE WITH NEW TABS; (opening the web browser AND clicking on the home button frings me to my desired home page.)
    I have attached the url of the unwanted site.

    Use this add-on [https://addons.mozilla.org/en-US/firefox/addon/custom-new-tab/ '''Custom new tab'''].

  • env-entry element in ejb-jar.xml

    I just started to create my ejb-jar.xml (deployment descriptor file) manually so
    that I won't depend on those generated by proprietary IDEs.
    The ejb-jar_2_0.dtd specifies that env-entry is used in
    entity, message-driven, and session elements.
    My question is - When do we use the element <env-entry>? Under what
    circumstances that ejb-jar_2_0.dtd necessitates its provision in the ejb-jar.xml
    in relation to entity, message-driven, and session elements?

    Hi,
    I've same prob here
    <env-entry>
    <env-entry-name>config.file.location</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>C:/bea/ITReportingConf.xml</env-entry-value>
    </env-entry>
    Right now config file is out side of my EAR, How can i put it within the EAR I tried with changing the
    <env-entry-value>/ITReportingConf.xml</env-entry-value> Value
    But i dont know which dir it is refering to and where should i put "ITReportingConf.xml" File
    Thanks

  • Problem with the data source and web.xml

    I have an issue where JSC is removing my resource reference:
    <resource-ref>
    <description>Creator generated DataSource Reference</description>
    <res-ref-name>jdbc/localOracleDatabase</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    from the web.xml and sun-web.xml.
    The application has been working great in the IDE for months then wham, no more data source definition. I try and add the reference manually and the IDE takes it out. I am "NOT" adding it to the .xml's in the build area. Why is JSC removing the data source entry?

    This continues to be a problem. The only way that I can get around the problem is to drag a table from the data source onto the design pallete and then the datasource is added back to the web.xml. I can run fine for 10 or 15 runs then the entry is once again removed from the web.xml.
    Help please!

  • Flex Table Add Row Issue with Dynamic Entry Lists in Visual Composer

    All,
    Your help would be kindly appreciated in resolving an 'Add Row'-issue within a Flex Table that uses Dynamic Entry Lists in Visual Composer. The issue here is as follows :
    When I use a [Local Dynamic Entry List |http://www.postyourimage.com/view_image.php?img_id=O5hrG2aMxWZ84Mu1211193041]to populate a row field, the initial row and all next rows are emptied upon 'insert row', they loose their selected values and also the entry list values ('pull-down menus') are lost. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=FPLr2cABcgiHRou1211192889].
    The initial row does [show the entry list values |http://www.postyourimage.com/view_image.php?img_id=2HybmEHAuQYs9cg1211192766]from the Local Dynamic Entry List based on the dynamically assigned input value; upon 'insert row' the entry lists are lost. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=FPLr2cABcgiHRou1211192889].
    When using a [Global Dynamic Entry List |http://www.postyourimage.com/view_image.php?img_id=m5p2KYuBb442dTq1211193501]to populate the row fields the Flex-table behaves normally as expected. Unfortunately with a Global Entry List it is not possible to dynamically assign a input value. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=U96V0zENCCyO3gA1211193157].
    Please also see the [issue summary image|http://www.postyourimage.com/view_image.php?img_id=06xti08tIEfely1211195178] I made to visualize the issue.  What I basically would like to know is whether this is a 'known issue' or not, or that it is an issue that can be fixed or whether there is an alternative workaround available ... I'm using Visual Composer 7.0 and the Portal is at SP 13.
    Many thanks,
    Freek

    Hi,
    you should be able to assign a dynamic value with global entry lists as well. If you say @myParam as dynamic value. VC will indicate in red letters, that the field @myParam is unknown. However, it will work, as long as @myParam is known in the form or table where you use the entry list.
    I have never heard of the problem that entry lists are emptied after "insert"-event.
    Kindes Regards,
    Benni

  • Issue with Variable Entry in BI 7.0

    Hi,
    I am having an issue with the variable entry in BI 7.0 Version. Here is a brief background.
    --- In BW 3.x, when we define a variable with <b>Single Value Option</b>, you can enter the value manually in the pop-up selection screen or select from the dropdown of possible values.
    ---But in 7.0 when i try to enter the value manually in the selection screen its opening the dropdown list, and is not giving me the option to enter a value manually. I am entering a valid single value in selection.
    Is this a bug or do i have to make any specific settings to correct my issue?

    When the selection screen pops up choose the KEY only function on the TOOLS on the top right corner of the screen. Then you will be able to enter the values manually.
    Hope this helps.

  • Query Reg env-entry in ejb jar xml

    Hi,
    I have the following tag in the ejb-jar of my application:
    <env-entry>
    <env-entry-name>postingDate</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>Request</env-entry-value>
    </env-entry>
    When a JNDI LookUp is done for this variable in the application, it doesn't pick up the value of the variable which is "Request" but it picks up the Value of the Posting Date.
    I need to know how this works!
    Just an Fyi, Posting Date is a date entered from the UI.

    I feel it is like declaring global and local variables with the same name and trying to access that variable.

  • Issue with opening pdf file from web browser

    I have Acrobat Pro ver 6 and Adobe Reader 9.1 on a computer.  when my user tries to open up a pdf from the web he is getting the following error message:
    "The Adobe Acrobat/Reader that is running can not be used to view PDF files in a WEb Browser.  Adbe Acrobat/Reader version 8 or 9 is required.  Please exit and try again."
    What also happens is that Acrobat Pro ver 6 opens up and nothing is there.
    I am not sure why he is getting that message since Reader 9.1 is installed.
    Can any one shed some light on this for me.
    This user needs to have Acrobat and Reader on his system.  I understand that there are issues with having both.
    Also he has it set up so that any PDF is opening using the Reader 9.1.
    Thanks,

    Your PC's default reader configuration for embedded PDFs has become confused, due to multiple Adobe PDF document solutions installed on one PC.
    Solution 1:
    Go to Start > Run
    Type regedit and click OK.
    Browse to the following key: HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe
    Make sure that the correct Default data value is set for the path where Adobe Reader or Acrobat are installed.
    The default installation values are:
    "C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe"
    or
    "C:\Program Files\adobe\acrobat 6.0\acrobat\Acrobat.exe" (not sure about this path.  Check on your PC to be sure)
    depending on whether Adobe Reader or Adobe Acrobat is installed.
    Solution 2:
    Configure the browser to use Acrobat or Adobe Reader as a helper application.
    If you are using Firefox to browse the web, you can change this setting in Firefox by going to:
    Tools > Options
    Click on the "Applications" Tab.
    The first item in the list should be "Adobe Acrobat Document".  Under the Action list, click the drop down arrow and select the application you want to read PDFs within the web browser.  Click OK, and you should be done.
    If you're using Internet Explorer to view PDFs, try the below steps.
    After you configure Acrobat or Adobe Reader as a helper application, the browser starts the helper application in a separate window and displays PDF files within that window. Acrobat and Adobe Reader both include a preference that lets you specify Acrobat or Adobe Reader as the helper application.
    To configure Acrobat or Adobe Reader as a helper application:
    Start Acrobat or Adobe Reader.
    Choose Edit > Preferences.
    Select Internet on the left.
    Deselect Display PDF In Browser Using [Acrobat application], and then click OK.
    Quit Acrobat or Adobe Reader.
    The next time you select a link to a PDF file in the browser, a dialog box asks what you would like to do with the file. If you select Open It, the browser opens the PDF file in Acrobat or Adobe Reader (the helper application); if you select Save It To Disk, the browser saves the PDF file to your hard drive.

  • Yosemite upgrade causing issues with Adobe Premiere Elements 10

    Hi,
    Over the last weekend I upgraded my mid-2010 iMac to Yosemite from Snow Leopard and it seems to have caused an error with Adobe Premiere Elements 10.
    Prior to upgrading I was working on a project without issue. Now, when I try to open it I get an error "The project is not compatible with current version of Premiere Elements".
    I have tried other projects and some open without issue whilst others also present the same error. The difference between the projects appears to be whether a DVD menu has been selected. If the project has one - it fails to open.
    It seems strange that the OS would affect software in this way but that is all that has been changed.
    If someone can shed some light on this it would be greatly appreciated.
    Thanks

    Hi,
    Over the last weekend I upgraded my mid-2010 iMac to Yosemite from Snow Leopard and it seems to have caused an error with Adobe Premiere Elements 10.
    Prior to upgrading I was working on a project without issue. Now, when I try to open it I get an error "The project is not compatible with current version of Premiere Elements".
    I have tried other projects and some open without issue whilst others also present the same error. The difference between the projects appears to be whether a DVD menu has been selected. If the project has one - it fails to open.
    It seems strange that the OS would affect software in this way but that is all that has been changed.
    If someone can shed some light on this it would be greatly appreciated.
    Thanks

  • Flex Table Add Row Issue with Dynamic Entry Lists

    All,
    Your help would be kindly appreciated in resolving an 'Add Row'-issue within a Flex Table that uses Dynamic Entry Lists in Visual Composer. The issue here is as follows :
    When I use a [Local Dynamic Entry List |http://www.postyourimage.com/view_image.php?img_id=O5hrG2aMxWZ84Mu1211193041]to populate a row field, the initial row and all next rows are emptied upon 'insert row', they loose their selected values and also the entry list values ('pull-down menus') are lost. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=FPLr2cABcgiHRou1211192889].
    The initial row does [show the entry list values |http://www.postyourimage.com/view_image.php?img_id=2HybmEHAuQYs9cg1211192766]from the Local Dynamic Entry List based on the dynamically assigned input value; upon 'insert row' the entry lists are lost. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=FPLr2cABcgiHRou1211192889].
    When using a [Global Dynamic Entry List |http://www.postyourimage.com/view_image.php?img_id=m5p2KYuBb442dTq1211193501]to populate the row fields the Flex-table behaves normally as expected. Unfortunately with a Global Entry List it is not possible to dynamically assign a input value. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=U96V0zENCCyO3gA1211193157].
    Please also see the [issue summary image|http://www.postyourimage.com/view_image.php?img_id=06xti08tIEfely1211195178] I made to visualize the issue.  What I basically would like to know is whether this is a 'known issue' or not, or that it is an issue that can be fixed or whether there is an alternative workaround available ... I'm using Visual Composer 7.0 and the Portal is at SP 13.
    Many thanks,
    Freek

    Hi,
    you should be able to assign a dynamic value with global entry lists as well. If you say @myParam as dynamic value. VC will indicate in red letters, that the field @myParam is unknown. However, it will work, as long as @myParam is known in the form or table where you use the entry list.
    I have never heard of the problem that entry lists are emptied after "insert"-event.
    Kindes Regards,
    Benni

  • Issue with selection screen element on At slection scree

    Hi All,
    I am facing an issue with a checkbox which is present within the subscreen of a standard selection screen.
    The issue is that the value of the combobox get toggled by itselfon the event mentioned below. I am unable to find out how this combo box value gets changed by itself on the screen events.I tried clear statemetns etc nothing is helping. I debugged with a watch point on this screen element and found this to happen.It just changes the value of the element to a previously held state.I m trying to clear the combobox but this event puts back the tick mark.How can I stop this.
    AT SELECTION-SCREEN ON COL_FROM.  "COL_FROM is another screen element diffrent from the combobox
    Thanks

    Hi Vighneswaran CE,
    This event corresponds to the PAI module of the COL_FROM field. So, it gets executed each time you press any valid function code on the screen (unless there was an error in a previous field). Nothing abnormal here.
    That's difficult to help you on that topic, you'd better tell us exactly what report it is, where you have added your code (and what code) to change the checkbox, ...
    Best regards,
    Sandra

  • Issue with SM21 entries.

    Hi Gurus,
       I am facing soem prblems with the entries in SM21 of my BW  server.
        I can see only the following entry what ever be the Date and Time i specify.
    04:32:29 DIA  001 010 ALEREMOTE                A0  3 Breakpoint reached
    04:32:29 DIA  001 010 ALEREMOTE                A1  4 > in program GP487ICCMF1QNB4B489QAE4WV1E , line 2626, event ROUTINE_0001
    And i can see entries only with the current date and can't see entries in SM21  with the past date.
    Please guide me what the issue is and help me in resolving the issue.
    Thanks in Advance,
    Sachin Kumar.

    Hi
    Syslog is used for logging selected events and problems within SAP system.
    Information is written into text files that are saved at operating level. Exact location can be identified with the help of system parameter DIR_LOGGING.
    In SE38 tcode, when you run the report RSPARAM you will find some parameters:
    rslg/local/file: Name of local file can be identified with this parameter.
    When maximum limit of this file is reached new file is created and old file is saved in the system at OS level. Location of this file can be identified by the parameter rslg/local/old_file.
    You can try to check the same from that.
    System log is wriiten for every instance separately.
    Hope this helps!!
    Thanks and Kind Regards
    Esha

  • Alignment issues with menu widget and added web safe fonts

    I wanted to use a font that was not already on the web safe list so I added one. I have a background rectangle I drew in muse for the main navigation to center on. In muse, I have to shift the menu almost entirely off the rectangle for it to appear centered on the rectangle in the browser. The sub nav I created has a background fill to match the rectangle the main nav sits on. Even though there is no overlapping in muse, there is overlapping of the sub nav fill and the rectangle behind the main nav in the browser. So it looks like 50% white fill on top of 50% white fill. It's obvious and looks stupid! Is this a program bug??? Using CC muse.

    I have this issue fixed. But now I'm having a new issue with objects shifting. I really think it's just Muse and the program is buggy! I have read and watched everything I can find on Muse and it's supposed to be so simple a print designer can create beautiful websites. Well, I am a web designer. I understand code. I have used Dreamweaver for 8 years. I wanted to see what was so great about Muse. I'm finding out NOTHING! Because of it's bugs I spend hours trying to fix problems the program creates. I should have just stuck with Dreamweaver! Thanks for trying to help...

  • HT4623 Issue with anniversaries entry in notification drop down bar and calender app

    Hi guys,
    There is issue with notication dropdown and calender app in ios 7 which was not present in ios 6. The notification sync birthdays from contacts but only birthdays and not anniversaries.
    same is with the calender app
    what is the solution for this?

    The problem is not with the phone per se.  The problem is with Android 4.0 and your TB does not have 4.0.  Because this phone is the "gold standard" of development for Android 4.0 it makes sense to report the problem here.  If Verizon takes notice they will push the bug report up the food chain until some developer at Google or Samsung decides to fix it.

Maybe you are looking for

  • How do I transfer my Itunes Library onto a new computer?

    I feel pretty silly, but I just got a new laptop and want to transfer the music I have purchased. Do I upload from my Ipod? Or do I burn the library off the old computer and upload on the new one. The old operating system was Windows XP, the new one

  • Server 2012 Essentials Restore files not working

    I have a brand new install of server 2012 essentials running on hyper-v. have connected 4 test computers using the essentials connect method, 7 Pro and 8.1. backups are working daily with no errors. thought I would test a restore and I am getting the

  • IPhone 5 GarageBand how to do multiple tracks

    Anyone is silver spring,md area want to get together And help me explore GarageBand.  Right now I can record a song with GarageBand single track audio setting.  I sing and play my tenor ukulele. The quality is amazing! contact me at [email protected]

  • How to unhide a Bluetooth device?

    By mistake I hide a Bluetooth device because I had some trouble to establish the connection. How can I unhide this device? I did not find any option.

  • IPhone could not be restored. An Unknown error occurred (3194).

    My battery is sort of messed up, the phone dies at any time it wants. I asked at the apple store and they told me to restore the phone and check for improvements. I've backed it up but when restoring the phone, before it restarts the message "iPhone