users@glassfish.java.net

API behind the asadmin console

From: <glassfish_at_javadesktop.org>
Date: Mon, 03 Mar 2008 13:07:57 PST

Hi!

I would like to use the api behind the asadmin console. This way I would like to deploy my assemblies using my own java code.
I editted the batch file and added all the jar's listed there to my libraries and made the folowing code. The start class is CLIMain (in which al the commandline commando's are parsed)

   public static void main(String[] args) {
        // TODO code application logic here
        
        String[] commando = new String[6];
        commando[0]="deploy-jbi-service-assembly";
        
        commando[1]="--user";
        commando[2]="admin";
        commando[3]="--passwordfile";
        commando[4]="C:\\test\\passfile";
        commando[5]="C:\\test\\CompositeApplicationDummyTravel.zip ";
 
            CLIMain.main(commando);

Now I'm getting some error because he's searching for the asenv.bat file (where some properties are set clearly).
Can I give a reference to the path where the batch file is stored or can I do something else so these properties are not needed?

Here's my error log:

3-mrt-2008 20:02:52 com.sun.enterprise.util.ASenvPropertyReader setSystemProperties
SEVERE: property_reader.asenvReadError
java.io.FileNotFoundException: null\asenv.bat (The system cannot find the path specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at java.io.FileInputStream.<init>(FileInputStream.java:66)
        at java.io.FileReader.<init>(FileReader.java:41)
        at com.sun.enterprise.util.ASenvPropertyReader.setSystemProperties(ASenvPropertyReader.java:226)
        at com.sun.enterprise.cli.commands.S1ASCommand.<init>(S1ASCommand.java:164)
        at com.sun.enterprise.cli.commands.JBICommand.<init>(JBICommand.java:71)
        at com.sun.enterprise.cli.commands.JBIInstallCommands.<init>(JBIInstallCommands.java:53)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at com.sun.enterprise.cli.framework.CommandFactory.createCommand(CommandFactory.java:91)
        at javaapplication5.CLIMain.invokeCommand(CLIMain.java:161)
        at javaapplication5.CLIMain.main(CLIMain.java:80)
        at javaapplication5.Main.main(Main.java:44)


Kind regards,

Frederik
[Message sent by forum member 'thesisuzgent' (thesisuzgent)]

http://forums.java.net/jive/thread.jspa?messageID=262064