Billy Sclater

Ranch Hand
+ Follow
since Nov 18, 2012
Billy likes ...
Eclipse IDE Java Linux
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
6
Received in last 30 days
0
Total given
120
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Billy Sclater

I'm having some trouble using @PropertySource, I get an NPE when using 'env.getProperty(..).
Does anybody have any insight?

My environment:
JDK/JRE: 1.6.0_06
OS: Linux Mint 13
Spring: 4.1.6.RELEASE

The stacktrace

My properties file:

My config class:

Model class:

Failed attempts (a bit random!!):
#1 I have tried playing around with the @PropertySource annotation, for example using the file: prefix and absolute path to the properties file.
Dropping the backslash before the classpath eg/@PropertySource("classpath:com/mycompany/app/app.properties").
Putting the properties file in different places.

#2 I've also tried using @PropertySources containing an @PropertySource annotation too.

#3 I've added:
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
return new PropertySourcesPlaceholderConfigurer();
}

Any help/advice much appreciated!!
4 years ago
Hi, seem to have lost my old workspace Sorry about that. But I vaguely recall, just switching the bundle starting order in Eclipse :/
4 years ago
Hi Marios!

Wow! It's been a while since I posted this OSGI problem, I'd forgotten all about it! I'll have a look in my old workspace and see if I can get it to run again, if so I'll post the code and the steps I used :/
4 years ago
In Robert Martin (Uncle Bob)'s book 'Clean Code'. He advises to use comments very sparingly. And seems to suggest that a comment represents that the programmer failed to code correctly in a readable fashion! So what about JavaDoc? Should this be skipped under 'clean code standards'? Does JavaDoc indicate poorly written code?

I'm very interested to hear your opinions!!
4 years ago
Well, that's good news!! And the 'Javascript in 24hours' book is next on my reading list!!
4 years ago
Ok, I've just bought the Bates & Sierra book 'Head First: JSP & Servlets', I'm working through the book and enjoying it!

In my workplace one coworker described JSP and Servlets as 'old school'.
Another agreed, but did concede that there is still a lot of call for these technologies in the industry.
He said that there are a lot of 'legacy' solutions out there using JSP and Servlets, so it is a technology worth knowing.

Hmm.. doesn't sound very reassuring! I want to learn web development, so what is your advice?

Should I go ahead and study Servlets & JSP? Or is there another technology you'd recommend?

Also, what's your opinion? Are Servlets & JSP really going the way of the dinosaurs?
4 years ago
In answer to my own question......no!! (:
4 years ago
Hi, I have an AcvtiveMq question. Sorry, I'm quite new to messaging so I wasn't sure which forum to post this on

I get the following warning in my log:


It occurs when I run a test using maven. The test itself uses very little memory, certainly less than 1GB!!

Is the issue this warning represent likely to cause a test failure?

4 years ago

is my source code safe at all?


Not really ....

link to thread on decompilers

But it looks like you're safe if you use a version later than Java 7.0,....at least until somebody makes a decompiler for it!!

The company I work for use licenses (similar to your Windows license) to protect their products.
4 years ago
Sounds like heaven! I hope we move to using versions (in my company) soon(:
4 years ago

A lot of people get sloppy and don't specify version numbers in their pom dependency stanzas or use "grab bag" versioning (as in "give me the latest".)


Currently version numbers aren't used in my company (to my understanding) or rather everything is stamped with the same version number!!
But I get your point.

From what you are saying, it sounds like if version numbers are used correctly.
Then if 'version 2' of a certain artifact is broken, then you can just choose 'version 1' instead. (Assuming 'version 1' is compatible with your source code.)
Is that right?
4 years ago

What exactly do you mean with an "accurate result"?


Today, I've made some minor changes which were not in yesterday's code. But... I'm using yesterday's local repo (offline) when I build.
Does this matter? Is it possible, that my changes won't be picked up? (Forgive me if my question is a bit newbie-ish! I'm quite new to maven!).



4 years ago
I have a copy of my company's project locally on my hard drive and yesterday, the code built successfully.
However, this morning with 'the same source code' (except a few minor changes) the build failed due to some test failures.

This happens from time to time, I believe some 'in-house' jars that the tests require occaisonally 'get broken' by other developers,
and this causes these intermittent build failures.

If I now run mvn clean install from my machine, I'll get a failed build.

However, I still have a copy of yesterday's .m2 local repository. And if I use it and build 'offline', I'll get a build success!

My question is this:
Is this 'successful build' an accurate result?
4 years ago
I added everything yesterday using:

from my project root.

Then:


Then:


Today, I immediatley ran: