I've been trying to remember a book, but for the life of me I can't. I read this in middle school, about 10 or 12 years ago, but the book looked older then. It was set in a medieval time period, but one of the plot points was the villain was going to use magic to make a cannon explode and kill the king (brand new invention I think, and to make it explode so people would not want to use them because they would be "dangerous"). The main character was a female warrior, she may have been a priestess. I think the main villain was a demon or sorcerer, but I'm not for sure. I can remember on the cover there was a dragon, and 2 character wearing blue and yellow I'm pretty certain.
After the cannon incident (didn't explode, heroine stopped the magic), I think an invisible army was revealed and the castle where this was taking place was then under siege.
If I remember more details before answered, I'll add them in.
Edit: I remembered something that might help answer this. Our library shelves were sorted by author, and I am pretty sure that Paul Stewart, author of the Edge Chronicles, was either on the shelf above or below this book. So the author's last name could have started with an S, but to be safe, maybe R or T as well. Hope this helps!