-
1. Re: Can EJB Timers be managed via CLI?
ssilvert Nov 9, 2012 2:47 PM (in response to sboscarine)Theoretically, it can be done in AS7.2 because acces to the "timers" attribute is provided. But to do this, the write-attribute command is really complicated so I used CLI GUI to automatically create the syntax for me:
/deployment=InjectionTest.war/subsystem=ejb3/stateless-session-bean=SimpleEJB/:write-attribute(name=timers,value=["{\"time-remaining\" => 77621L,\"next-timeout\" => 1352487600000L,\"calendar-timer\" => true,\"persistent\" => true,\"schedule\" => {\"year\" => \"*\",\"month\" => \"*\",\"day-of-month\" => \"*\",\"day-of-week\" => \"*\",\"hour\" => \"*\",\"minute\" => \"*/4\",\"second\" => \"0\",\"timezone\" => undefined,\"start\" => undefined,\"end\" => undefined}}"])
The result was just a "null". I'm not sure if that was a CLI GUI bug or a server bug, but I'm guessing it was the former.
Then I tried to cut and paste the command into regular CLI. I removed all the escapes for the quotes (\"). Here is what that looked like:
[standalone@localhost:9999 /] /deployment=InjectionTest.war/subsystem=ejb3/stateless-session-bean=SimpleEJB/:write-attribute(name=timers,value=["{"time-remaining" => 7762 1L,"next-timeout" => 1352487600000L,"calendar-timer" => true,"persistent" => true,"schedule" => {"year" => "*","month" => "*","day-of-month" => "*","day-of-week" => "*"," hour" => "*","minute" => "*/4","second" => "0","timezone" => undefined,"start" => undefined,"end" => undefined}}"]) jreadline: can't redirect to more than one file. jreadline: can't redirect to more than one file. jreadline: can't redirect to more than one file. jreadline: can't redirect to more than one file. jreadline: can't redirect to more than one file. jreadline: can't redirect to more than one file. jreadline: can't redirect to more than one file. jreadline: can't redirect to more than one file. jreadline: can't redirect to more than one file. jreadline: can't redirect to more than one file. jreadline: can't redirect to more than one file. jreadline: can't redirect to more than one file. jreadline: can't redirect to more than one file. jreadline: can't redirect to more than one file. java.lang.ExceptionInInitializerError at org.jboss.jreadline.console.Console.persistRedirection(Console.java:1344) at org.jboss.jreadline.console.Console.parseCurrentOperation(Console.java:1180) at org.jboss.jreadline.console.Console.parseCurrentOperation(Console.java:1191) at org.jboss.jreadline.console.Console.parseCurrentOperation(Console.java:1191)
Again, I'm not sure where the real error is. This one could be an error in jreadline or just an error in my syntax.
Once over the hurdle of getting CLI/CLI GUI to accept my command, there is still some doubt in my mind that the write-attribute operation is equipped to handle the operation. So how's that for a definite "maybe"?
Stan
-
2. Re: Can EJB Timers be managed via CLI?
sboscarine Nov 9, 2012 3:06 PM (in response to ssilvert)Hello Stan,
That is helpful. However, we do have one complication...our customers insist on paying RedHat All deployments have to be on an EAP release, but it will be a few months before we complete our port.
I'll try out that syntax and see what happens on EAP6.
Thanks!
Steven
-
3. Re: Can EJB Timers be managed via CLI?
aqtwrdnr Oct 1, 2013 9:24 AM (in response to sboscarine)I have tested this, but jboss-cli.sh fails with the following error message:
{
"outcome" => "failed",
"failure-description" => "JBAS014639: Attribute timers is not writable",
"rolled-back" => true
}
I've started another question about it here.