Did you not see my previous reply?
Justin On Fri, Jan 21, 2022 at 1:49 AM Goel, Amithkumar <amithkumar.g...@sap.com.invalid> wrote: > Hi, > > > > I know I am including dev mailing list also (Sorry for that), but if > anyone can help me here will be really grateful. > > > > Regards, > > Amith Goel. > > > > *From: *"Goel, Amithkumar" <amithkumar.g...@sap.com> > *Date: *Thursday, 20 January 2022 at 3:36 PM > *To: *"u...@activemq.apache.org" <u...@activemq.apache.org> > *Subject: *Need information on broker instance creation in interactive > mode via Java code. > > > > Hi all, > > > > I wanted to create artemis broker instance via interactive mode using a > Java application. I have written a sample code to execute the windows > command and provide the input in an interactive mode kindly find the java > file as an attachment. > > > > Now if I run the command as below where all input like username, password, > etc is given in the command itself it works fine: > > String command = "<Java_home>\\jre\\bin\\javaw.exe\" -XX:+UseParallelGC > -XX:+AggressiveOpts -Xms512M -Xmx1024M -classpath > \"<ARTEMIS_HOME>\\java\\lib\\artemis-boot.jar\" > -Dartemis.home=\"<ARTEMIS_HOME>\\java\" > org.apache.activemq.artemis.boot.Artemis create *--user "Administrator" > --password "Password1" --role admin --allow-anonymous y* > \"E:\\MessagingQueueBroker1\""; > > > > But if I run the command in interactive mode as below: > > String command = "<Java_home>\\jre\\bin\\javaw.exe\" -XX:+UseParallelGC > -XX:+AggressiveOpts -Xms512M -Xmx1024M -classpath > \"<ARTEMIS_HOME>\\java\\lib\\artemis-boot.jar\" > -Dartemis.home=\"<ARTEMIS_HOME>\\java\" > org.apache.activemq.artemis.boot.Artemis create > \"E:\\MessagingQueueBroker1\""; > > > > Then it asks for the input in an interactive way, and I am providing the > input via java code. > > > > BufferedWriter writer = new BufferedWriter(new > OutputStreamWriter(process.getOutputStream())); > > writer.write("Administrator\n"); > > writer.flush(); > > ……… > > > > It gives an exception “The pipe is being closed” while providing the > password but it is working fine for all other parameters. Do anyone have > solution w.r.t this issue. I want to run command in interactive mode only. > > > > Regards, > > Amith Goel. > > >