Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

IllegalStateException #1

Open
wbasterfield opened this issue Dec 18, 2017 · 3 comments
Open

IllegalStateException #1

wbasterfield opened this issue Dec 18, 2017 · 3 comments

Comments

@wbasterfield
Copy link

Hi there

Busy testing your library and I'm getting an IllegalStateException.

Here is the test code

public static void main(String[] args)
{
Vertx v = Vertx.vertx();
Process process = Process.spawn(v, "ls");
process.stdout().handler(buff -> {
System.out.println("STD "+buff.toString());
});
process.stderr().handler(buff -> {
System.out.println("Error "+ buff.toString());
});
process.exitHandler(code -> {
System.out.println("Child process exited with code: " + code);
v.close();
});
process.start();
/*
try
{
process.start();
}catch(Exception ex) {}*/
}

Here is the exception

Exception in thread "main" java.lang.IllegalStateException
at com.julienviet.childprocess.impl.ProcessImpl.start(ProcessImpl.java:72)
at com.julienviet.childprocess.impl.ProcessImpl.start(ProcessImpl.java:66)
at ztest.start.main(start.java:24)

Everything does what its supposed to do so thats all good, we get the directory listing and exit no problems, so I'm not sure why the start method is generating an exception.

@vietj
Copy link
Owner

vietj commented Dec 18, 2017

it's because the start method is called two times

@wbasterfield
Copy link
Author

The second start method is commented out

@vietj
Copy link
Owner

vietj commented Dec 18, 2017

can you provide a reproducer for the case ?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants