Call apt with multiple arguments

Is it possible to call apt inside a java class and pass multiple .class files?
For example:
String[] args = new String[5];
args[0] = "-nowarn";
args[1] = "-XclassesAsDecls";
args[2] = "-classpath";
args[3] = System.getProperty("java.class.path");          
args[4] = "packageName.FirstClass packageName.SecondClass";
return Main.process(new MyAnnotationProcessorFactory(),args);Result of the above example is:
error: Could not find class file for packageName.FirstClass packageName.SecondClass
1 error

The class path contains classes that we need.
This example works:
String[] args = new String[6];
args[0] = "-nowarn";
args[1] = "-XclassesAsDecls";
args[2] = "-classpath";
args[3] = System.getProperty("java.class.path");     
args[4] = "packageName.FirstClass";
args[5] = "packageName.SecondClass";
return Main.process(new IapiAnnotationProcessorFactory(),args);I replaced args[4] = "packageName.FirstClass packageName.SecondClass"; with a
args[4] = "packageName.FirstClass";
args[5] = "packageName.SecondClass";

Similar Messages

  • Exception calling "Activate" with "0" argument(s): "Topology does not contain any components of type Microsoft.Office.Server.Search.Administration.Topology.AdminComponen

    Hi,
    I have a Sharepoint 2013 farm I am trying to provision search for (not the same as my other thread). However, I get the below error:
    Exception calling "Activate" with "0" argument(s): "Topology does not contain any components of type Microsoft.Office.Server.Search.Administration.Topology.AdminComponent"
    In my script, I have the following:
    New-SPEnterpriseSearchAdminComponent -SearchTopology $clone  -SearchServiceInstance $SearchServiceInstanceServer3 -ErrorAction SilentlyContinue
    So I am not sure why the error happens, when I am trying to set this component. However, it's not the first component to be set (index partition on non-local servers first). I can make it first, but why does this error happen?
    UPDATE: I have noticed that the usage and health proxy on my farm is/was stopped, but I am not able to access the server(s) to look at this right now. Could this cause this issue?

    Do you already have Admin component running for the Search Service Application?
    Usage and Health Service will not cause this issue.
    Please also refer to below discussion to see if it helps:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/02f0b072-aa3a-4b7f-9662-2caf373d1e57/setspenterprisesearchtopology-identity-newtopology?forum=sharepointgeneral
    Warm Regards,
    Bhavik K Jain
    Sr. Software Engineer - SharePoint Administration
    Please vote if my reply helps and ensure that you mark a question as Answered once you receive a satisfactory response.

  • Exception calling "Update" with "0" argument(s): "To add an item to a document library, use SPFileCollection.Add()"

    Hi i am trying to add a new item and update existing field value in a document library with powershell 
    but i receive below error message.
    PS C:\Users\spfarm> C:\Scripts\add.ps1
    Exception calling "Update" with "0" argument(s): "To add an item to a document
    library, use SPFileCollection.Add()"
    At C:\Scripts\add.ps1:24 char:16
    + $newItem.Update <<<< ()
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException
    #Add SharePoint PowerShell Snapin which adds SharePoint specific cmdlets
    Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
    #Variables that we are going to use for list editing
    $webURL = "http://tspmcwfe:89"
    $listName = "test"
    #Get the SPWeb object and save it to a variable
    $web = Get-SPWeb $webURL
    #Get the SPList object to retrieve the "Demo List"
    $list = $web.Lists[$listName]
    #Create a new item
    $newItem = $list.Items.Add()
    #Add properties to this list item
    $newItem["Title"] = "My second item!"
    $newItem["Info"] = "s15"
    #Update the object so it gets saved to the list
    $newItem.Update()
    $web.Dispose()
    adil

    Hi Adil,
    Document Library is different from a normal list. The document library contains files inside it. You need to update the code to add a document to the library. Then you can get hold of the List Item represented by that file and update its properties. Here
    is an example:
    $WebURL = "http://aissp2013/sites/TestSite"
    $DocLibName = "Docs" 
    $FilePath = "c:\blogs.txt" 
    # Get a variable that points to the folder 
    $Web = Get-SPWeb $WebURL 
    $List = $Web.GetFolder($DocLibName) 
    $Files = $List.Files
    # Get just the name of the file from the whole path 
    $FileName = $FilePath.Substring($FilePath.LastIndexOf("\")+1)
    # Load the file into a variable 
    $File= Get-ChildItem $FilePath
    # Upload it to SharePoint 
    $spFile = $Files.Add($DocLibName +"/" + $FileName,$File.OpenRead(),$false) 
    $item = $spFile.Item
    $item["Title"] = "New Title"
    $item.Update()
    $web.Dispose()
    Blog | SharePoint Learnings CodePlex Tools |
    Export Version History To Excel |
    Autocomplete Lookup Field

  • System.Management.Automation.MethodInvocationException: Exception calling "ExecuteQuery" with "0" argument(s): "$Resources:core,ImportErrorMessage;" --- Microsoft.SharePoint.Client. ServerException: $Resources:core,ImportErrorMessage;

    Hi,
    I am getting an error  System.Management.Automation.MethodInvocationException: Exception calling "ExecuteQuery" with "0" argument(s): "$Resources:core,ImportErrorMessage;" ---> Microsoft.SharePoint.Client. ServerException:
    $Resources:core,ImportErrorMessage;
    Following is my powershell script on line
    $context.ExecuteQuery(); it is throwing this error.
    function AddWebPartToPage([string]$siteUrl,[string]$pageRelativeUrl,[string]$localWebpartPath,[string]$ZoneName,[int]$ZoneIndex)
        try
        #this reference is required here
        $clientContext= [Microsoft.SharePoint.Client.ClientContext,Microsoft.SharePoint.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c]
        $context=New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
        write-host "Reading file " $pageRelativeUrl
        $oFile = $context.Web.GetFileByServerRelativeUrl($pageRelativeUrl);
        $limitedWebPartManager = $oFile.GetLimitedWebPartManager([Microsoft.Sharepoint.Client.WebParts.PersonalizationScope]::Shared);
        write-host "getting xml reader from file"
        $xtr = New-Object System.Xml.XmlTextReader($localWebpartPath)
         [void] [Reflection.Assembly]::LoadWithPartialName("System.Text")
        $sb = new-object System.Text.StringBuilder
             while ($xtr.Read())
                $tmpObj = $sb.AppendLine($xtr.ReadOuterXml());
             $newXml =  $sb.ToString()
        if ($xtr -ne $null)
            $xtr.Close()
        #Add Web Part to catalogs folder
        write-host "Adding Webpart....."
        $oWebPartDefinition = $limitedWebPartManager.ImportWebPart($newXml);
        $limitedWebPartManager.AddWebPart($oWebPartDefinition.WebPart, $ZoneName, $ZoneIndex);
    $context.ExecuteQuery();
        write-host "Adding Web Part Done"
        catch
        write-host "Error while 'AddWebPartToPage'" $_.exception| format-list * -force
    ERROR:
    Error while 'AddWebPartToPage' System.Management.Automation.MethodInvocationException: Exception calling "ExecuteQuery" with "0" argument(s): "$Resources:core,ImportErrorMessage;" ---> Microsoft.SharePoint.Client.
    ServerException: $Resources:core,ImportErrorMessage;
       at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
       at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
       at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
       at ExecuteQuery(Object , Object[] )
       at System.Management.Automation.DotNetAdapter.AuxiliaryMethodInvoke(Object target, Object[] arguments, MethodInformation methodInformation, Object[] originalArguments)
       --- End of inner exception stack trace ---
       at System.Management.Automation.DotNetAdapter.AuxiliaryMethodInvoke(Object target, Object[] arguments, MethodInformation methodInformation, Object[] originalArguments)
       at System.Management.Automation.DotNetAdapter.MethodInvokeDotNet(String methodName, Object target, MethodInformation[] methodInformation, Object[] arguments)
       at System.Management.Automation.Adapter.BaseMethodInvoke(PSMethod method, Object[] arguments)
       at System.Management.Automation.ParserOps.CallMethod(Token token, Object target, String methodName, Object[] paramArray, Boolean callStatic, Object valueToSet)
       at System.Management.Automation.MethodCallNode.InvokeMethod(Object target, Object[] arguments, Object value)
       at System.Management.Automation.MethodCallNode.Execute(Array input, Pipe outputPipe, ExecutionContext context)
       at System.Management.Automation.ParseTreeNode.Execute(Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
       at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
           

    Thanks Sethu for your comments. However i am running this powershell directly on server so believe
    SharePointOnlineCredentials is not required.
    I have tried it but still giving me same error

  • Query AD cause Exception calling "FindAll" with "0" argument(s)

    Hi all,
    When I query an entry property of AD with PowerShell, i got some problems. Here is the script, what's wrong ? Any idea? Thanks!
    Cause error at last line code. (Exception calling "FindAll" with "0" argument(s): "There is no such object on the server)
    $MailboxServer = Get-MailboxServer -Identity $Env:COMPUTERNAME -ErrorAction SilentlyContinue
    $dc = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
    $exchOAB = New-Object System.DirectoryServices.DirectoryEntry("LDAP://" + $dc.Name + "/cn=Offline Address Lists,cn=Address Lists Container, " + $MailboxServer.DistinguishedName)
    $objSearcher = New-Object System.DirectoryServices.DirectorySearcher
    $objSearcher.SearchRoot = $exchOAB
    $objSearcher.PageSize = 1000
    $objSearcher.SearchScope = "OneLevel"
    $objSearcher.Filter = "(objectClass=msExchOAB)"
    $powershellOAB = $objSearcher.FindAll()

    This is one of, now, four duplicate posts.
    ¯\_(ツ)_/¯

  • Cfexecute with multiple arguments

    Hello,
    I'm trying to encrypt a file with CFEXECUTE, using OpenSSL. When I run the code in the command prompt, it works fine and the new encrypted file appears in the correct folder. Also, I can run CFEXECUTE with OpenSSL with just one argument and it works fine. ie arguments="version". But the following does not return a value, nor does it create the new folder:
    <cfexecute name = "C:\Program Files (x86)\GnuWin32\bin\openssl"
        arguments = "aes-256-cbc -a -salt -in ""C:\Users\Dev2\Documents\My Stuff\OpenSSL\secrets.txt"" -out ""C:\Users\Dev2\Documents\My Stuff\OpenSSL\secrets2.txt"""
        variable = "result"
        timeout = "5">
    </cfexecute>
    <cfdump var="#result#">
    Any ideas?
    Pete

    BYW,
    This runs fine:
    <cfexecute name = "C:\Program Files (x86)\GnuWin32\bin\openssl"
        arguments = "list-standard-commands"
        variable = "result"
        timeout = "5">
    </cfexecute>
    <cfdump var="#result#">
    and so does this:
    <cfexecute name = "C:\Program Files (x86)\GnuWin32\bin\openssl"
        arguments = "version"
        variable = "result"
        timeout = "5">
    </cfexecute>
    <cfdump var="#result#">
    Maybe someone has a multiple argument example of CFEXECUTE that runs fine.
    I'd be interested to know.
    Pete

  • Event Handlers which trigger functions with multiple arguments

    I am playing two video clips back to back. I have a few
    things which I need to do in between clips, so what I am doing for
    each is adding a handler for VideoEvent.COMPLETE, at which time i
    want to call a function which takes multiple arguments, like this:
    video.addEventListener(VideoEvent.COMPLETE,
    myFunction("1","2","3"));
    private function myFunction(var1:String, var2:String,
    var3:String):void
    video.removeEventListeners(VideoEvent.COMPLETE, myFunction);
    I've already figured out that getting rid of event handlers
    that trigger anonymous functions is impossible. Please don't tell
    me that it's impossible to remove them if functions require more
    than 0 arguments...

    "muskiemania" <[email protected]> wrote in
    message
    news:gc0pk0$jfb$[email protected]..
    >I am playing two video clips back to back. I have a few
    things which I need
    >to
    > do in between clips, so what I am doing for each is
    adding a handler for
    > VideoEvent.COMPLETE, at which time i want to call a
    function which takes
    > multiple arguments, like this:
    >
    > video.addEventListener(VideoEvent.COMPLETE,
    myFunction("1","2","3"));
    >
    > private function myFunction(var1:String, var2:String,
    var3:String):void
    > {
    > video.removeEventListeners(VideoEvent.COMPLETE,
    myFunction);
    > }
    >
    > I've already figured out that getting rid of event
    handlers that trigger
    > anonymous functions is impossible. Please don't tell me
    that it's
    > impossible to
    > remove them if functions require more than 0
    arguments...
    Any function that you add via addEventListener should expect
    exactly ONE
    argument, the event. And 99.958% of the time, you can take
    that event
    object and figure out exactly what you need to know.
    HTH;
    Amy

  • Implement Comparable with multiple arguments

    Is there a way of implementing Comparable<> with multiple different arguments to the Comparable generics?
    For example:
    public class Foo<K, V> implements Comparable<K>,
              Comparable<V>
    }The compiler complains with the error: "The interface Comparable cannot be implemented more than once with different arguments: Comparable<K> and Comparable<V>"
    Clearly, this cannot be done exactly like this, so I'm wondering if there is a different way of accomplishing the same functionality.
    Edited by: mgolowka on Apr 24, 2008 12:22 PM

    I'm working on creating a generic binary search tree. Currently I have this:
    public class BinarySearchTree<T extends Comparable<T>> implements Collection<T>
    }With the add() function, I can simply do add(T) that will use T's compareTo(T) method to find its place in the tree, however with the remove() and get() functions that I want to have would require an input of T, which isn't what I'm entirely looking for. I could change this to have a key/value pair so it's functionality is like a set, but I'm not sure if that's the best course of action. I could make it implement Map<K, V> to get that functionality...
    There is no time limit on this project as it is a part of a personal project.

  • Call method with an argument from another view controller

    I have a UIViewController MainViewController that brings up a modal view that is of the class AddPlayerViewController. When the user clicks 'Save' in the modal view I need to pass the Player data (which is a Player class) from the modal view to the MainViewController in addition to triggering a method in the MainViewController. What's the best way to accomplish this? I'm new to cocoa and have only tried using delegates and some ugly hacks to no avail.
    Thanks for the help.

    If I understand correctly, you have:
    1. A model object, Player.
    2. A top view controller, MainViewController.
    3. Another view controller, AddPlayerViewController, which MainViewController displays modally.
    I'm guessing that AddPlayerViewController creates a new Player object and lets the user set its values, and you need a way to get that new Player into MainViewController once they're done.
    So, here's what I'd do:
    1. Create an AddPlayerViewControllerDelegate protocol. It should declare two methods, "- (void)addPlayerViewController:(AddPlayerViewContrller*)controller didAddPlayer:(Player*)newPlayer" and "- (void)addPlayerViewControllerNotAddingPlayer:(AddPlayerViewController*)controll er".
    2. Add an attribute of type "id <AddPlayerViewControllerDelegate>" called delegate to AddPlayerViewController. Also add a property with "@property (assign)" and "@synthesize".
    3. Modify AddPlayerViewController so that if you click the "Save" button, addPlayerViewController:didAddPlayer: gets called, passing "self" and the new Player object as the two arguments. Also arrange for clicking the "Cancel" button to call addPlayerViewControllerNotAddingPlayer:.
    4. Modify MainViewController to declare that it conforms to AddPlayerViewControllerDelegate. Implement those two methods (addPlayerViewControllerNotAddingPlayer: might be an empty method if you don't want to do anything).
    5. When you create your AddPlayerViewController, set its delegate to your MainViewController.
    If you need more detail, let me know what parts you need me to elaborate on.

  • Calling RH_ShowLocalHelp with 5 arguments

    Hello all,
    I'm trying to make a context-sensitive help call from C#. According to the documentation at http://help.adobe.com/en_US/robohelp/robohtml/WS5b3ccc516d4fbf351e63e3d11aff59c571-7f39.ht ml , there's a function named RH_ShowLocalHelp that takes 5 parameters. Unfortunately, that function seems to be missing from the C# files that ship with RoboHelp 10 (the 4 arguments' version is in the file, though). Am I missing something in here? Am I not using the right files?
    Thanks in advance,
    --Ignacio

    I don't have an answer but maybe a look at www.wvanweelden.eu will help. Willam has a lot of information on calling help.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Applescript with multiple arguments

    AFAIK, Terminal.app does not accept arguments. So, I need for AppleScript to accept some arguments, then open Terminal to run them. Something like this:
    tell application "Terminal"
        activate
        set shell to do script arg1 arg2 arg3  in window 1
    end tell
    All I've been able to accomplish is:
    tell application "Terminal"
        activate
        set shell to do script arg1 in window 1
    end tell
    Help please?

    OK I have no idea how anyone is posting code now with this new ASC software but I can;t get it to work no matter what I do.
    If I make two changes to your code I get the following output in the Terminal window, which seems to be what you want.
    Last login: Thu Jul  3 07:59:35 on console
    LIBMACLAPcaggiano  ~ %
    LIBMACLAPcaggiano  ~ % /Applications/adbFire/adb  -s 192.168.1.196  shell
    zsh: no such file or directory: /Applications/adbFire/adb
    LIBMACLAPcaggiano  ~ %
    The changes were (for testing)
    set daddr to "192.168.1.196"
    hardcoding in the ip address rather then getting it setting it from argv. I'm a bit confused you show a run handler, how is the script being called?
    And second
    set shell to do script "/Applications/adbFire/adb  -s" & space & daddr & space & " shell" in window 1
    adding the -s right to the program string.
    One last thing I run zsh not sure if that has any bearing here.
    I suppose a screen shot is better then nothing
    Actually you can pair down the command to
    set shell to do script "/Applications/adbFire/adb  -s " & daddr & " shell" in window 1
    no real need for the & space in there

  • Call function with select arguments

    Hi Gurus,
    I have problem to call function inside select statements as follow:
    select a.ID_ELE2, a.ID_ELE3, a.DT_FIS_YR, c.NU_FIS_PER, c.dt,
    (case
    when c.ld is null then
    GET_LD_CHECK (a.DT_FIS_YR,c.NU_FIS_PER, a.ID_ELE3, a.ID_ELE2) -- 1
    -- GET_LD_CHECK ('2009',7, '8010', '7493') --- 2
    else
    c.ld
    end ) description
    from ACCOUNT a, TRANSACTION c
    where a.DT_FIS_YR ='2009'
    and a.ID_ELE3 <> '0000'
    and c.TY_SRC not in ('CL', 'CN')
    and a.DT_FIS_YR = c.nu_fis_yr
    and a.AK = c.AK_FGCHAR
    and trim(a.ID_ELE3) ='8010'
    and c.NU_FIS_PER <> 14
    order by 1,4,5,6
    the 1 doesn't output result but the 2 it does! How can pass the select result to the function?
    Thanks in advance for your help.
    Ben

    The statement / function call seems to be ok. So there are not much chances left for your call to return different (=non) values.
    1) It could be that you have different values in the column then during your test call.
    2) Maybe your function raises an error and that error is supressed in some ugly WHEN OTHERS EXCEPTION => Solution: Get rid of the error handler.
    3) datatype conversion. For example if a.dt_fis_yr is a number value, then you should test with number values and not with strings. GET_LD_CHECK (2009,7, '8010', '7493'). Same logic goes for the other paramters, make sure the datatype is correct and matches the function parameter.

  • How to call function with varray arguments .

    Hi,
    I've got function like this:
    CREATE OR REPLACE
    TYPE VARR_VARCHAR AS VARRAY(256) OF NVARCHAR2(500)
    CREATE OR REPLACE
    TYPE E_VARR_VARCHAR AS VARRAY(256) OF nVARCHAR2(4096)
    FUNCTION find_id(
          p_id            IN   VARCHAR2,
          p_special_columns     IN   varr_varchar,
          p_special_values      IN   e_varr_varchar,
          RETURN VARCHAR2;How can I construct call to that function (nvarchar datatype is a need) using only pl/sql and can I do that with pure sql like select f() from dual; ?
    I'm on 9.2.0.8 .
    Regards
    GregG

    select find_id (p_id,VARR_VARCHAR('1','2','3'),e_varr_varchar('1','2','3')) from dual;
    --sty.                                                                                                                                                                                               

  • JNI callback funtion with multiple arguments

    Hi,
    Is it possible to return more than one argument in java callback function.
    for single arg return, I am using below function in my C code.
    jmethodID mid = (*env)->GetMethodID(env, cls, "callback", "(I)V");
    (*env)->CallVoidMethod(env, obj, mid, depth);
    what are the changes require to return more than one arg?
    Thanks in Advance
    Ashwani

    Is it possible to return more than one argument in java callback function.Of course. A 'callback function' is just a method like any other.
    what are the changes require to return more than one arg?1. Adjust the method declaration in the class you are calling.
    2. Compile the class.
    3. Run javap -s to see the new signature.
    4. Adjust the signature in GetMethod() accordingly in your code.
    5. Adjust the CallVoidMethod() call to pass the necessary parameters.

  • Exception calling "ExecuteNonQuery" with "0" argument(s): "CommandText property has not been initialized.

    I have CSV file  which has sdimiler  data I am inserting those  date to desinated table and while executing this  query mentioned below I get error mentioned in TITLE
    insert into SU_EDIT_DETAIL(EDIT_FUNCTION, TABLE_FUNCTION, CODE_FUNCTION, CODE_TYPE,CODE_BEGIN, CODE_END, EXCLUDE, INCLUDE_X, OP_NBR, TRANSCODE, VOID, YMDEFF, YMDEND, YMDTRANS)"
    select  $($line."EDIT_FUNCTION"),($line."TABLE_FUNCTION"), ($line."CODE_FUNCTION"),'DIAG', ($line."CODE_BEGIN"), ($line."CODE_END"),' ',' ',' ','MIS', 'C',' ',20141001, 99991231, 20131120 
    from dual where not exists(select * from SU_EDIT_DETAIL where (EDIT_FUNCTION = ($line."EDIT_FUNCTION") and TABLE_FUNCTION = ($line."TABLE_FUNCTION")
    and CODE_BEGIN= ($line."CODE_BEGIN") 
    and CODE_END= ($line."CODE_END")));
    commit;
    Vijay Patel

    This SQL appears to be Oracle PL/SQL.  You may want to post in the Oracle forum.  If you are habving issues with the ADO.NET objects then you need to supply more of your code.
    ¯\_(ツ)_/¯

Maybe you are looking for