Ron McLeod

Saloon Keeper
+ Follow
since Feb 12, 2013
Ron likes ...
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
Richmond, BC, Canada
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ron McLeod

D Cuff wrote:So I just figured out that having an xsd:any within an xsd:all is not allowed in XSD 1.0 but will be allowed in 1.1.

You could have a sequence of xsd:any inside the extras container/wrapper.  Since you want to avoid describing the elements for the extra information in the schema, you would need to specify processContents="lax" (or processContents="skip").

Also, why port 8081?  Are you running multiple instances of Tomcat?
1 hour ago
Anything interesting in the various Tomcat logs?
1 hour ago
I work with XML, but I am not an expert, so take this suggestion with that understanding.  If this isn't exactly what you're looking for, maybe it can provides some ideas.

What about creating a child element in Model as a container for the extra information, and within that container, individual elements for each extra piece of information, with an attribute for the name of the type of information.

D Cuff wrote:I also want to be able to have extra tags(fields) along with the mandatory ones.

Are those the size, doortype, and color elements in your example?

If you don't want to make them mandatory, then you should be able to specify a minOccurs="0".  Also, I think you will need to specify maxOccurs for the Model element, otherwise it will be limited to just one.
According to the documentation:

ResultSet#next wrote:Moves the cursor forward one row from its current position. A ResultSet cursor is initially positioned before the first row; the first call to the method next makes the first row the current row; the second call makes the second row the current row, and so on.
When a call to the next method returns false, the cursor is positioned after the last row. Any invocation of a ResultSet method which requires a current row will result in a SQLException being thrown. If the result set type is TYPE_FORWARD_ONLY, it is vendor specified whether their JDBC driver implementation will return false or throw an SQLException on a subsequent call to next.

The point in the code where rst.getString("sum(mtn_m)") is being executed, the ResultSet is no longer pointing to a valid row.
5 hours ago
Out of curiosity, I tried your code on my workstation and did find a potential issue with this line:
   AudioInputStream ais = AudioSystem.getAudioInputStream(getClass().getResourceAsStream(s));

If you read the documentation for AudioSystem#getAudioFileFormat, you will see that it says:

AudioSystem#getAudioFileFormat wrote:The implementation of this method may require multiple parsers to examine the stream to determine whether they support it. These parsers must be able to mark the stream, read enough data to determine whether they support the stream, and, if not, reset the stream's read pointer to its original position. If the input stream does not support these operations, this method may fail with an IOException.

When the application is run from within the IDE, getClass().getResourceAsStream(s) returns an instance of, which does support mark/reset.  

However, when packaged into an executable JAR and run from the command-line (on my workstation with Java HotSpot(TM) 64-Bit Server VM),  getClass().getResourceAsStream(s) returns an instance of$JarURLInputStream, which does not support mark/reset.

When I ran the jarred application from the command-line, I saw this:
If you are finding this same issue, one fix would be to wrap the InputStream returned by getResourceAsStream with BufferedInputStream:

5 hours ago
Where is  your JSP file located?
Have you checked Tomcat's logs?

I tried what you described and it worked as-expected for me.


5 hours ago

Carey Brown wrote:'
Assuming that banc is a column name, it should not be in quotes.

But if it is not a column name, it should use single-quotes, not back-ticks.

Rather than this:
1 day ago
I think there are two issues:

1. The package name and the associated directory/folder are named differently: Flashcards vs. flashcards
2. You should be compiling from one level up, not inside the package directory.

Either rename the Flashcards directory to flashcards and compile from the Desktop directory:
C:\Users\Don Verga Jr\Desktop>javac flashcards\

or create a directory named flashcards (the package name) under Flashcards (the project name), and compile from the Flashcards directory:
C:\Users\Don Verga Jr\Desktop\Flashcards>javac flashcards\
1 day ago

Fabian Stetter wrote:And i dont understand your 2nd question? Im just opening the jar with double click

I'm not sure what double-click does, but it may be hiding the stack trace printout if an exception is caught.

Try opening a command line window, and launching from the command line.  For example:
1 day ago
How are you running the executable jar?
1 day ago
Did you add a line to printout any exceptions in your launcher class?
1 day ago
Are you seeing any exception being caught in your MusicPlayer class?
1 day ago