Marco Behler

Author
Ranch Hand
+ Follow
since Jun 01, 2014
Cows and Likes
Cows
Total received
5
In last 30 days
0
Total given
0
Likes
Total received
15
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Marco Behler

Hey Coderanchers,

as the question "what should I learn next" pops up quite regularly when trying to learn Java, I decided to publish a fun, interactive, tutorial/learning path to become an Intermediate Java programmer.

You'll basically learn how to build a mp3 'archiving' program from scratch and learn a whole lot of things along the way: Core Java, JDBC, Servlets and much more.

https://www.marcobehler.com/guides/java-intermediate-learning-path-1/

Comments are much appreciated!
Guys, a bit of a thread hijack, but I'm looking for some reviews for some of my programming videos. If someone's up for it, I'll set you up with a free two week account, just send me a PM. In exchange for some notes on how you find the episodes, courses, choice of topics etc...

Thanks!
6 months ago
Hi Mohammed,
your question is too broad to be answered, but I'll give you a hint of what I mean.

Say you check out  the source code of Jetty, the web server. Or Tomcat. Or the source code of Wicket, the web framework. Or Git. Or whatever really.

Then it helps to have a specific use case in mind ? "How does a textfield get rendered". "How does Jetty parse HTTP headers?" "what does GIT do when you call "commit"". Of course, these could be huge topics, but it doesn't really matter, because you don't need to get a 10000% understanding. It's more about the general feel of how people solve things, the patterns, the coding style. Especially coding style wise, you'll learn that many open source projects have completely opposite rules, when it comes to coding styles. And it really often only is a matter of preferences and homogenity , instead of blind believe in certain coding rules ;)

my 5cents;
9 months ago
Siddarth,

check out the following link. It is your project and it should work.

www.marcobehler.com/External.zip
When you say "all type of files", do you mean text files? Binary files? Both? What type of files? Is there a specific list of file types? What exactly do you want to do?
10 months ago
Hi Andy,
sorry , your problem description is confusing. I don't really know WHAT the problem is here and also - at least for me - I cannot truly parse "it all works fine in the app, ...but the location isn't being found"
10 months ago
Siddarth, I just tried your code.

the code sample you sent me had the same problem, the same exception. BUT, you were missing the @Transactional annotations on the BookRepository, which are however in the code you pasted in here.

So with @Transactional AND @EnableTransactionManagement (no special options), it works just fine for me.
Can you put the .zipped project somewhere? Or put it on GitHub or something similar? Thanks

I agree with Peter. you should pretty much always prefer constructor injection.



Just to add (in IMHO) its best not to use field injection as it makes writing test cases awkward.  




How so, regarding tests?

To be honest with you, I'm actually seeing this as a completely religious issue. I've worked with several injection styles over the years, and from a pragmatic viewpoint.......i really don't care
10 months ago
I was asking, because in your stacktrace, there are no lines regarding a "TransactionProxy", i.e. your class does not get wrapped with a transaction. I wasn't sure if you had aspectj setup correctly and with that compile time weaving, but in any case, that's where i would have a look at.
Why are you using @EnableTransactionManagement with AspectJ "mode"? Could you try:

adviceMode=proxy, proxyTargetClass=true


Other than that, your code looks fine...?




You mean simply getting the IP address of the end-user calling your application?

Check out: HttpServletRequest.getRemoteAddr()

But if you have a proxy in front of it, also check the headers: "X-FORWARDED-FOR" or "x-real-ip"....and then simply save the contents to the db.

does that help?
10 months ago
Hi Adam,
what exactly is it you are trying to do? I'm no expert at streaming h.264, by all means, but I don't think implementing this sort of stuff from scratch is feasible, not for 0,2BTC. There's probably a ton of software out there which could suit your needs?
10 months ago
Yup, all the popular logging frameworks (logback, log4j etc.) are all free.
10 months ago