Deployment plan to update web.xml

Hello,
Is it possible to use a deployement plan to update the web.xml file of an war inside an ear ?
I would like to map a servlet on a new URI using a new workmanager by configuration (I mean once my application is built) I suppose it is possible to use the deployment plan to add a section inside the web.xml.
For example, I would like to add the folowing section :
<servlet>
<servlet-name>DummyServlet</servlet-name>
<servlet-class>com.company.servlets.DummyServlet</servlet-class>
<init-param>
<param-name>wl-dispatch-policy</param-name>
<param-value>DummyWorkManager</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>DummyServlet</servlet-name>
<url-pattern>/myDummyServlet</url-pattern>
</servlet-mapping>
Thank you for helping me on this point
Best Regards,
C.

To my knowledge you can not add elements to your deployment descriptors, but you can change them, for example
say we have the following ejb-jar.xml
<ejb-jar ...>
    <enterprise-beans>
        <session>
            <ejb-name>Bedrijf</ejb-name>
            <env-entry>
                <env-entry-name>something</env-entry-name>
                <env-entry-type>java.lang.String</env-entry-type>
                <env-entry-value>iets</env-entry-value>
            </env-entry>
        </session>
    </enterprise-beans>
</ejb-jar>and we want to change the value of something. Now we can generate a plan.xml (for example by using weblogic.Plangenerator
http://download.oracle.com/docs/cd/E13222_01/wls/docs90/deployment/wlplangenerator.html). When we do this for an EAR
file we get something like the following:
<?xml version='1.0' encoding='UTF-8'?>
<deployment-plan xmlns="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd">
  <application-name>test</application-name>
  <variable-definition>
    <variable>
      <name>SessionDescriptor_timeoutSecs_12870427304900</name>
      <value>1800</value>
    </variable> 
    <variable>
        <name>something</name>
        <value>anders</value>
    </variable>
  </variable-definition>
  <module-override>
    <module-name>EJBSessionBeans.ear</module-name>
    <module-type>ear</module-type>
    <module-descriptor external="true">
      <root-element>weblogic-application</root-element>
      <uri>META-INF/weblogic-application.xml</uri>
      <variable-assignment>
        <name>SessionDescriptor_timeoutSecs_12870427304900</name>
        <xpath>/weblogic-application/session-descriptor/timeout-secs</xpath>
      </variable-assignment>
    </module-descriptor>
    <module-descriptor external="false">
      <root-element>application</root-element>
      <uri>META-INF/application.xml</uri>
    </module-descriptor>
    <module-descriptor external="true">
      <root-element>wldf-resource</root-element>
      <uri>META-INF/weblogic-diagnostics.xml</uri>
    </module-descriptor>
  </module-override>
  <module-override>
    <module-name>Model.jar</module-name>
    <module-type>ejb</module-type>
    <module-descriptor external="true">
      <root-element>weblogic-ejb-jar</root-element>
      <uri>META-INF/weblogic-ejb-jar.xml</uri>
    </module-descriptor>
    <module-descriptor external="false">
      <root-element>ejb-jar</root-element>
      <uri>META-INF/ejb-jar.xml</uri>
       <variable-assignment>
        <name>something</name>
        <xpath>/ejb-jar/enterprise-beans/session/[ejb-name="Bedrijf"]/env-entry/[env-entry-name="something"]/env-entry-value</xpath>
        <operation>replace</operation>
      </variable-assignment>
    </module-descriptor>
  </module-override>
  <module-override>
    <module-name>Userinterface.war</module-name>
    <module-type>war</module-type>
    <module-descriptor external="true">
      <root-element>weblogic-web-app</root-element>
      <uri>WEB-INF/weblogic.xml</uri>
      <hash-code>1287042734068</hash-code>
    </module-descriptor>
    <module-descriptor external="false">
      <root-element>web-app</root-element>
      <uri>WEB-INF/web.xml</uri>
    </module-descriptor>
  </module-override>
  <config-root>...</config-root>
</deployment-plan>To this plan.xml we added a variable definition
<variable-definition>
      <variable>
        <name>something</name>
        <value>anders</value>
    </variable>
</variable-definition>To change the contents of the variable something we add the following to the ejb-jar module section
<module-descriptor external="false">
      <variable-assignment>
        <name>something</name>
        <xpath>/ejb-jar/enterprise-beans/session/[ejb-name="Bedrijf"]/env-entry/[env-entry-name="something"]/env-entry-value</xpath>
        <operation>replace</operation>
      </variable-assignment>
    </module-descriptor>The same steps can be followed when you want to change the contents of your web.xml (but note that the elements must be present
otherwise the xpath assignment will not work)

Similar Messages

  • Error trying to update web.xml

    I'm trying to update  web.xml via these instructions:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0eb8120-b66c-2910-5795-894f384fc054
    The upload fails, and I see this excetpion in the log:
    Caused by: java.rmi.RemoteException: Error occurred during single file update of
           application sap.com/irj. Reason: Updating the security information in the
           deployment descriptors is not allowed in this operation.; nested exception is:
         com.sap.engine.services.servlets_jsp.server.exceptions.WebDeploymentException:
           Updating the security information in the deployment descriptors is not
           allowed in this operation.
    Ideas?  I'm signing in as Administrator, so why would the operation not be allowed?
    This is a 7.0 system, and the instructions are for a nw2004 system.  We've successfully uploaded the web.xml file before, so I'm thinking that something has changed in 7.0 that's preventing the upload.

    This page of the documentation indicates that the technique is the correct case:
    http://help.sap.com/saphelp_nw70/helpdata/en/6e/8590f1d6d349c9adc34c6a8085189b/frameset.htm
    So, one of two things has happened:
    1. The documentation is in error, or
    2. A bug has been introduced.
    I'm hoping it's #2....

  • 10.1.3 - OEM Deployment generating invalid orion-web.xml

    Hi,
    I've playing around with OracleASjms resource adapters, JMS Connector, etc - with some good results. I noticed that one of my test applications, when deployed (via OEM) gets an orion-web.xml which is not according to the XML schema and am wondering whether this is designed behavior.
    In my servlet I'm using some logical names for javax.jms.ConnectionFactory and javax.jms.Destination, which I specify in the web.xml. Deploying the ear file I get the change to resolve environment references to 'physical' JNDI locations. I map the logical javax.jms.ConnectionFactory to an OracleASjms resource adapter connection factory (which in turn is pointing to an JMS ConnectionFactory) and the javax.jms.Destination I map to an OracleASjms Administered resource.
    The applications deploys and works fine, however I have a question with respect to the orion-web.xml that Oracle is generating based. More specifically I see (<....> are replaced with actual values):
       <message-destination-ref-mapping
             name="<logical name>"
             location="<OracleAsjms/Administerered Object>"/>The element message-destination-ref-mapping isn't declared in the XML schema for orion-web.xml, but still it works, how come?

    http://www.oracle.com/technology/oracleas/schema/index .html
    http://www.oracle.com/technology/oracleas/schema/orion-web-10_0.xsd
    Thanks, jvissers. It seems that orion-web-10_0.xsd is outdated. It is probably that it was posted for the 10.1.3 preview. When the 10.1.3 production release is available, at least that schema is not updated. Hmm, all things that are changing but kept at different places are just very susceptible to inconsistency. Hmm, OracleAs team should probably make automated tests to make sure that they are in sync. (I am just thinking loudly). Let me try to communicate to someone who can further take care of this matter of outdated schemas. Thanks again, jvissers.
    Where did you look?Inside my oc4j installation! oc4j will not go to the web to download the oc4j-specific schemas in case of need. The orion-web-10_0.xsd is at OC4J_HOME/j2ee/home/lib/schemas.jar!META-INF/orion-web-10_0.xsd. That is where I looked. So the orion-web.xml generated by OEM is indeed valid.

  • Deployment Plan / weblogic-ejb-jar.xml:  Problem

    Hello,
    I am trying to use a deployment plan to override the principal name in the weblogic-ejb-jar.xml.
    The deployment-plan looks like this (showing only the important sections)
    <variable-definition>
    <variable>
    <name>SecurityRoleAssignment_ejbRole_PrincipalNames_1</name>
    <value>MY PRINCIPAL 1</value>
    </variable>
    </variable-definition>
    <variable-assignment>
    <name>SecurityRoleAssignment_ejbRole_PrincipalNames_1</name>
    <xpath>/weblogic-ejb-jar/security-role-assignment/[role-name="View-Role"]/externally-defined</xpath>
    <operation>replace</operation>
    </variable-assignment>
    The security-role assignment in the weblogic-ejb-jar.xml looks like this:
    <security-role-assignment>
    <role-name>View-Role</role-name>
         <externally-defined/>
    </security-role-assignment>
    I 've tried to override the element-value of <externally-defined> (a valid tag in the weblogic-ejb-jar.xml ) with help of a deployment-plan.
    When trying to deploy my application (which is organised in the directory-structure: inst_dir/APP inst_dir/PLAN
    the following error occurs:
    VALIDATION PROBLEMS WERE FOUND problem: cvc-complex-type.2.4a: Expected element 'principal-name@http://www.bea.com/ns/weblogic/10.0' instead of 'externally-defined@http://www.bea.com/ns/weblogic/10.0' here in element security-role-assignment@http://www.bea.com/ns/weblogic/10.0:
    This has surprised me, as externally-defined is (according to the documentation) a valid tag.
    I have tried to replace <externally-defined> with an empty <principal-name> tag (which works fine when deploying the application), but causes a security exception, when trying to use the EJB.
    Has anybody an idea if there is a workaround for this problem?
    IMHO the Validatio Problem is not justified at this place then why should an otherwise valid weblogic-ejb-jar.xml (when not using a deployment-plan) suddenly become invalid when a deployment plan is used?
    Thanx a lot in advance!
    Edited by: user10672779 on 02.12.2008 04:09

    Hi again,
    I tried it with the weblogic 10 Namespace Declaration but got then this error:
    failed to load java type corresponding to e=weblogic-ejb-jar@http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd
    and following Exception:
    <02.12.2008 20.00 Uhr CET> <Error> <J2EE> <BEA-160197> <Unable to load descriptor D:\exportapps\tb.ear\app\tb_flowcontrol.jar/META-INF/weblogic-ejb-jar.xml of module tb_flowcontrol.jar. The error is weblogic.descriptor.DescriptorException: Unmarshaller failed
    at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:152)
    at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:292)
    at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:260)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:774)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:395)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:745)
    Caused by: com.bea.xml.XmlException: failed to load java type corresponding to e=weblogic-ejb-jar@http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd
    at com.bea.staxb.runtime.internal.UnmarshalResult.getPojoBindingType(UnmarshalResult.java:329)
    at com.bea.staxb.runtime.internal.UnmarshalResult.determineTypeForGlobalElement(UnmarshalResult.java:296)
    at com.bea.staxb.runtime.internal.UnmarshalResult.determineTypeForGlobalElement(UnmarshalResult.java:306)
    at com.bea.staxb.runtime.internal.UnmarshalResult.determineRootType(UnmarshalResult.java:287)
    at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalDocument(UnmarshalResult.java:153)
    at com.bea.staxb.runtime.internal.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:65)
    at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:141)
    Searching the net couldn't supply me with another answer as to use the 90 Namespace Declaration again...
    I think I forgot to mention I am using an exploded directory.
    This all seems very strange.
    cheers.

  • Automatic update of web.xml when running UIX application

    I moved my UIX project from 9.02 to 9.03. The UIX resource files have changed between the versions so I deleted the old cabo folder so that when I ran my applicaton for the first time it would rebuild it. When I ran my application my web.xml file was automatically updated with the following servlet initialisation parameters:
    <init-param>
    <param-name>oracle.cabo.servlet.pageBroker</param-name>
    <param-value>oracle.cabo.servlet.xml.UIXPageBroker</param-value>
    </init-param>
    <init-param>
    <param-name>oracle.cabo.ui.UIExtensions</param-name>
    <param-value>oracle.cabo.data.jbo.ui.JboUIExtension</param-value>
    </init-param>
    The problem is that I've got my own pageBroker already defined in web.xml so when I run my application it used UIXPageBroker instead. This took me a while to find - my app just suddenly stopped working. I don't know what actually updated web.xml but I think it needs to check for the presence of these parameters before inserting them.
    Cheers
    Ian

    Sorry about that Ian, I agree that the code should
    check for the presence of another PageBroker. I'll
    log a bug and bring this up with the development
    team.
    - Jeff

  • How to edit web.xml deployment descriptor from console in weblogic 8.1?

    In weblogic 7.0, deployment descriptor such as web.xml can be edited from the admin
    console, but on weblogic 8.1 I can't find a way to do so.
    Is this function taken out? Why is it taken out? Do I have an alternative to edit
    it without unpacking and packing the EAR or WAR?
    Thanks in advance.
    Bill

    In weblogic 7.0, deployment descriptor such as web.xml can be edited from the admin
    console, but on weblogic 8.1 I can't find a way to do so.
    Is this function taken out? Why is it taken out? Do I have an alternative to edit
    it without unpacking and packing the EAR or WAR?
    Thanks in advance.
    Bill

  • Update jta-datasource property with deployment plan

    hi,
    weblogic server needs the jta data source as a vendor parameter into the persistence xml? right?
    looks like:
    <properties>
    <property name="eclipselink.target-server" value="WebLogic_10" />
    <property name="javax.persistence.jtaDataSource" value="mysql" />
    </properties>
    so now i want to change the value (in my case mysql) to another with a deployment plan... but how does this work? i cannot change the attributes of the tag with my deployment plan, can i?
    my Deployment plan looks like:
    <variable-definition>
    <variable>
    <name>DataSource</name>
    <value>mysqltest</value>
    </variable>
    </variable-definition>
    <module-descriptor external="false">
    <root-element>persistence</root-element>
    <uri>META-INF/persistence.xml</uri>
    <variable-assignment>
    <name>JDBCDataSource</name>
    <xpath>/persistence/persistence-unit[name="serverpool"]/properties/property[name="javax.persistence.jtaDataSource"]</xpath>
    </variable-assignment>
    </module-descriptor>
    but after this my application dont work because the persistence xml isnt correct.
    so how can i change the attribte value of the tag property of my persistence.xm to change the jta-datasource of my application?
    thank you

    Firstly, I would validate with support that deployment plans cover the persistence.xml deployment descriptor. Someone else has encountered issues with deployment plans before and I believe they are only supported on certain types of deployment descriptor files. See this previous post:
    Problem with hibernate, JPA, and deployment plan
    Secondly even if it is supported, your XPATH is incorrect for the variable assignment. I'm not exactly sure what it would be since you're replacing an attribute value as opposed to the contents of an element itself, but it would look more like this:
    /persistence/persistence-unit/properties/property[@name='javax.persistence.jtaDataSource']@value
    But I'm sure that's wrong. I'm not sure I've seen an example that replaces an attribute value, the ones I've seen are usually a node value.

  • Error when deploying EAR in OC4J 10.1.3.0.0 with a deployment plan

    Hello!
    I try to deploy an ear file specifying a deployment plan generated from web interface using command line utilities. I try to use both admin_client.jar and oracle ant task and still get the same error. When i remove deployment plan argument, the application is successfully deployed.... Any Idea?
    My server:
    OC4J 10.1.3.0.0 on an AIX server
    The error raised during deployment:
    [MyServer] 08/04/07 12:46:56 Notification ==>Application Deployer for MyApp STARTS.
    [MyServer] 08/04/07 12:46:56 Notification ==>Copy the archive to /oracle/product/j2ee/home/applications/MyApp.ear
    [MyServer] 08/04/07 12:46:56 Notification ==>Initialize /oracle/product/j2ee/home/applications/MyApp.ear begins...
    [MyServer] 08/04/07 12:46:56 Notification ==>Unpacking MyApp.ear
    [MyServer] 08/04/07 12:46:57 Notification ==>Done unpacking MyApp.ear
    [MyServer] 08/04/07 12:46:57 Notification ==>Unpacking ic.war
    [MyServer] 08/04/07 12:46:59 Notification ==>Done unpacking ic.war
    [MyServer] 08/04/07 12:46:59 Notification ==>Initialize /oracle/product/j2ee/home/applications/MyApp.ear end
    s...
    [MyServer] 08/04/07 12:46:59 Notification ==>Starting application : MyApp
    [MyServer] 08/04/07 12:46:59 Notification ==>Initializing ClassLoader(s)
    [MyServer] 08/04/07 12:46:59 Notification ==>Initializing EJB container
    [MyServer] 08/04/07 12:46:59 Notification ==>Loading connector(s)
    [MyServer] 08/04/07 12:47:00 Notification ==>Starting up resource adapters
    [MyServer] 08/04/07 12:47:00 Notification ==>Initializing EJB sessions
    [MyServer] 08/04/07 12:47:00 Notification ==>Committing ClassLoader(s)
    [MyServer] 08/04/07 12:47:00 Notification ==>Initialize ic begins...
    [MyServer] 08/04/07 12:47:00 Notification ==>Initialize ic ends...
    [MyServer] 08/04/07 12:47:00 Notification ==>Started application : MyApp
    [MyServer] 08/04/07 12:47:00 Notification ==>Binding web application(s) to site default-web-site begins...
    [MyServer] 08/04/07 12:47:00 Notification ==>Binding ic web-module for application MyApp to site default-web-site under context root ic
    [MyServer] 70/01/01 00:00:00 Notification ==>Error deserializing return-value: unexpected reset; nested exception is:
    java.io.StreamCorruptedException: unexpected reset
    [Summary] There are total 1 instances in the operation.
    [Summary] Operation failed on MyServer
    [Summary] Operation on cluster FAILED since 1 instanced failed!
    Here my deployment plan generated by the Application Server Control Console
    moduleType=ear
    applicationID=MyApp
    bindWebApp=default-web-site
    parent=default
    moduleID=.
    doctype=orion-application
    <?xml version="1.0" encoding="UTF-8"?>
    <orion-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/sch
    ema/orion-application-10_0.xsd">
    </orion-application>
    moduleID=myapp.war
    doctype=orion-web-app
    <?xml version="1.0" encoding="UTF-8"?>
    <orion-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/
    orion-web-10_0.xsd" context-root="myapp">
    <resource-ref-mapping name="jdbc/ds" location="jdbc/myapp/ds">
    </resource-ref-mapping>
    <web-app-class-loader>
    </web-app-class-loader>
    </orion-web-app>
    My Command line to deploy the application
    java -jar admin_client.jar deployer:cluster:opmn://MyServer/home oc4jadmin XXXXX -deploy -file ~/MyApp.ear -deploymentName MyApp -deploymentPlan ~/myapp_plan.dat
    Ant file used to deploy
    <project name="Deploy EAR in OC4J" default="deploy-ear" basedir="." xmlns:oracle="antlib:oracle">
    <property name="server.host" value="MyServer"/>
    <property name="server.user" value="oc4jadmin"/>
    <property name="server.password" value="XXXXXX"/>
    <property name="deploy.filepath" value="/home/myhome/MyApp.ear"/>
    <property name="deploy.deployname" value="MyApp"/>
    <property name="deploy.logpath" value="${basedir}/deploy-ear.log"/>
    <property name="deploy.planpath" value="/home/myhome/myapp_plan.dat"/>
    <property name="deploy.uri" value="deployer:cluster:opmn://${server.host}/home"/>
    <target name="deploy-ear">
    <oracle:deploy
    deployerUri="${deploy.uri}"
    userId="${server.user}"
    password="${server.password}"
    file="${deploy.filepath}"
    deploymentName="${deploy.deployname}"
    bindAllWebApps="default-web-site"
    deploymentPlan="${deploy.planpath}"
    logFile="${deploy.logpath}"/>
    </target>
    </project>
    Thanks
    Message was edited by:
    Olivier MARTIN

    If you're using OC4J standalone, use the latest available OC4J, 10.1.3.3.
    If you're using a manage OC4J, ie. Application Server, upgrade to the latest available version and upgrade your JDK. The provided JDK might be outdated.
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to map a resource-ref in Jdev11 deployment plan editor

    Hi all,
    I have a ADF/BC web application where the BC4J application module does connect to a JNDI data source.
    The ViewController project does declare the Datasource as needed resource in its web.xml:
    <resource-ref>
    <res-ref-name>jdbc/wlogDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    Now i need to map that resouurce-ref to an actual data source that exist in the application container at deploy time.
    As already in JDev 10.1.3 the deployment-plan editor provided during deployment from JDeveloper does not provide any means to enter the deployment mapping for that resourc-ref (When clicking on the node (which is named resouce-ref - that becomes very confusing in case you have defined three resource-refs in your web.xml) the right pane shows a gray pane without any edit controls) So I cannot enter the resource-ref-mapping unsing the Jdev UI.
    My workaround in 10.1.3 was to save the deployment plan to disk and manually edit it, adding
    <resource-ref-mapping name="jdbc/wlogDS" location="jdbc/wlogTestEnvDS">
    </resource-ref-mapping>
    to the orion-web-app document for that webapp
    But in Jdev 11 the deployment plan file format changed (including some binary inline checksums???)and when doing exactly the same thing, the loading of the manually edited file into Jdev Deployment plan editor fails with
    oracle.oc4j.admin.deploy.spi.exceptions.ExtendedConfigurationException: invalid entry size (expected 1886413103 but got 846 bytes)
         at oracle.oc4j.admin.deploy.spi.DeplConfiguration.restore(DeplConfiguration.java:1002)
         at oracle.oc4j.admin.deploy.spi.DeplConfiguration.restore(DeplConfiguration.java:738)
         at oracle.jdevimpl.deploy.jsr88.ConfigModel.loadConfig(ConfigModel.java:201)
         at oracle.jdevimpl.deploy.jsr88.Jsr88ConfigurationPanel.actionPerformed(Jsr88ConfigurationPanel.java:212)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
         at java.awt.Dialog$1.run(Dialog.java:515)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Caused by: oracle.oc4j.admin.jmx.shared.exceptions.JMXRuntimeException: invalid entry size (expected 1886413103 but got 846 bytes)
         at oracle.oc4j.admin.jmx.shared.util.JarTool.readJar(JarTool.java:240)
         at oracle.oc4j.admin.deploy.spi.DeplConfiguration.parseDeploymentPlan(DeplConfiguration.java:1464)
         at oracle.oc4j.admin.deploy.spi.DeplConfiguration.restore(DeplConfiguration.java:761)
         ... 33 more
    Caused by: java.util.zip.ZipException: invalid entry size (expected 1886413103 but got 846 bytes)
         at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:368)
         at java.util.zip.ZipInputStream.read(ZipInputStream.java:141)
         at java.util.jar.JarInputStream.read(JarInputStream.java:171)
         at java.io.FilterInputStream.read(FilterInputStream.java:90)
         at oracle.oc4j.admin.jmx.shared.util.JarTool.copy(JarTool.java:1343)
         at oracle.oc4j.admin.jmx.shared.util.JarTool.readEntry(JarTool.java:255)
         at oracle.oc4j.admin.jmx.shared.util.JarTool.readJar(JarTool.java:232)
         ... 35 more
    oracle.oc4j.admin.jmx.shared.exceptions.JMXRuntimeException: invalid entry size (expected 1886413103 but got 846 bytes)
         at oracle.oc4j.admin.jmx.shared.util.JarTool.readJar(JarTool.java:240)
         at oracle.oc4j.admin.deploy.spi.DeplConfiguration.parseDeploymentPlan(DeplConfiguration.java:1464)
         at oracle.oc4j.admin.deploy.spi.DeplConfiguration.restore(DeplConfiguration.java:761)
         at oracle.oc4j.admin.deploy.spi.DeplConfiguration.restore(DeplConfiguration.java:738)
         at oracle.jdevimpl.deploy.jsr88.ConfigModel.loadConfig(ConfigModel.java:201)
         at oracle.jdevimpl.deploy.jsr88.Jsr88ConfigurationPanel.actionPerformed(Jsr88ConfigurationPanel.java:212)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
         at java.awt.Dialog$1.run(Dialog.java:515)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Caused by: java.util.zip.ZipException: invalid entry size (expected 1886413103 but got 846 bytes)
         at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:368)
         at java.util.zip.ZipInputStream.read(ZipInputStream.java:141)
         at java.util.jar.JarInputStream.read(JarInputStream.java:171)
         at java.io.FilterInputStream.read(FilterInputStream.java:90)
         at oracle.oc4j.admin.jmx.shared.util.JarTool.copy(JarTool.java:1343)
         at oracle.oc4j.admin.jmx.shared.util.JarTool.readEntry(JarTool.java:255)
         at oracle.oc4j.admin.jmx.shared.util.JarTool.readJar(JarTool.java:232)
         ... 35 more
    ---- Embedded exception
    java.util.zip.ZipException: invalid entry size (expected 1886413103 but got 846 bytes)
         at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:368)
         at java.util.zip.ZipInputStream.read(ZipInputStream.java:141)
         at java.util.jar.JarInputStream.read(JarInputStream.java:171)
         at java.io.FilterInputStream.read(FilterInputStream.java:90)
         at oracle.oc4j.admin.jmx.shared.util.JarTool.copy(JarTool.java:1343)
         at oracle.oc4j.admin.jmx.shared.util.JarTool.readEntry(JarTool.java:255)
         at oracle.oc4j.admin.jmx.shared.util.JarTool.readJar(JarTool.java:232)
         at oracle.oc4j.admin.deploy.spi.DeplConfiguration.parseDeploymentPlan(DeplConfiguration.java:1464)
         at oracle.oc4j.admin.deploy.spi.DeplConfiguration.restore(DeplConfiguration.java:761)
         at oracle.oc4j.admin.deploy.spi.DeplConfiguration.restore(DeplConfiguration.java:738)
         at oracle.jdevimpl.deploy.jsr88.ConfigModel.loadConfig(ConfigModel.java:201)
         at oracle.jdevimpl.deploy.jsr88.Jsr88ConfigurationPanel.actionPerformed(Jsr88ConfigurationPanel.java:212)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
         at java.awt.Dialog$1.run(Dialog.java:515)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    So no chance here to add a resource-ref-mapping. The alternative way of specifying a resource-ref-mapping using the web-based deployment proces of the Enterprise manager is impossible because the 11g preview OC4j does not include an enterprise manger web-application.
    So how do I deploy the application correctly other that manually modifying the deployed orion-web-app.xml file in j2ee/home/application-deployments/earName/warName/orion-web-app.xml after deploying the app without a resource-ref-mapping? Because doing that step manually each time is quite annoying.
    Greetings,
    Thomas

    Seems i'm slowly answering my own questions :-) I finally got my RMI service, even using several methods. But ...
    It doesnt help me as the lookups are not done on the context classloader it seems. That means i need to add all my service jars to the global class path causing massive sealing issues with the war contained jars. Pretty useless. All the needed stubs etc are in the war.
    But as it seems that the web app needs to contain deployment site info (sun-web.xml) anyway, i could just as easy read my own web xml from the context and resolve the services myself. But i do wonder how this is supposed to work with EJB and CORBA stuff. The samples actually also needed to add stuff to the global class path.
    I'm probably not the easiest customer as i write this kind of middle ware for a living but i really like sjsws. It makes my own one partly obsolete as it is almost as fast and has all the fancy deployment stuff (in my case i use an in-house mobile agent frame work and agents that travel the various networks ) and infinitely easier to learn to work with and understand In case anyone is wondering i wrote Uhura because 1. i needed speed so it is a servlet based webserver and not a web server with a servlet module. 2. could not wait on ibm to fix bugs in webspere and we only used the servlet bit. 2. i needed full J2EE security and 3. i needed it to run on many OS'es
    That is why i still need the same war files to be able to be deployed in both systems as i still need my systems going on IBM iservers etc.
    Again i would welcome some feed back on such and related issues
    Cheers,
    Peter

  • Q: Changing login-config with a deployment plan

    Hi everybody,
    I have an application for which the developer sets the login-config in web.xml as follows:
    <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>Sec_Con-Realm</realm-name>
    </login-config>
    But I need it to be
    <login-config>
    <auth-method>CLIENT-CERT</auth-method>
    <realm-name>myrealm</realm-name>
    </login-config>
    So I defined a deployment plan like this:
    <?xml version='1.0' encoding='UTF-8'?>
    <deployment-plan xmlns="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd">
    <application-name>AppTest</application-name>
    <variable-definition>
    <variable>
         <name>LoginConfig_AuthMethod</name>
         <value>CLIENT-CERT</value>
    </variable>
    <variable>
         <name>LoginConfig_RealmName</name>
         <value>myrealm</value>
    </variable>
         </variable-definition>
    <module-override>
    <module-name>AppTest.ear</module-name>
    <module-type>ear</module-type>
    <module-descriptor external="true">
    <root-element>weblogic-application</root-element>
    <uri>META-INF/weblogic-application.xml</uri>
    </module-descriptor>
    <module-descriptor external="false">
    <root-element>application</root-element>
    <uri>META-INF/application.xml</uri>
    </module-descriptor>
    <module-descriptor external="true">
    <root-element>wldf-resource</root-element>
    <uri>META-INF/weblogic-diagnostics.xml</uri>
    </module-descriptor>
    </module-override>
    <module-override>
    <module-name>AppTest.war</module-name>
    <module-type>war</module-type>
    <module-descriptor external="true">
    <root-element>weblogic-web-app</root-element>
    <uri>WEB-INF/weblogic.xml</uri>
    </module-descriptor>
    <module-descriptor external="false">
    <root-element>web-app</root-element>
    <uri>WEB-INF/web.xml</uri>
    <variable-assignment>
         <name>LoginConfig_AuthMethod</name>
              <xpath>/web-app/login-config/auth-method</xpath>
              <operation>replace</operation>
         </variable-assignment>
    <variable-assignment>
         <name>LoginConfig_RealmName</name>
              <xpath>/web-app/login-config/realm-name</xpath>
              <operation>replace</operation>
         </variable-assignment>
    </module-descriptor>
    </module-override>
    </deployment-plan>
    But apparently my deployment plan doesn't work. If I set web.xml manually to have CLIENT-CERT/myrealm the application works. When I leave it at BASIC/Sec_Con-Realm it doesn't and asks to enter user/passwd. It seams as if the deployment plan were ignored. I don't get any errors or such, just the wrong behavior.
    I use this WLST clause to deploy the EAR:
    deploy('AppTest', 'dist/AppTest.ear', targets='node4', planPath='config/plan.xml', timeout=600)
    The target WLS version is 10.3.4. Any clues?
    Regards
    Slawo.

    Ivan, I don't know if this will work or not, but if you look at Edwin's example here http://biemond.blogspot.com/2009/04/using-weblogic-deployment-plan-to.html he uses the following syntax xpath so that you know which context-param needs to be replaced:
    <variable-assignment>
    <name>org.mytests.env</name>
    <xpath>/web-app/context-param/[param-name="org.mytests.env"]/param-value</xpath>
    <operation>replace</operation>
    </variable-assignment>
    Give that a shot

  • Overriding spring configuration in J2EE deployment plan?

    I would like some suggestions on how to solve this problem:
    Background:
    We are developing an application with a web interface and a couple of EJB's, which will be deployed on WebLogic 9.2. We are using Spring 1.2.8. We are using a ContextSingletonBeanfactoryLocator to have a shared application context between the web app and the EJB's.
    We have some configuration values (server names, URLs, directories etc), which we would like to modify at deployment time, depending on the environment (local/dev/test/uat/prod). However, we definitely do not want to build different .ear files for each environment.
    The problem:
    The normal way to do this (when not using spring) is to place these in a deployment descriptor (e.g. web.xml or ejb-jar.xml) and then override them with a deployment plan at deployment time. But a deployment plan cannot override values in an arbitrary file (such as applicationContext.xml)
    Approach A:
    I use a PropertyPlaceholderConfigurer or similar to load an "c:\myapp.environment.properties" file, which was placed in the filesystem outside of the ear, and which was different in all environments. This is simple to implement, but in a distributed environment with many servers and many applications, it will be a pain to maintain this file.
    Approach B:
    Much like approach A, but put the property file in a separate application library and load it from the classpath. Then maintain a different version of this app library for each environment. This makes it simpler to ensure it's deployed to all managed servers - but it's a bit more complicated to maintain.
    Approach C:
    Use an extended ContextLoaderListener servlet so that it automatically deployed a PropertyPlaceholderConfigurer bean which expanded all context-params. E.g.
    <pre>
    <!-- web.xml -->
    <context-param>
    <param-name>remoteServerName</param-name>
    <param-value>myRemoteServerInDev</param-value>
    </context-param>
    <context-param>
    <param-name>fileDirectory</param-name>
    <param-value>c:\files</param-value>
    </context-param>
    <listener>
    <listener-class>
    dk.pfa.ConfiguringContextLoaderListener
    </listener-class>
    </listener>
    </pre>
    In my applicationContext.xml, I would then have <property name="serverName" value="${remoteServerName}"/>
    For production, I could override the web.xml in the deployment plan to set remoteServerName to "prodRemoteServer".
    The problem is that I cannot be sure that this servlet actually gets to configure the shared application context - an EJB may initialise first.
    I could put similar logic in each and every EJB, using <env-entry> in ejb-jar.xml instead of <context-param> in web.xml. This seems to invite trouble, since I would then have to ensure that the deployment plan had overridden values for all these entries as well .
    Finally I have the option of making an application lifecycle listener class - but that cannot access the web.xml, ejb-jar.xml or any other deployment-plan-overridable files, where I can put user-defined values .
    So what is the best practice? Or just a reasonable approach?
    Surely, I cannot be the first to face this problem, but if somebody has solved it, they forgot to mention it to Google

    I would vote for A or B

  • Admin UI for editing environment entries (i.e. env-entry in web.xml)

    Hi there,
    just wanted to know if Weblogic nowadays features a UI for post-deployment editing of environment entries such as the ones declared via <env-entry> in web.xml ( [http://download.oracle.com/docs/cd/E21764_01/web.1111/e13712/web_xml.htm#autoId30] ). So far, I'm using a deployment plan to re-configure these things at the time of each deployment, which works but which is also probably not the most flexible solution.
    Thanks in advance,
    Chris

    Ah, I was trying to do a lookup from session bean for the env-entry defined in
    the web.xml. After reading the J2EE spec, I see this just won't work. env-entries
    are only accessible from within the component where they are defined.
    Still the error message with "comp.env" instead of the expected "comp/env" is
    a bit confusing.
    Not much traffic in this newsgroup, is there?
    Steve
    "Steve Ditlinger" <[email protected]> wrote:
    >
    >
    >
    If I create an "env-entry" block for a name (e.g. "MySchemaName") in
    my web.xml
    file and deploy the web app, I should be able to look up the name from
    my webapp
    with the line:
    <br>
    myInitialContext.lookup("java:comp/env/MySchemaName");
    <br>
    However when I do that I get the error message:
    <br>
    javax.naming.NameNotFoundException: Unable to resolve 'java:comp.env/MySchemaName'
    <br>
    Note that the "comp/env" prefix has been changed to "comp.env". This
    worked under
    WL 6.1. Is this a bug in WL 7's JNDI or a bug in the error message or
    both or
    something else altogether?
    The immediately previous line successfully performs an EJBHome lookup
    using the
    same Initial Context object. The main difference is that the EJBHome
    name is defined
    thru the EJB deployment descriptors, not the web.xml.
    Thanks,
    Steve

  • How to reupdate web.xml

              hi,
              I downloaded WLS 6.0, W2K for testing.
              Whenever I updated web.xml for my new servlets, I need to stop and restart weblogic
              server.
              Is there any way for weblogic to detect that web.xml had changed and updated accordingly
              or command line to trigger update in web.xml?
              thanks.
              - yoke
              

              An application or application component can be dynamically redeployed while the server is running. This may be useful if you want to update a deployed application or application component without stopping and restarting the WebLogic Administration Server. To dynamically redeploy a JAR, WAR or EAR file, simply copy the new version of the file over the existing file in the /applications directory.
              You can also dynamically redeploy applications or application components that have been deployed in exploded format. When an application has been deployed in exploded format, the Administration Server periodically looks for a file named REDEPLOY in the exploded application directory. If the timestamp on this file changes, the Administration Server redeploys the exploded directory.
              If you want to update files in an exploded application directory, do the following:
              1. When you first deploy the exploded application, create an empty file named REDEPLOY in the directory where the exploded application resides.
              2. To update the exploded application, copy the updated files over the existing files in that directory.
              3. After copying the new files, touch the REDEPLOY file in the exploded directory to alter its timestamp.
              When the Administration Server detects the changed timestamp, it redeploys the contents of the exploded directory.
              yoke <[email protected]> wrote:
              > thanks for the doc link.
              > In figure 6.1, it said that I should be able to see the "Configuration->application".
              > However, I had only see the following tabs under configuration:
              > General, Cluster, HTTP, SSL, Tuninh, Protocols, Compilers.
              > I don't have "application" tab, how can I bring out the application tab?
              > thanks.
              > - yoke
              > Dimitri Rakitine <[email protected]> wrote:
              >>http://e-docs.bea.com/wls/docs60/adminguide/appman.html#1027432
              >>
              >>yoke <[email protected]> wrote:
              >>
              >>> hi,
              >>
              >>> I downloaded WLS 6.0, W2K for testing.
              >>> Whenever I updated web.xml for my new servlets, I need to stop and
              >>restart weblogic
              >>> server.
              >>
              >>> Is there any way for weblogic to detect that web.xml had changed and
              >>updated accordingly
              >>> or command line to trigger update in web.xml?
              >>
              >>> thanks.
              >>
              >>> - yoke
              >>
              >>
              >>--
              >>Dimitri
              Dimitri
              

  • Bug in lookup of web.xml env-entry in WL 7.0?

    If I create an "env-entry" block for a name (e.g. "MySchemaName") in my web.xml
    file and deploy the web app, I should be able to look up the name from my webapp
    with the line:
    <br>
    myInitialContext.lookup("java:comp/env/MySchemaName");
    <br>
    However when I do that I get the error message:
    <br>
    javax.naming.NameNotFoundException: Unable to resolve 'java:comp.env/MySchemaName'
    <br>
    Note that the "comp/env" prefix has been changed to "comp.env". This worked under
    WL 6.1. Is this a bug in WL 7's JNDI or a bug in the error message or both or
    something else altogether?
    The immediately previous line successfully performs an EJBHome lookup using the
    same Initial Context object. The main difference is that the EJBHome name is defined
    thru the EJB deployment descriptors, not the web.xml.
    Thanks,
    Steve

    Ah, I was trying to do a lookup from session bean for the env-entry defined in
    the web.xml. After reading the J2EE spec, I see this just won't work. env-entries
    are only accessible from within the component where they are defined.
    Still the error message with "comp.env" instead of the expected "comp/env" is
    a bit confusing.
    Not much traffic in this newsgroup, is there?
    Steve
    "Steve Ditlinger" <[email protected]> wrote:
    >
    >
    >
    If I create an "env-entry" block for a name (e.g. "MySchemaName") in
    my web.xml
    file and deploy the web app, I should be able to look up the name from
    my webapp
    with the line:
    <br>
    myInitialContext.lookup("java:comp/env/MySchemaName");
    <br>
    However when I do that I get the error message:
    <br>
    javax.naming.NameNotFoundException: Unable to resolve 'java:comp.env/MySchemaName'
    <br>
    Note that the "comp/env" prefix has been changed to "comp.env". This
    worked under
    WL 6.1. Is this a bug in WL 7's JNDI or a bug in the error message or
    both or
    something else altogether?
    The immediately previous line successfully performs an EJBHome lookup
    using the
    same Initial Context object. The main difference is that the EJBHome
    name is defined
    thru the EJB deployment descriptors, not the web.xml.
    Thanks,
    Steve

  • Initializing Application Params (web.xml vs. Properties file)?

    Hi Friends,
    Basically a question where I do not have much experience...
    I think that I have the choice of initializing web application wide parameters either with:
    a) Properties file (text file as managed by the Properties framework) or,
    + Here it is easy to read, modify parameters, ...
    - I dislike the deployment (manual procedure of storing the file in a particular directory...)
    b) web.xml (deployment descriptor) and "context-param".
    - The problem here is that it does not seems "easy" to change the deployed values in a web.xml from a java program.
    + Very easy to deploy (war, ear files)
    I would like to implement a solution that is:
    * Easy for the end-user to change its values
    * Easy to deploy and configure
    From some testing, I think that the properties file (and framework) is a better solution, but not sure...Any more expert advice?
    Thanks in advance!

    A properties file is often used with parameters that vary depending on a particular Locale. Under these circumstances, I find it impractical to store the file in an archive because the user in a given Locale may want to use the original file as a template to create a new Locale-specific version.
    Whenever I need to initialize my application with parameters that are totally under my control (e.g., when the parameters do not vary by Locale but new ones may be added or old ones removed), I often use just a plain .txt file kept inside of an archive file like a jar and access it file with something like this:
    URL url=myDialog.class.getResource("Params/myParams.txt");
    That's just my 2-cents.
    V.V.

Maybe you are looking for

  • Exporting Text data from PHP to Oracle CLOB data (Carriage return - issue)

    This is my original text content in PHP - Data type - Longtext SECTION - 1 This a test description.This a test description. This a test description.This a test description. This a test description. This a test description.I exported the above content

  • How to NOT import from iPhone

    Currently when I connecet my iPhone 4s to my computer both iTunes and Aperture boot.  I want iTunes to do so, but do not want Aperture to boot.  I rarely import photos from my phone to Aperture.  The only choice I can find in Aperture preferences to

  • Salesman assignment for Customer

    Dear Friends, I would like to know, What are the options to assign Salesman to customers. We want to assign multiple salesman to one customer on one salesarea. Multiple salesman depend on diffrent product line. means Salesman 1 for Product group 1 Sa

  • BIC Transaction: Language Translation problem

    Hello All, the Input filed description of transaction" BIC" is coming in German language even though i am login into English. can anyone tell me what should i do in order to get the description in English?do i need to implement any OSS notes or some

  • Best Adobe reader plugin for Safari or firefox .

    Hi Folks. I am looking for the best plugin available for safari that will give me the functionality of adobe reader when viewing pdf documents using safari. Am i doing something wrong but i download pdf's to the desktop, i ctrl+click on them and sele