This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!

Dave Tolls

Master Rancher
+ Follow
since Sep 04, 2013
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 Dave Tolls

If it's too much to post here, it's too much for me to go through I'm afraid.
6 minutes ago
Well, currently your ResizeImage method (should be resizeImage, to fit with standard naming practices) accepts both a path and a byte[].
When you want the default image then, if byte[] is null, give that method the path to the default image instead.

Indeed, I would split the resizeImage up.  It's currently doing too much, in my opinion.

First, the resize:

Then supply two methods to get an image:

Depending on where these live, I wouldn't expect them to be public methods, but I don't know your code structure.

ETA: This lot is hand written, so apologies for any compilation issues.
1 hour ago
Nothing there is doubling the last digit.
What is the full output from that code?
Can you also print the card number in the constructor so you can see exactly what it is receiving?
3 hours ago
There's nothing to stop you having a dummy image to use.
No point storing that in the database, just display it if the employee record has no image associated with it.
3 hours ago

Paul Clapham wrote:
The internet is full of quotes which weren't actually said by Einstein.

true, but I'm pretty sure I've never seen:
"To be defeated and not submit, is victory; to be victorious and rest on one's laurels, is defeat."
attributed to Einstein...
3 hours ago
Lines 40 and 41 in the first bit of code assume you have a valid image file.
You need to check whether or not one has been supplied.
If it isn't then don't try and create an input stream...I think (though cannot guarantee) that you can just set the Blob to null in that case.

The error should have given you a stack trace, by the way, which would have helped to point us to where in the code you were getting this error.
Alway give the stacktrace, along with the full error message.
19 hours ago
Then only shuffle once, picking th next item in the List each time they click the button.

Of course you then need to decide what to do when you get to the end of the List.
19 hours ago
But you haven't got any repeating array items.
20 hours ago
All those Quote instances are unique, so you won't get repeats from a shuffle of the array.

By the way, the last two should be attributed to Pilsudski, at a guess, and not Einstein.
20 hours ago
Do any of your debug statements appear in your logs?
What happens on the browser?

Have you used the browser tools (F12) to see what is happening on the network (ie what requests and response are being made)?
4 days ago
It happened because somewhere inside the getInstance() method a GregorianCalendar is created and returned.
5 days ago
No, that's fair enough, I just couldn't see the route to get the null.
Should have figured it out, as it's similar to the old singleton issue.

Stephan van Hulst wrote:
Consider the following code:

I take it this is only some scratch code.
I get complaints that a isn't effectively final (Java 8).

Any hints what it ought to look like to see the issue?
I mean, download Tomcat and start it up.
Deploy your app to Tomcat.

That way I know when I deploy to Tomcat elsewhere it'll work, and Eclipse isn't hiding an issue.

1 week ago
When you say it worked under Eclipse, I assume this was the built in Tomcat?

Did you try and deploy to a local standalone Tomcat to ensure that deployment would work?
1 week ago