Creating an application updater

Firstly, I'm not new to programming per say, but I'm certainly not accomplished by any means! I have limited knowledge to put it mildly and always worry I'm not doing it "right" (if there is a right way).
I know, JWS etc - I tried it, and one grumble was that my applications listener (I assume it was the action listener I had on the button) didn't work anymore - when clicking the button the file browser dialog box failed to appear (not an issue as long as it's not a webstart).
It also felt a bit of a cheat... I didn't know how to make an updater, just used an existing solution (I'm aware this may be an instance where JWS is the right way..). However, I wanted to try making one myself and so that's what I tried to do.
So I made one, but it took 2 Jar files. I'm sure there are more elegant solutions - hence the thread.
Currently - you start the application, you may check for updates. If one is available, you are given the option to update or not. If no update (or choose not to update), you continue.
If there is an update, the second Jar is executed, and the first one closes itself. This is because the second Jar displays a little interface showing the download progress, before essentially over-writing the first Jar's install with the new one. It then re-opens the main application, and exits itself (so now the updated application is running, and the updater is closed).
I feel this is bulky. Trying to overwrite a Jar currently in use failed though... is there a way to go about this so that I could just use one Jar file?
Does anyone have any suggestions for more elegant (or proper) solutions, without JWS is preferable as I prefer to learn how to do things, instead of using existing pre-packaged solutions. Yes, JWS looks great but it neither satisfied my curiosity nor my desire to learn how to do it myself.
Also, afaik, JWS keeps the program in Cache, instead of it's own location? I also had issues that one of my applications button has a listener that opens a file dialog browser. Works perfectly fine, until I tried JWS - at which point clicking the button does nothing, but unsure why!
Code? Too long to put in, but to give the gist of what happens:
This is the "check for updates" within the main application. The "check update" method returns true/false depending upon whether an update is available. Currently it checks a file on a server (which holds the version number of the application they may download) and a local file holding the current application installed version number. Is there a better way to check version numbers than read txt files? I couldn't locate anything that shows version numbers in my Jar's, maybe I'm missing something?
jMenuItem1.addActionListener(new ActionListener(){
           public void actionPerformed(ActionEvent e){
               if(checkUpdate()){// is there one?
                   if(showConfirmDialog("Would you like to update now?", "Update Available")){ // would they like to update?
                        String cmd = "javaw -jar updater.jar";
                        try {
                            Runtime.getRuntime().exec(cmd);
                        } catch (IOException ex) {
                            Logger.getLogger(FLScanner.class.getName()).log(Level.SEVERE, null, ex);
                    exit(); // close this application
                } else {
                   showMessage("No new update available", "Up to date!"); // display no update available
        });This is the updaters code, it has already downloaded the newest applications jar file (with a different name) and then performs this. It also updates the locally held version number with the new version number as well.
File oldFile = new File("Application.jar");
if(oldFile.exists()){
            oldFile.delete();
            File newFile = new File("Application_update.jar");
            newFile.renameTo(new File("Application.jar"));
            jLabel1.setText("Restarting Application...");
            try {
                Thread.sleep(1000); // gives chance for the rename to have occured before starting!!
            } catch (InterruptedException ex) {
                Logger.getLogger(Updater.class.getName()).log(Level.SEVERE, null, ex);
            String cmd = "javaw -jar Application.jar"; // command to run the new jar
            try {
                Process proc = Runtime.getRuntime().exec(cmd); // run it.
            } catch (IOException ex) {
                // handle this, somehow.
            this.dispose();// close the updaterI know there is insufficient error handling at present, but I thought it best to get some feedback if anyone is willing :)

Did you sign your jar file for JWS? I don't think the security manager will allow a filebrowser if the jar is not signed.
Edited by: Plee on Dec 29, 2008 6:54 AM

Similar Messages

  • Creating partner application in Oracle

    $ORACLE_HOME/sso/bin/ssoreg.sh
    -oracle_home_path <oracle_home_path>
    -config_sdk_papp TRUE -site_name SSO_APEX
    -home_url http://hal-00-dbs-08.hal.net:7777/pls/apex
    -success_url http://hal-00-dbs-08.hal.net:7777/pls/apex/wwv_flow_custom_auth_sso.pro
    cess_success
    -logout_url http://hal-00-dbs-08.hal.net:7777/pls/apex
    -u cn=orcladmin
    -papp_schema <apex schema>
    -cancel_url http://hal-00-dbs-08.hal.net:7777/pls/apex
    -papp_schema <apex schema> what goes here?

    Please tell us your first name and update your forum profile with it to assist us. Thanks.
    Where did you get that script and what are you trying to do, exactly (generally, I got that your aim is "creating partner application in Oracle").
    Scott

  • Creating partner application in Oracle Portal

    $ORACLE_HOME/sso/bin/ssoreg.sh
    -oracle_home_path <oracle_home_path>
    -config_sdk_papp TRUE -site_name SSO_APEX
    -home_url http://hal-00-dbs-08.hal.net:7777/pls/apex
    -success_url http://hal-00-dbs-08.hal.net:7777/pls/apex/wwv_flow_custom_auth_sso.pro
    cess_success
    -logout_url http://hal-00-dbs-08.hal.net:7777/pls/apex
    -u cn=orcladmin
    -papp_schema <apex schema>
    -cancel_url http://hal-00-dbs-08.hal.net:7777/pls/apex
    -papp_schema <apex schema> what goes here?

    Please tell us your first name and update your forum profile with it to assist us. Thanks.
    Where did you get that script and what are you trying to do, exactly (generally, I got that your aim is "creating partner application in Oracle").
    Scott

  • The new updated version of iMovie 10 won't let me open my previous files I created before the update today. I have a wedding that I'm trying to finish and deliver and now I can't because that file version won't open. I keep getting an error message

    Hello,
    Please help me figure this out. I'm very unhappy at the moment. I'm fustrated and don't have any idea how to revert to the original version before the update was done on iMovie 10. I NEVER hated APPLE until NOW!! I love APPLE products and apps so please help me stay in that mindset. So I worked on some movie projects when I got my macbook pro 6 months ago. I update reguarly. I saw the update prompt and honestly, I did not think I would have ANY issuess with opening my previous files that I created only a few months ago with this updated version.The new updated version of iMovie 10 won't let me open my previous files I created before the update today. I have a wedding that I'm trying to finish and deliver and now I can't because that file version won't open. I keep getting an error message and the iMovie app closes. Last night I saw the file and tried to open it but no luck. Error message came up again. I reboot and turned off my laptop for the evening and tried again just now but nothing!! I need that video. My job depends on it! I worked so hard on this wedding video and now it's lost and won't open. I work another job and don't have much time. I really don't want to start all over again. Please help me. Thanks so much for your assistance.
    Fustrated APPLE customer
    Jolly A. Rupp

    I also have Jolly's problem. I found the iMovie 9.0.9 folder and tried to launch the older version of iMove. It would not launch. I removed all of the iMovie preferences from the Preferences folder, removed iMove 10 from the applications folder, and restarted my Mac. iMove 9.0.9 still won't launch and I can't access my videos created with the older version of iMovie. Is there a way to uninstall iMovie 10 and reinstall iMovie 9.0.9?
    I am running Yosemitie on a  iMac.
    Paul

  • Error in creating web application through power shell

    hi,
     i have taken the  ps script from the  below url :
    credits to Roger  :
    http://blogs.msdn.com/b/rcormier/archive/2012/09/01/how-to-create-sharepoint-web-applications-with-powershell.aspx
    http://gallery.technet.microsoft.com/Create-SharePoint-Web-742a8fb9
    But when i am running the script, i am getting many errors:
    Note: i am not using appln pool account password [as i dont know the password]
    want to know whether  this paramter is necessary.
    $ver = $host | select version
    if($Ver.version.major -gt 1) {$Host.Runspace.ThreadOptions = "ReuseThread"}
    if(!(Get-PSSnapin Microsoft.SharePoint.PowerShell -ea 0))
    Write-Progress -Activity "Loading Modules" -Status "Loading Microsoft.SharePoint.PowerShell"
    Add-PSSnapin Microsoft.SharePoint.PowerShell
    Write-Progress -Activity "Creating Web Application" -Status "Setting Variables"
    #Set Individual Web App Variables
    #This is the Web Application URL
    $WebApplicationURL = "http://mysrvr:2020/"
    #This is the Display Name for the SharePoint Web Application
    $WebApplicationName = "myweb1"
    #This is the Content Database for the Web Application
    $ContentDatabase = "myContentDB"
    #Set Common Variables
    #This is the Display Name for the Application Pool
    $ApplicationPoolDisplayName = "mapppool2020"
    #This is identity of the Application Pool which will be used (Domain\User)
    $ApplicationPoolIdentity = "mydomain\myidd"
    #This is the password of the Appliation Pool account which will be used
    #$ApplicationPoolPassword = "Pass@word1"
    #This is the Account which will be used for the Portal Super Reader Account
    $PortalSuperReader = "i:0#.w|in\hariharan.venugopalk"
    #This is the Account which will be used for the Portal Super User Account
    $PortalSuperUser = "i:0#.w|in\spinstall.dev"
    Write-Progress -Activity "Creating Web Application" -Status "Loading Functions"
    #Create Functions
    Function CreateClaimsWebApp($WebApplicationName, $WebApplicationURL, $ContentDatabase, $HTTPPort)
        #AppPoolUsed is set when calling the ValidateAppPool function. This will be true if the application pool is already running SharePoint web appplications
        #If the application pool is already being used in web applications, the syntax for New-SPWebApplication changes
        if($AppPoolUsed -eq $True)
            #Create the web application, assign it to the WebApp variable.  The WebApp variable will be used to set object cache user accounts
            Write-Progress -Activity "Creating Web Application" -Status "Using Application Pool With Existing Web Applications"
            Set-Variable -Name WebApp -Value (New-SPWebApplication -ApplicationPool $ApplicationPoolDisplayName -Name $WebApplicationName -url $WebApplicationURL -port $HTTPPort -DatabaseName $ContentDatabase -HostHeader $hostHeader
    -AuthenticationProvider (New-SPAuthenticationProvider)) -Scope Script
            #Call the SetObjectCache function, which sets the object cache.
            Write-Progress -Activity "Creating Web Application" -Status "Configuring Object Cache Accounts"
            SetObjectCache
        else
            #Create the web application, assign it to the WebApp variable.  The WebApp variable will be used to set object cache user accounts
            Write-Progress -Activity "Creating Web Application" -Status "Using Application Pool With No Existing Web Applications"
            Set-Variable -Name WebApp -Value (New-SPWebApplication -ApplicationPool $ApplicationPoolDisplayName -ApplicationPoolAccount $AppPoolManagedAccount.Username -Name $WebApplicationName -url $WebApplicationURL -port $HTTPPort
    -DatabaseName $ContentDatabase -HostHeader $hostHeader -AuthenticationProvider (New-SPAuthenticationProvider)) -Scope Script
            #Call the SetObjectCache function, which sets the object cache.
            Write-Progress -Activity "Creating Web Application" -Status "Configuring Object Cache Accounts"
            SetObjectCache
    Function ValidateURL($WebApplicationURL)
        #Find out if a web application with the target URL exists
        if(get-spwebapplication $WebApplicationURL -ErrorAction SilentlyContinue)
            #If a web application with the specifid URL already exists, wait 5 seconds and exit
            Write-Progress -Activity "Creating Web Application" -Status "Aborting Process Due To URL Conflict"
            Write-Host "Aborting: Web Application $WebApplicationURL Already Exists" -ForegroundColor Red
            sleep 5
            #Setting the CriticalError value to $True results in the script to not create anything
            Set-Variable -Name CriticalError -Value $True
        #If the WebApplicationURL passed is not already a SharePoint web application, find out if it starts with HTTP or HTTPS
        elseif($WebApplicationURL.StartsWith("http://"))
                #If the string starts with http://, and not https://, trim the protocol from the URL.  Set the host as the host header
                Set-Variable HostHeader -Value ($WebApplicationURL.Substring(7)) -Scope Script
                #If we're using HTTP, use port 80
                Set-Variable -Name HTTPPort -Value "80" -Scope Script
            elseif($WebApplicationURL.StartsWith("https://"))
                #If the string starts with https://, and not http://, trim the protocol from the URL.  Set the host as the host header
                Set-Variable HostHeader -Value ($WebApplicationURL.Substring(8)) -Scope Script
                #If we're using HTTPS, use port 443
                Set-Variable -Name HTTPPort -Value "443" -Scope Script
    Function ValidateAppPool($AppPoolName, $WebApplicationURL)
        #Change the ErrorActionPreference to SilentlyContinue while preserving the original value in a temporary variable
        #Failing to do this will result in error messages being displayed if Get-WebAppPoolState does not return an object.  The script would still continue
        $CurrentErrorActionPreference = $ErrorActionPreference
        $ErrorActionPreference = "SilentlyContinue"
        #Check to see if an application pool with the name passed by the AppPoolName variable already exists, assign this to a variable.
        #This variable will be used in order to determine if the application pool exists, but is not part of SharePoint
        $TestAppPool = Get-WebAppPoolState $AppPoolName
        #If we have a SharePoint application pool with the value passed by the AppPoolName variable, find out if there are any sites using that app pool
        #This changes the syntax used with New-SPWebApplication
        if(Get-SPServiceApplicationPool $AppPoolName)
            #Return all application pools used by all web applications
            $AppPools = Get-SPWebApplication | select ApplicationPool
            #Providing there is more than one application pool, find out what their names are
            if($AppPools)
                foreach($Pool in $AppPools)
                    #Get The application pool display name for each application pool returned
                    [Array]$Poolchild = $Poolchild += ($Pool.ApplicationPool.DisplayName)
                    #If any application pool matches the value passed by ApplicationPoolDisplayName, set AppPoolUsed to True
                    #This is referenced in the CreateClaimsWebApp function
                    if($Poolchild.Contains($ApplicationPoolDisplayName))
                        Set-Variable -Name AppPoolUsed -Value $True -Scope Script
                    #If the application pool display name does not match the value passed by ApplicationPoolDisplayName, set AppPoolUsed to False
                    #This is referenced in the CreateClaimsWebApp function
                    else
                        Set-Variable -Name AppPoolUsed -Value $False -Scope Script
            #Since this is a SharePoint Application Pool, set the AppPool value to the the SPServiceApplicationPool object returned
            Set-Variable -Name AppPool -Value (Get-SPServiceApplicationPool $AppPoolName) -scope Script
            #Set the AppPoolManagedAccount variable to the name of the managed acount used by the application pool returned
            #AppPoolManagedAccount is used in the CreateClaimsWebApp function if the application pool does not have existing web applications that are using it
            Set-Variable -Name AppPoolManagedAccount -Value (Get-SPManagedAccount | ? {$_.username -eq ($AppPool.ProcessAccountName)}) -scope Script
        #Check to see if the application pool is in IIS, but is not a SharePoint app pool
        elseif($TestAppPool)
            #If the application pool exists in IIS and is not a SharePoint application pool, abort the script by setting CriticalError to True
            Write-Host "Aborting: Application Pool $AppPoolName already exists on the server and is not a SharePoint Application Pool `n`rWeb Application `"$WebApplicationURL`" will not be created" -ForegroundColor
    Red
            Set-Variable -Name CriticalError -Value $True
        #If it's not a SharePoint app pool, and it doesn't exist in IIS, we have to create one
        elseif(!($TestAppPool))
            #Find out if a managed account exists by calling the ValidateManagedAccount function
            validateManagedAccount $ApplicationPoolIdentity
            #If the managed account exists, create an application pool using the existing managed account
            if($ManagedAccountExists -eq $True)
                #Set the AppPoolManagedAccount to the identity of the managed acocunt referenced by the ApplicationPoolIdentity variable
                Write-Host "Creating New App Pool using Existing Managed Account"
                Set-Variable -Name AppPoolManagedAccount -Value (Get-SPManagedAccount $ApplicationPoolIdentity | select username) -scope "Script"
                #Create a new SPServiceApplicationPool, assign that to the AppPool variable
                Set-Variable -Name AppPool -Value (New-SPServiceApplicationPool -Name $ApplicationPoolDisplayName -Account $ApplicationPoolIdentity) -scope "Script"
            #If there is no managed account matching the account referenced by the ApplicationPoolIdentity, create it
            else
                #Use the ApplicationPoolIdentity and ApplicationPoolPassword to create a credential object
                #This is necessary when creating a new managed account
                Write-Host "Creating New Managed Account And App Pool"
                $AppPoolCredentials = New-Object System.Management.Automation.PSCredential $ApplicationPoolIdentity, (ConvertTo-SecureString $ApplicationPoolPassword -AsPlainText -Force)
                #Create a new managed account, assign that to the AppPoolManagedAccount variable
                Set-Variable -Name AppPoolManagedAccount -Value (New-SPManagedAccount -Credential $AppPoolCredentials) -scope "Script"
                #Create a new application pool using the new managed account, assign this to the AppPool variable
                Set-Variable -Name AppPool -Value (New-SPServiceApplicationPool -Name $ApplicationPoolDisplayName -Account (get-spmanagedaccount $ApplicationPoolIdentity)) -scope "Script"
        #Return the ErrorActionPreference to the default value
        $ErrorActionPreference = $CurrentErrorActionPreference
    Function ValidateManagedAccount($ApplicationPoolIdentity)
        #Find out if the manage account referenced by the AppPoolIdentity already exists
        #If it does, set ManagedAccountExists to True
        if(Get-SPManagedAccount $ApplicationPoolIdentity -ErrorAction SilentlyContinue)
            Set-Variable -Name ManagedAccountExists -Value $True -Scope Script
        #If it does not, set ManagedAccountExists to False
        else
            Set-Variable -Name ManagedAccountExists -Value $False -Scope Script
    Function ClearScriptVariables
        #Set the ErrorActionPreference to SilentlyContinue
        #If this is not set, and the script variables referenced have not been set, an error message will be returned.  The script would still continue
        $CurrentErrorActionPreference = $ErrorActionPreference
        $ErrorActionPreference = "SilentlyContinue"
        #Remove the CriticalError variable
        Remove-Variable $CriticalError -ErrorAction SilentlyContinue
        $ErrorActionPreference = $CurrentErrorActionPreference
    Function SetObjectCache
        #Set object cache user account properties based on the value of the parameters supplied
        $WebApp.Properties["portalsuperuseraccount"] = $PortalSuperUser
        $WebApp.Properties["portalsuperreaderaccount"] = $PortalSuperReader
        #Create a New Policy for the Super User
        $SuperUserPolicy = $WebApp.Policies.Add($PortalSuperUser, "Portal Super User Account")
        #Assign Full Control To the Super User
        $SuperUserPolicy.PolicyRoleBindings.Add($WebApp.PolicyRoles.GetSpecialRole([Microsoft.SharePoint.Administration.SPPolicyRoleType]::FullControl))
        #Create a New Policy for the Super Reader
        $SuperReaderPolicy = $WebApp.Policies.Add($PortalSuperReader, "Portal Super Reader Account")
        #Assign Full Read to the Super Reader
        $SuperReaderPolicy.PolicyRoleBindings.Add($WebApp.PolicyRoles.GetSpecialRole([Microsoft.SharePoint.Administration.SPPolicyRoleType]::FullRead))
        #Commit these changes to the web application
        $WebApp.Update()
    #Script
    #Call the ClearScriptVariables function to empty out varialbes that should be blank when the script executes.
    ClearScriptVariables
    #Validate the URL passed by calling the ValidateURL function
    Write-Progress -Activity "Creating Web Application" -Status "Validating Web Application URL Variables"
    ValidateURL $WebApplicationURL
    #Validate the application pool variables by calling the ValidateAppPool function
    Write-Progress -Activity "Creating Web Application" -Status "Validating Application Pool Variables"
    ValidateAppPool $ApplicationPoolDisplayName $WebApplicationURL
    #As long as CriticalError has not been set, create the web application using the variables passed.
    if(!($CriticalError))
    Write-Progress -Activity "Creating Web Application" -Status "Creating Claims-Based Web Application"
    CreateClaimsWebApp $WebApplicationName $WebApplicationURL $ContentDatabase $HTTPPort
    error  is thrown below:
    deployment
    S D:\myworkspace\bif> iisreset
    ttempting stop...
    nternet services successfully stopped
    ttempting start...
    nternet services successfully restarted
    S D:\myworkspace\bif> .\CreateSP2013ClaimsWebApplication.ps1
    reating New Managed Account And App Pool
    ew-SPWebApplication : "mysrvr:2020/" contains invalid character ':'.
    t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:68 char:43
             Set-Variable -Name WebApp -Value (New-SPWebApplication
    ApplicationPool  ...
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~
       + CategoryInfo         
    : InvalidData: (Microsoft.Share...PWebApplication:
      SPCmdletNewSPWebApplication) [New-SPWebApplication], ArgumentException
       + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPWeb
      Application
    annot index into a null array.
    t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:235 char:5
         $WebApp.Properties["portalsuperuseraccount"] = $PortalSuperUser
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       + CategoryInfo         
    : InvalidOperation: (:) [], RuntimeException
       + FullyQualifiedErrorId : NullArray
    cannot index into a null array.
    t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:236 char:5
         $WebApp.Properties["portalsuperreaderaccount"] = $PortalSuperReader
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       + CategoryInfo         
    : InvalidOperation: (:) [], RuntimeException
       + FullyQualifiedErrorId : NullArray
    ou cannot call a method on a null-valued expression.
    t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:239 char:5
         $SuperUserPolicy = $WebApp.Policies.Add($PortalSuperUser, "Portal Super
    ser ...
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~
       + CategoryInfo         
    : InvalidOperation: (:) [], RuntimeException
       + FullyQualifiedErrorId : InvokeMethodOnNull
    ou cannot call a method on a null-valued expression.
    t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:242 char:5
    SuperUserPolicy.PolicyRoleBindings.Add($WebApp.PolicyRoles.GetSpecialRole([
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~
       + CategoryInfo         
    : InvalidOperation: (:) [], RuntimeException
       + FullyQualifiedErrorId : InvokeMethodOnNull
    ou cannot call a method on a null-valued expression.
    t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:245 char:5
         $SuperReaderPolicy = $WebApp.Policies.Add($PortalSuperReader, "Portal
    uper  ...
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~
       + CategoryInfo         
    : InvalidOperation: (:) [], RuntimeException
       + FullyQualifiedErrorId : InvokeMethodOnNull
    ou cannot call a method on a null-valued expression.
    t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:248 char:5
    SuperReaderPolicy.PolicyRoleBindings.Add($WebApp.PolicyRoles.GetSpecialRole
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~
       + CategoryInfo         
    : InvalidOperation: (:) [], RuntimeException
       + FullyQualifiedErrorId : InvokeMethodOnNull
    ou cannot call a method on a null-valued expression.
    t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:251 char:5
         $WebApp.Update()
         ~~~~~~~~~~~~~~~~
       + CategoryInfo         
    : InvalidOperation: (:) [], RuntimeException
       + FullyQualifiedErrorId : InvokeMethodOnNull

    Hi Benjamin,
    If you're getting a Null Value error anywhere, that means a variable you're referencing isn't set to anything. If you're getting that try echoing out each variable after it's assigned to see if it's set to anything.
    The link you are referring is for SharePoint 2010 and verified on Windows Server 2008 R2 and 2008, but not Windows Server 2012.
    The approach in this case includes the following per the blog:
    Check to see if a web application with the current specified URL is already in use – exit if it is
    Check to see if an application pool with the name already exists. If so use it, otherwise create one
    Create a web application based on the parameters specified
    Assign the object cache properties to the new web application
    Create policies for the object cache users to the web application
    To simplified the code, we could use powershell below to check if web application and application pool have been already in use ahead. And skip the last two steps in the first time.
    Get-SPWebApplication | fl displayname, applicationpool
    Please refer to New-SPWebApplication
    which is used to create a new web application within the local farm:
    http://technet.microsoft.com/en-us/library/ff607931(v=office.15).aspx. Only two parameters i.e. ApplicationPool and Name are required, we could try a simple command at first:
    Please run Get-SPManagedAccount to check the managed account, then execute the command below:
    $ap = New-SPAuthenticationProvider
    New-SPWebApplication -Name "Contoso Internet Site" -Port 2014 -ApplicationPool "ContosoAppPool" -ApplicationPoolAccount (Get-SPManagedAccount "Domain\Administrator")
     -AuthenticationProvider $ap -SecureSocketsLayer
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Error while creating the application

    Hi all,
    I have created a planning application by using a name(say APP).
    I have deleted that application from the essbase administration services and i have deleted,updated
    few data from the planning tables which were having the app_id same as APP.
    Now when i am creating the same APP application from the workspace it is showing error,but if I am
    changing the application name from APP to some other name it is creating the application successfully.
    But I want to create the application with the same name APP.
    How can i do it?
    Thanks

    Hi,
    First of all why did you take that route to delete the application.
    You should be able to delete the application from the same place you created it.
    You said you deleted some data from tables, what data did you remove and what tables.
    The reason why you can't create the application with the same name is probably because you have not removed it correctly.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How do I create an application with lots and lots of text?

    I was asked to create an application for the iPad. This application contains a lot of static text. With "a lot" I mean Mb's of text which should be represented in a visual attractive way. One can think of this application as a website but than in application form with added features. When building this application there should be a couple of things kept in mind:
    The modularity of the application. How easy will it be to add text or update it.
    How does the markup for the text work. Should everything be put in labels? And what to do with images than? Or is there an alternative?
    My question is: What is the proper way to setup this application? Preferably I don't want to manage the text myself. It will take ages to position everything correct. Especially since I will be working with artistic people...
    Thank you for your help!

    You can always retrieve updated text (html or any other format) from a web service or other channels.  That really is up to you.  If you decide to stick with HTML, there is not too much benefit in paring HTML out of an XML feed.

  • Best practise for creating an application that connects to a SQL Server database

    I have created an application that connects to a SQL Server database and views information using a datagrid and performs several updates when a button
    is selected.  
    I have created a SQLcontrol.vb using the following code:
    Imports System.Data.Sql
    Imports System.Data.SqlClient
    Public Class SQlControl
    'connection 1
        Public SQLCon As New SqlConnection With {.ConnectionString
    = "Data Source=;Initial Catalog=;Integrated Security=True"}
    'connection 2
        Public SQLCon1 As New SqlConnection With {.ConnectionString
    = "Data Source;Initial Catalog=;Integrated Security=True"}
        Public sqlcmd As SqlCommand
        Public sqlda As SqlDataAdapter
        Public sqldataset As DataSet
        Public Function hasconnection() As Boolean
            Try
                SQLCon.open()
                SQLCon.close()
                Return True
            Catch ex As Exception
                MsgBox(ex.Message)
                Return False
            End Try
        End Function
        Public Sub runquery(query As String)
            Try
                SQLCon.Open()
                sqlcmd = New SqlCommand(query,
    SQLCon)
                'LOAD
    SQL RECORDS FOR DATAGROD
                sqlda = New SqlDataAdapter(sqlcmd)
                sqldataset = New DataSet
                sqlda.Fill(sqldataset)
    BH READ DIRECTLY FROM THE DATABASE
                'Dim
    R As SqlDataReader = sqlcmd.ExecuteReader
                'While
    R.Read
                'MsgBox(R.GetName(0)
    & ": " & R(0))
                'End
    While
                SQLCon.Close()
            Catch ex As Exception
                MsgBox(ex.Message)
                'will
    close connection if still open
                If SQLCon.State
    = ConnectionState.Open Then
                    SQLCon.Close()
                End If
            End Try
        End Sub
        Public Sub runquery1(query As String)
            Try
                SQLCon1.Open()
                sqlcmd = New SqlCommand(query,
    SQLCon1)
                'LOAD
    SQL RECORDS FOR DATAGROD
                sqlda = New SqlDataAdapter(sqlcmd)
                sqldataset = New DataSet
                sqlda.Fill(sqldataset)
    BH READ DIRECTLY FROM THE DATABASE
                'Dim
    R As SqlDataReader = sqlcmd.ExecuteReader
                'While
    R.Read
                'MsgBox(R.GetName(0)
    & ": " & R(0))
                'End
    While
                SQLCon1.Close()
            Catch ex As Exception
                MsgBox(ex.Message)
                'will
    close connection if still open
                If SQLCon1.State
    = ConnectionState.Open Then
                    SQLCon1.Close()
                End If
            End Try
        End Sub
    End Class
    A code for one of my button which views displays data grid contains the following code:
    Private Sub Button1_Click_1(sender As Object,
    e As EventArgs) Handles Button1.Click
            If SQL.hasconnection
    = True Then
                SQL.runquery("select 
    * from tablea")
                If SQL.sqldataset.Tables.Count
    > 0 Then
                    DGVData.DataSource = SQL.sqldataset.Tables(0)
                End If
            End If
        End Sub
    I am fairly new to vb.net and have read a few books and followed a few tutorials on youtube, what I would like to know is, are there any disadvantages
    to the way I have connected to a SQL database using the SQLControl.vb.  A lot of the vb books include data adapter and dataset within the form, I'm not sure if I'm following best practice by have the connection details outside of the form.
    My other question is, I have created two connections in the SQLControl and call these connections within the same form using the same data adapter
    and dataset.  It all works fine but I just wanted to know of any potential issues?
    Public SQLCon As New SqlConnection With {.ConnectionString
    = "Data Source=;Initial Catalog=;Integrated Security=True"}
    'connection 2
        Public SQLCon1 As New SqlConnection With {.ConnectionString
    = "Data Source;Initial Catalog=;Integrated Security=True"}
    Thanks

    My other question is, I have created two connections in the SQLControl and call these connections within the same form using the same data adapter and dataset.  It all works fine but
    I just wanted to know of any potential issues
    1) You are not using Sepration of concerns for a solution that is doing data access, like using a DAL.
    http://en.wikipedia.org/wiki/Separation_of_concerns
    2) You are directly issuing SQL commands at the UI, leading to sql injection attacks.
    3) You are not using a UI design pattern, which leads you to tightly couple database activity to the UI.
    http://www.codeproject.com/Articles/228214/Understanding-Basics-of-UI-Design-Pattern-MVC-MVP
    @System243trd, parameters are important to prevent SQL injection attacks (people will insert SQL commands into the database if you do not perform basic checking of what you are passing to the database). If you write a stored procedure try to make
    the variables the correct SQL server data type to avoid problems later of people trying to call it directly.  Darnold924 is right, I see no code to prevent against SQL injection attacks. In addition, during development in some instances LocalSQLDB
    database system is used and during deployment you usually need to use the production SQL server database. Moreover,  Linq-to-SQL is used on Windows Phone 8.1 and it is required for phone development later and so I highly recommend learning
    it if you plan on developing windows phone applications.
    @System243trd, If you want the code for the windows phone app I think it uses the MVVM model or that might be for universal apps or regular windows phone apps. I have been using the windows phone Silverlight pivot or panorama template (it might
    be pieces of both). I've already submitted to the windows phone marketplace and it had to go through certification first. I plan on later making an article on it but I need to first fix one or two simple problems I have with it.  Here's a link to
    the source code if you later want to look at the source code (in vb.net): 
    https://jeffsblogcodesamples.codeplex.com/downloads/get/1445836
    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - Sherlock Holmes. speak softly and carry a big stick - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog
    - http://www.computerprofessions.us

  • Error Creating Planning Application

    Hi,
    I tried creating an application from the scratch (Classic one). I got the error as *"The SQL operation failed. Check log for details."*
    Is this related to anything on the DB side? Can someone please help. Thanks.
    Regards,
    Sathish.R

    Thanks for the response, John.
    Here below are my responses.
    1) The DB user ID is having a DBOWNER privilege on the database where I'm trying to create an application
    2) The log file details are here below:
    ---- Begin backtrace for Nested Throwables
    *java.sql.SQLException: [Hyperion][SQLServer JDBC Driver][SQLServer]The statement has been terminated.*
    at hyperion.jdbc.base.BaseExceptions.createException(Unknown Source)
         at hyperion.jdbc.base.BaseExceptions.getException(Unknown Source)
         at hyperion.jdbc.sqlserver.tds.TDSRequest.processInfoToken(Unknown Source)
         at hyperion.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
         at hyperion.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
         at hyperion.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
         at hyperion.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
         at hyperion.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
         at hyperion.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
         at hyperion.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
         at hyperion.jdbc.base.BaseStatement.commonExecute(Unknown Source)
         at hyperion.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
         at hyperion.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
         at com.hyperion.planning.sql.HspSQLImpl.executeUpdate(Unknown Source)
         at com.hyperion.planning.sql.HspSQLImpl.executeUpdate(Unknown Source)
         at com.hyperion.planning.sql.actions.HspAction.executeUpdate(Unknown Source)
         at com.hyperion.planning.sql.actions.HspMRUAction.add(Unknown Source)
         at com.hyperion.planning.sql.actions.HspMRUAction.update(Unknown Source)
         at com.hyperion.planning.sql.actions.HspAction.update(Unknown Source)
         at com.hyperion.planning.sql.actions.HspActionSet.doActions(Unknown Source)
         at com.hyperion.planning.sql.actions.HspActionSet.doActions(Unknown Source)
         at com.hyperion.planning.db.HspPrefDBImpl.saveMRUMembers(Unknown Source)
         at com.hyperion.planning.HyperionPlanningBean.saveMRUMembers(Unknown Source)
         at com.hyperion.planning.HyperionPlanningBean.LogOff(Unknown Source)
         at com.hyperion.planning.HspSessionListener.sessionDestroyed(Unknown Source)
         at com.ibm.ws.webcontainer.httpsession.SessionContext.sessionDestroyedEvent(SessionContext.java(Compiled Code))
         at com.ibm.ws.webcontainer.httpsession.SessionData.sessionUnbound(SessionData.java(Compiled Code))
         at com.ibm.ws.webcontainer.httpsession.SessionContext.notifySessionInvalidated(SessionContext.java(Compiled Code))
         at com.ibm.ws.webcontainer.httpsession.SessionData.invalidate(SessionData.java(Compiled Code))
         at com.ibm.ws.webcontainer.httpsession.SessionData.internalInvalidate(SessionData.java(Compiled Code))
         at com.ibm.ws.webcontainer.httpsession.MemorySessionContext.processInvalidList(MemorySessionContext.java(Compiled Code))
         at com.ibm.ws.webcontainer.httpsession.MemorySessionContext.performInvalidation(MemorySessionContext.java:79)
         at com.ibm.ws.webcontainer.httpsession.SessionContext.pollInvalidations(SessionContext.java:1028)
         at com.ibm.ws.webcontainer.httpsession.SessionAlarmListener.alarm(SessionAlarmListener.java:59)
         at com.ibm.ejs.util.am._Alarm.run(_Alarm.java(Compiled Code))
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))

  • Submit button in Compressor disabled after update Pro Applications Update 2010-02

    Dear all,
    I recently bought FCS and the whole software works fine after installation. However, I had to use Compressor over the last couple of days and the submit button was completely disabled and in the cluster field the option this computer had dissapeard. I checked this forum for a solution and found it. It seems that the problem was Qmaster. After reinstalling both Qmaster and Compressor everything works again. I have use the following set of instructions:
    http://www.digitalrebellion.com/blog/posts/how_to_reinstall_compressor_and_qmast er.html
    The problem is that now each time I do a software update, I am asked to install the Pro Applications Update 2010-02. After installing this update, the problem occurs again (the submit button is grayed/greyed out). It seems that in my computer the update creates a problem.
    Does anyone have the same issue and if so, what suggestion you recommend?. At the moment I am avoiding the update, but I may me missing important bug and other fixes.
    Thanks a lot,
    Oliver

    I have experimented a bit and got the problem sorted. Iuninstalled FCS using the uninstaller from http://www.digitalrebellion.com/fcsremover/.Before installing the whole suite again, I realised there was and additionalApple Qmaster package in the Applications folder. I deleted this file and emptythe trash. Then did a fresh installation of FCS, performed an update andinstalled Pro Applications Update 2010-02.
    And now all is up and running workingperfectly.
    Oliver

  • Pro Applications Update 2008-01    Good or Bad experiences ?

    Hi Guys,
    Who's up dated to the - Pro Applications Update 2008-01
    and have their been benefits or issues ?
    Cheers
    Tom K

    Everything is up to day via software update:
    LiveType 2.1.3
    FCP 6.0.3
    QT 7.4.5
    OS X 10.4.11 (Can't run Leopard on either of my Mac Pros (G5 Quad and Intel 2.66 2x core-duo) because I run ProTools on both (TDM on the Intel, LE on the G5)
    I mostly use the second internal drive for video stuff, but I have three FW-800 drives for backing up older projects, DVD images, etc.
    My test was pretty simple: in Livetype, I typed in some text which took three lines, applied various textures to a separate track and to the matte; put in some "live fonts," do some fade effects. I did this on both a regular NTSC SD project and a HD (ProRes 422) 1920x1080 project. It all works, rendered OK, exported, etc. I put the resulting video files through compressor to create SD MPEG2 files and they worked, too.
    I've been using 6.0.3 pretty extensively for a project (two hour movie of a play), and again, it all seems to work just fine. The long standing problem with some HDV not "conforming" correctly (exceedingly blocky video in places) has NOT been resolved with the update; the same time line rendered and exported as ProRes 422 is just fine, so it is an HDV issue.
    Eddie O

  • Pro Applications Update 2009-01 doesn't change version numbers?

    Hi,
    I ran the Pro Applications Update 2009-01 on my FCS installation. The update seemed to work fine, but when I open up FCP or any of the other apps, the version numbers are not changed. From the Pro Application Update page:
    "Pro Applications Update 2009-01 is a revision to Final Cut Studio (2009). This update includes Final Cut Pro 7.0.1, Motion 4.0.1, Soundtrack Pro 3.0.1, Color 1.5.1, and Compressor 3.5.1. The software addresses general compatibility issues, improves overall stability, and addresses a number of other minor issues."
    Since none of my FCS apps have upgrade version numbers, I can't tell if any of the fixes were applied. Is it possible I did something wrong when I ran the update?
    Thanks.
    Mike

    Thanks Larry and David for your responses, but unfortunately I'm not seeing what you are
    My Final Cut Studio 2009 apps are upgrades from the previous version. All the apps for FCS are in a "Final Cut Studio" folder that I created in Applications to hold the programs (I also drag this folder to the dock to have easy access to the apps).
    If I do a Command-I on the apps in this folder, they all show the old versions. Spotlight shows there are no other versions other than the ones in my "Final Cut Studio" folder.
    I wonder if the update's not working because I have the apps in a folder other than the original install location? The funny thing is that both VersionTracker and CNet's TechTracker say that there are new versions to install. But I would think that the updater would fail if I moved the apps from their original locations, not just end successfully?
    Mike

  • To create an application with a master and two details in the same page

    How I make to create an application contend a form master with two forms details in the same page?
    Tomaz
    Message was edited by:
    user517841

    Hi,
    You do not need to mount a screen. Just add a new region with several text fields inside. You should fetch a row by a process and populate the set when you load the page or click on a button. Insert, update, and delete should be done by processes. You have to have Next and Previous buttons to brows trough all rows of the detail table.
    The most important thing here is what the connections between tables in your database are.
    If they are the "One to many, One to one" you can use the approach described above.
    If they are "One to many, One to many" will be better to use buttons or links to lunch details' tables in separate forms.
    If the second and third tables are connected only to the master table you can use two buttons at the right of every master row. Clicking on the buttons will bring separate form for each detail table.
    If the third table is just a luckup table to the second one you can use "Select List" field into tabular form of the second table in one Master-Detail form.
    Konstantin
    [email protected]

  • How to create CRUD application using bapi in webdynpro java

    Hi All,
          I have implemented the CRUD application using bapi  Now i want to create, retrieve , update and delete the existing table by click on Insert, delete, retrieve ,and update button dynamically. i get null values from database,  Please let me know the logic and procedure for how to create CRUD application using bapi  Please any one help me..
    Thanks in advance

    Hi,
    Hey tell me one thing your BAPI having CURD methods. See you are getting data from BAPI and pull the data in Table in WDJ. So if u can do any action it will comes trough BAPI.
    If your BAPI having CURD methods. You can implement CURD methods in WDJAVA also.
    @ You said you are getting null values from the database. Please let me know what code you have to wrote for CURD. Please tell me.
    Hope this is help full for u
    Best Regards
    Vijay K

  • Impossible to upload Script and to create new application on UCCX 5.0.2

    Hi All,
    I'm trying to upload a new script on the UCCX server version 5.0.2 but I can not. When I click on the "Upload" button, I get a blank page where iit is written there is no connection. I can connect on the appadmin page. When I want to update or to create an application I have the following error:
    Error while handling the input request.
    com.cisco.app.ApplicationException: can not acquire ClusterMutex
    com.cisco.config.ConfigException: Get config record - error: catch cisco.config.ConfigException UnmarshalException
    javax.xml.bind.UnmarshalException: Content is not allowed in prolog. - with linked exception: [org.xml.sax.SAXParseException: Content is not allowed in prolog.]
    Can someone help me?
    Thanks in advance.

    Along these lines, you may want to restart the CRS Administration service through System > Control Center.
    There were a few bugs about page loading errors in various releases of 5.0. I took a glance at the bug toolkit and didn't see an exact match as you have described it though.

Maybe you are looking for