Deploy-time configuration

I'm converting a servlet-based application to a J2EE application and I would like suggestions on how to manage deploy-time configuration data.
I currently have an install program which takes information from the user, writes this to a .properties, then creates necessary databases.
If I put the properties into the application as JNDI variables, and rely on the J2EE impl's deploy tool to prompt the user for correct info, I don't think I have an opportunity in the process to run custom code and set up the database.
If, on the other hand, I make my installer the default class in the ear (ie allow java -jar foo.ear to run my install program), the user gets prompted for information, the databases created, but I can't see an easy way to get that information to the to-be-deployed application, short of rebuilding the ear on the fly.
This seems like a simple problem -- application needs to initialize back end database when deployed -- but I haven't seen it addressed anywhere.
I would be grateful for any suggestions or pointers.

Assuming (since you posted here) you have used a MVC architure as proposed
Add a new Admin action (request) that allows the configuration to be performed, this should be two stage process. Get the Config page and Post the Config page and configure. This action could be password protected, using the standard mechanism, if you envisage the config changing on an exisiting system, otherwise just prevent access if the config is defined.
Guard you application's normal actions and if the application is not configured then redirect to the Admin Action.

Similar Messages

  • Struts deploy-time configuration

    Datasources are configured in Struts in the <data-sources> section of struts-config.xml. This is fine during development as you know the database you are connecting to. But what happens when you want to create a generic War that can be deployed on an arbitary app server, even if you specify the server type (in our case Tomcat 4.1).
    The only option appears to be to let Tomcat deploy the war, then edit struts-config and re-load the application, remembering to delete the original War so that Tomcat doesn't re-deploy from that.
    This all seems particularly clunky. What I would like to do is have the application configure itself during deploy, probably from some kind of config file, or possibly from a config page in the application itself that is disabled / removed once the app is configured.
    So, does anyone know of an elegant or approved method of doing a deploy-time configuration of a war bundled web app?
    Regards
    AndyB

    Have you looked at declaring your data source via JNDI? i.e. use web.xml to specify the JNDI resource name and then specify details on the datasource in the server deployment. Details on implementing this in Tomcat are given in
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html

  • HttpProxyServlet need run-tim NOT deploy-time configuration

    HI,
    I've looked through a lot of the traffic and haven't seen
    anything along the lines of this question. I have a system
    which we compile and build and then start up in a specific
    mode (i.e. production, development etc). All of the config is
    done at application startup time (the config.xml file is dynamically generated).
    The problem is that when configuring the
    web.xml for the HttpProxyServlet we must enter in a URL for the
    redirect to go to. What I really want to do is along hte lines
    of entering in a property-name, the value of which will give me
    the URL, i.e. instead of:
    <servlet>
    <servlet-class>
    weblogic.t3.srvr.HttpProxyServlet
    </servlet-class>
    <init-param>
    <param-name>redirectURL</param-name>
    <param-value>http://myRedirectPort</param-value>
    </init-param>
    </servlet>
    I would like to do something like this :
    <servlet>
    <servlet-class>
    com.myapp.HttpProxyServlet
    </servlet-class>
    <init-param>
    <param-name>redirect-url-property-name</param-name>
    <param-value>
    my-prop-name.redirect-url
    </param-value>
    </init-param>
    </servlet>
    With the second one I would then pass in the property:
    -Dmy-prop-name.redirect-url=http://myRedirectPort
    Which would give me "run" (not deploy/build) time configuration
    of this URL.
    My question is:
    1. Has anyone done anything like this before ?
    2. Has anyone any knowledge/experience of subclassing the
    weblogic.t3.srvr.HttpProxyServlet ?
    3. Is there any way to do this type of thing in weblogic ?
    4. Would it be easier to write my own proxy servlet ?
    Any pointers to same appreciated.
    5. Is it programmatically easy/possible to register the
    HttpProxyServlet in my own hand written servlet.
    Any help very much appreciated.
    I have cross posted this because I think it is partly,
    environment, install based and partly servlet based.
    Thanks,
    Brian

    David,
    There are different options which you might try.
    1. At runtime, you can dynamically determine which sequence to call. For
    example, page 11-5 of the Getting Started Manual discusses an example of
    dynamically selecting different sequences to call.
    2. Also, there is an example on the web at www.ni.com/support/edp/
    Follow the link to TestStand and download Dynamically Determine Which Code
    Module to Run.
    3. Other options that you should consider is the Limit Loader step type.
    You can programmatically load any step property with the limit loader.
    There are shipping examples that use the Limit Loader and there are examples
    on the web.
    Best regards,
    Paul Mueller
    NI
    David Joyce wrote in message
    news:[email protected]..
    > We are currentl
    y evaluating TestStand as our future manufacturing test
    > engine.
    >
    > I'm not sure that this is the correct question, but can TestStand
    > sequences be loaded at run-time?
    >
    > We want to distribute the TestStand engine onto our manufacturing floor
    > as a functional test master program for all of our single board computer
    > UUTs. We need to be able to reconfigure TestStand for each type of UUT.
    >
    > These UUTs share the highest level of test sequences (e.g. RAM test, CPU
    > test, RTC test), however the UUTs may have major design differences that
    > make steps, or sequences, within the tests very different. For example:
    > UUTs may have different processors and require completely different CPU
    > tests, or the type and number of I/O may be completely different between
    > UUTs with identical processors.
    >
    > We want to build a set of directories with each one unique to a UUT.
    > TestStand would be instructed at run-time as to the UUT and configure,
    > or reconfigure, itself accordingly.
    >
    > Any sug
    gestions or examples would be appreciated.
    >
    > Thank you
    >

  • How to get deployment time of an J2EE application

    Hi All,
    I am developing J2EE applications on NetWeaver 7.0 and 7.1. In my application, I need to get deployment time of a J2EE application installed in the J2EE engine.
    For NetWeaver 7.1, I found SAP's Java APIs to do that:
          com.sap.engine.services.deploy.server.cache.dpl_info.Applications.get("appName").getMonitorData().getDateOfLastRedeployment();
    But for NetWeaver 7.0, I haven't found any similar stuffs.
    Could you give me any helps for the case of NetWeaver 7.0?
    Thank you very much.
    Viet

    I'm not 100% sure but you may be able to turn on tracing for the Java stack "Deploy" service.
    In Visual Administrator, go to "Global Conf [Server] -> services -> Deploy" change additional_debug_info.
    Then in "Cluster [server x] -> services -> log configurator [locations] -> com -> sap -> engine -> services -> deploy" change the debug level to "Info" or something.
    This should put some additional tracing out to the trace files which can be viewed in the Log Viewer.
    Don't forget to reset the trace level when you're done.

  • Build Extension Configuration / Deployment Extension Configuration

    Hello,
    I've been following the tutorial to build a Deployment Plan Modifier here (https://msdn.microsoft.com/en-us/library/dn268597%28v=vs.103%29.aspx), and I saw this post (http://blogs.msdn.com/b/ssdt/archive/2013/06/24/announcing-sql-server-data-tools-june-2013.aspx)
    that describes the addition of Build Extension Configuration and Deployment Extension Configuration files to  SSDT projects. I get the impression that maybe these files could be used to pass configuration information to a Deployment Plan Modifier, such
    as to define a custom upgrade action on a table.
    I cannot find any documentation that describes the purpose of Deployment Extension Configurations or how to create and use them (I have looked through SSDT documentation, blog posts etc.). Ideally, there should be documentation and a walk through available
    on MSDN for this. Has anybody else used them? Can anybody give an example of how to use them or point me in the direction of some documentation?
    Thanks
    Lipod

    Hi Lipod, your best place to get started with contributors is our
    API tutorial (see Solution 2: Filtering at deployment time) and our
    dacsamples project on Codeplex. These have more samples than the walkthrough and I think will be more useful in helping you get up and running.
    However, having taken a look at those they still don't cover Deployment Extension Configuration files so I'll do my best to explain here. Note: the next paragraph will probably answer your needs, I'm writing more in case others want to know how these can
    be used.
    Configuration with Deployment Contributor Arguments
    Deployment Contributor Arguments are key-value pairs that you would generally use to configure your contributor. A good example is the
    test code here, that shows how to configure whether ONLINE and MAXDOP values should be set when creating indexes. This is generally how you pass in simple configuration information and what we use in the samples.
    It's likely this will solve your requirements.
    Configuration with Deployment Extension Configuration Files
    Deployment Configuration Files define files that you'd like your contributor to process (note: this happens at build time), and possibly include in the dacpac for processing at the time your contributor runs. The best
    example of why you'd use this is if you wanted to include reference data (e.g. data to fill in a ZipCode table) in the dacpac and then add this to the deployment plan.
    To include these at build time you must define these in your .sqlproj file and also specify that your deployment contributor is required (e.g. include the <DeploymentContributors>...</DeploymentContributors> section per the
    walkthrough).
    You must also implement the
    OnEstablishDeploymentConfiguration and
    OnApplyDeploymentConfiguration methods.
    OnEstablish... runs at build time (project build or when building using the public APIs, which you can use for testing). The important thing to note is we don't save everything into the dacpac by default - you need to "opt in" by either
    copying an input file to the output "as is" or
    creating a new output file and saving data there. A good example of why this happens is that our pre/post deployment contributors merge multiple files into one single predeploy.sql/postdeploy.sql file. 
    OnApply... runs at the start of the deployment process and gives you a chance to setup your contributor based on the config files in the dacpac. If you copied an input file/opened an output file it'll be in the dacpac, and now is your chance to get it out.
    You can then use it later during the Execute phase.
    If you're wondering "why not let me just read my files during OnExecute", really this comes down to a design decision based on ensuring deployment proceeds reliably and all resources are released correctly, with no conflicts on who has access
    to a resource. 
    For the example of reference data, you would:
    - Define the "DeployReferenceData" contributor in your project, and specify the deployment configuration files.
    - The contributor would read reference data files during OnEstablish and state they should be saved in the dacpac. 
    - During build the OnEstablish method will be called (since you specified your contributor's name in the project properties) and the files are saved into the dacpac. It's a zip file, so you can verify that a folder containing the files exists inside the
    dacpac.
    - At deploy time, during OnApply it would read all reference data files out into memory / file storage if too large. It would also set up some kind of reference to their location or even a nice mapping table (table name -> Reference data).
    - At deploy time, during OnExecute it would then add in DeploymentSteps that update the data in the tables using TSQL code. Note that this is another limitation of the current system - we don't suport a generic "Execute" method that could programmatically
    be used to deploy a BCP file, for example. If this is something you need, please open a Connect ticket :-)
    - At deploy time, all steps in the plan are executed. Assuming you programmed your TSQL code to use Merge statements or another idempotent process the update should go correctly. If you wrote "Insert" statements there's a good chance it would fail
    on a 2nd deployment.
    Conclusions
    The key takeaways are that contributor arguments should solve most of your problems, but for advanced scenarios involving data that can't be defined in a key-value pair of strings then config files are a good alternative. They have some limitations
    but provide great power to solve problems. Also the samples are a good place to start for all of this work.
    If you have requests for additional samples in this area, or for improvements to the API layer, then open Connect bugs with a good scenario description and we will at least keep this as open issues to be tracked for possible future improvements.
    Regards,
    Kevin

  • VM's resetting after deploying a configuration in Lab Manager 4.0.4

    H iGuys,
    Got a problem which i can't figure out.  I have imported some VM's into our Lab Manager 4.0.4 setup and put them into the VM templates area (5 VM's in total, 2x windows 2008, 2 x windows 2003, and a unix).  I then deploy them to ensure that they have imported ok, and they are fine, the static IP's are still in place as they should be, services start, and everything is fine.
    So I then create a fenced configuration with the VM's in it, and deploy that configuration.  when the VM's come up the windows 2008/windows 7 VM's run a windows configuration setup, and reboot again.  When allthe VM's are up, they have all lost their static IP settings , and have been replaced by DHCP IP's.
    I've now tried this with 2 VM sets and it does the same.  I don't understand why the VM's work perfectly in the VM Templates, but as soon as i put them into a configuration they change.
    Has anyone else seen this  we have another setup in the the US on the same version of Lab Manager and the VM's work fine.
    Mike

    so here is the workflow difference you are seeing.
    If you go from VM template to Workspace Configuration, it is "more normal" to perform guest customization.  You'll also get a new MAC address and UUID in the VM.  So be aware there are changes being made, and you'll have to re-configure network at minimum to use the assigned IP with fencing.
    HOWEVER ... there is an easier method.
    If you have several VMs in a pre-defined config that you want to use over and over ... That's what the Library is for.  Made a configuration, save to library.
    When you clone from Library to Workspace, Guest Customization is NOT performed as the Configuration is pre-defined and configured.  The Fencing will automatically accomodate the existing IP structure and you don't have to modify the VMs at all.
    This also saves you from having to build a configuration each time, and you can copy Some or All of a Library item to your workspace.
    Best Regards,
    Jon Hemming

  • HttpProxyServlet - need run-time config NOT deploy-time

              HI,
              I've looked through a lot of the traffic and haven't seen
              anything along the lines of this question. I have a system
              which we compile and build and then start up in a specific
              mode (i.e. production, development etc). All of the config is
              done at application startup time (the config.xml file is dynamically generated).
              The problem is that when configuring the
              web.xml for the HttpProxyServlet we must enter in a URL for the
              redirect to go to. What I really want to do is along hte lines
              of entering in a property-name, the value of which will give me
              the URL, i.e. instead of:
              <servlet>
              <servlet-class>
              weblogic.t3.srvr.HttpProxyServlet
              </servlet-class>
              <init-param>
              <param-name>redirectURL</param-name>
              <param-value>http://myRedirectPort</param-value>
              </init-param>
              </servlet>
              I would like to do something like this :
              <servlet>
              <servlet-class>
              com.myapp.HttpProxyServlet
              </servlet-class>
              <init-param>
              <param-name>redirect-url-property-name</param-name>
              <param-value>
              my-prop-name.redirect-url
              </param-value>
              </init-param>
              </servlet>
              With the second one I would then pass in the property:
              -Dmy-prop-name.redirect-url=http://myRedirectPort
              Which would give me "run" (not deploy/build) time configuration
              of this URL.
              My question is:
              1. Has anyone done anything like this before ?
              2. Has anyone any knowledge/experience of subclassing the
              weblogic.t3.srvr.HttpProxyServlet ?
              3. Is there any way to do this type of thing in weblogic ?
              4. Would it be easier to write my own proxy servlet ?
              Any pointers to same appreciated.
              5. Is it programmatically easy/possible to register the
              HttpProxyServlet in my own hand written servlet.
              Any help very much appreciated.
              I have cross posted this because I think it is partly,
              environment, install based and partly servlet based.
              Thanks,
              Brian
              

    7) Miscellaneous Stuff 
    A) Error Messaging
    If the Enhanced DSC Run Time is required but you do not check it in the build spec I got the following errors on running the application:
    The messages are not informative at all.
    Can't this be handling automatically?
    Can't this get flagged earlier when you are building?
    B) Build Error
    This one may or may not be DSC specific, but the following type of Build Errors are not very helpful: 
    C) Build Spec Info
    Something I noticed - the Build Spec contains no info about it. 
    All the other options do.
    Certified LabVIEW Architect * LabVIEW Champion

  • Studio Creator deployment time

    I have been using both Netbeans 5 and Studio Creator 2. When running a web app from Netbeans it starts up very quickly. When I create a web app in JSC, it takes quite a bit longer to deploy (...stopping...starting... messages etc. for a while). This is a bit frustrating for iterative development.
    Any chance of improving the deploy time for the next release. Better still, is there a way I can configure the current system to load web apps faster when I hit "run".
    thanks in advance

    Hi Fred,
    I'll tell you the way you can reduce deployment time down to your 1..2 seconds:
    1. Go to 'Projects' pane, select your one, right click and Properties.
    2. In Project properties window go to Libraries, deselect the ones that have been added to your project. For instance I use Oracle JDBC driver and an appropriate JAR files together with checkbox have been added to project.
    3. Also deselect 'Build Required Projects' checkbox at the bottom.
    4. Go to bundled with JSC2 Sun Application Server 8.x and add these JAR files to lib\ext directory (e.g. C:\Sun\Creator2_1\SunAppServer8\domains\creator\lib\ext).
    5. Go back and try to redeploy. You got your 1..2 sec
    P.S. Which PC do you use by the way? I have pretty powerful one with RAID and got 2..3 sec only.
    Kind regards,
    Alex

  • Annotations: set value of ActivationConfigProperty at deployment time

    I have a MDB which is triggered by Quartz each interval. The interval is set by the annotation property 'cronTrigger':
    @MessageDriven(activationConfig =
       @ActivationConfigProperty(propertyName="cronTrigger", propertyValue="0/20 * * * * ?")
    @ResourceAdapter("quartz-ra.rar")
    public class QuartzGenericMDBBean implements Job
         public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException
                    //handle code
    }I want to move the value of cronTrigger ("0/20 * * * * ?" for this example) outside my .ear file to a configuration file, so I can change the value without compiling and packaging the .ear file. Moving the value to the ejb-jar.xml file will not help either, because this file is still included in the .ear file.
    Is it possible to set this property or annotation properties in general at deployment time, and are there some code examples available?
    Best regards,
    Ronald Izaks

    How about configuring it as a context parameter, if it's just a String.
    ***Annie***

  • Error -: AIP-18510 while deploying a configuration in B2B

    Hi All,
    I am getting the following error while deploying a configuration in B2B.
    Could someone please let me know why is this occurring since from the error there does not seem to be any set-up issue. It looks like some Internal Error.
    If somebody has faced the same similar, please let me know what do we need to do to fix it.
    Thanks In Advance,
    Dibya

    Hi Ramesh,
    This issue is resolved. I just restarted the B2B server and then I deployed the configuration. It went through fine. I am not sure why the B2B Server is behaving inconsistently.
    I am surprised as to how a simple restart can solve the issue.
    Please let me know if you have any inputs on this.
    Thanks
    Dibya

  • Real time configurations for derivation types in COPA

    We have taken the sample operating concern by going thru the path
    < IMG Activity: Controlling - operating concern - sap operating concern template >, the Quickstart S-GO operating concern template>
    and configured the following derivation types by looking at the examples:
    - Derivation rule
    - Table lookups
    - Moves
    - Clear
    -Customer Enhancement
    Also, it would be great if some one could provide me with real time configuration of the derivation types in COPA
    Moderator: Please, read the rules of the forum before posting

    Hi Praveen
    Rec Type for Variance transactions is already fixed i.e. C and cant be changed....
    You can use Z rec types in KE21N for manual postings/adjustments.... Or during external data transfer
    If you can be specific on your requirement, we can discuss further using Exit COPA0002 or 0005... But for standard transactions, you cant change the rec types
    Br, Ajay M

  • Is it possible to use run-time configuration in conjunction with Session Manager?

    I'm trying to avoid using MAX, basically because it's a pain for users to configure MAX when the application already knows what the configuration is. I actually get the configuration from a database, but that's another story. I've experimented with run-time configuration (see page 4-31 of the 'IVI Driver Toolset' manual) and it works fine. However, when I try to use this in conjunction with Session Manager, session manager complains that my logical name is not a driver session name. I suspect that Session Manager is looking up logical names from a different source, therefore run-time configuration won't work. Any suggestions? I've attached the files I'm working with.
    Attachments:
    SessionMgrTrial.zip ‏41 KB

    Hello Mark:
    The Session Manager GetLogicalNames method does not distiguish between logical names and virtual instrument names. A user of the method cannot ask for just logical names or just virtual instrument names. Right now you always get both. The new function is called InstrSessionMgr.GetNames. Notice that the online help file says Boolean for the flags parameter when it is an enum.
    Hope this helps. If you have any further queries, please let us know.
    -NI support
    National Instruments - Software IS the instrument!
    Attachments:
    help.gif ‏22 KB

  • Jndi data source references at deployment time

    hi,
    i have been thinking and trying for days now, so any hint is greatly appreciated.
    we have an enterprise java application with adf faces, bc4j and jpa all in one ear which runs on weblogic 10.3. we want several instances of the same application running on the same weblogic server, with different context-root's and database connections. what I don't know how to do is how I could create an application-wide jndi link to a jdbc data source at deployment time - because the data source jndi name is listed in bc4j application modules and persistence.xml - so one global jndi link for the application would be great.
    e.g.
    jndi names of data sources installed in the weblogic server:
    jdbc/customer1
    jdbc/customer2
    deployment1:
    context-path: /app-customer1
    local data source name: java:comp/env/jdbc/customer
    deployment 2:
    context-path: /app-customer2
    local data source name: java:comp/env/jdbc/customer
    so the goal is, at deployment time, to create a link to jdbc/customer1 for the first deployment and jdbc/customer2 for the second deployment using .. ?
    thank you very much,
    matt

    hi Anand,
    thank you for your answer. It is indeed a part of the solution I would need to apply - resource references in web.xml to have the bc4j application modules reference a jndi data source under java:comp/env. The other part to it is that we have an ejb jar in our jee application, built with hibernate and a persistence.xml file (yes we are crazy enough to use both bc4j and jpa in one ear). The jndi name of the data source specified in persistence.xml would not pick up a resource reference specified in web.xml would it - actually i should just try this out. So that's the 2nd part of the solution.
    cheers,
    Matt

  • Deployment specific configuration - best practice

    I'm trying to figure out the best way to set-up deployment specific configurations.
    From what I've seen I can configure things like session timeouts and datasources. What I'd like to configure is a set of programmatically accessible parameters. We're connecting to a BPM server and we need to configure the URL, username and password, and make these available to our operating environment so we can set-up the connection.
    Can we set-up the parameters via a deployment descriptor?
    What about Foreign JNDI? Can I create a simple JNDI provider(from a file perhaps?) and access the values?
    Failing these, I'm looking at stuffing the configuration into the database and pulling it from there.
    Thanks

    Which version of the product are you using?
    Putting the configs in web.xml config params as in this example:
    https://codesamples.samplecode.oracle.com/servlets/tracking/remcurreport/true/template/ViewIssue.vm/id/S461/nbrresults/103
    Will allow you to change the values per deployment easily with a deployment plan.
    Another alternative 10.3.2 and later is to use a features that allows resources like normal properties files to be overloaded by putting them in the plan directory. I don't have the link to this one right now.

  • First time configuring Sol9 built-in SunONE Directory Server

    Hi!
    I'm using Solaris 9 Sparc and I'm trying to configure the SunONE Directory Server included with Sol9.
    When I type :
    directoryserver startconsole , it asks for :
    UserID
    Password
    Administration URL
    but how can I specify these info if it's a first time configuration ?

    Because I have it on a Netra T1 AC200 without video card and I can't find the Directoryserver binary...

Maybe you are looking for

  • Capture of excise invoice in MIGO for depot

    Hi,         We have one depot plant as per regular process we do the GR with MB01  and then J1IG  for capturing of excise duty which update the RG23D entry,  now i want to know  what is the difference  if we do this in MIGO  so that both this can be

  • I want to cancel my broadband and pay off my debt.

    Recently I was shocked to discover that my direct debit had been altered to £73.50 a month! I was informed, upon contacting your billing people, that this was due to a number of phone calls I had made.  I have since discovered that the internet phone

  • What is the best practice on mailbox database size in exchange 2013

    Hi,  does anybody have any links to good sites that gives some pros/cons when it comes to the mailbox database sizes in exchange 2013? I've tried to google it - but hasn't found any good answers. I would like to know if I really need more than 5 mail

  • How do i get my hp laptop to boot without the recovery disc?

    I have an HP 2000 laptop that dumped it's files when I tried to restart.  I put in Norton 360 2012 version and it was cleaning up virus' when I told it to restart.

  • How can I download a Complete Driver Package for L500-20X

    Hello on the Toshiba Driver Page i only found Single Drivers and i must Download to much as Single Files. How can i Download a Complete Driver Package as ZIP/RAR or Image DVD or CD. I dont want to Download 30 or 40 Single Drivers for my Toshiba , one