Marco Behler

Ranch Hand
+ Follow
since Jun 01, 2014
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Marco Behler

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;
2 months ago

check out the following link. It is your project and it should work.
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?
3 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"
3 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
3 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?
3 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?
3 months ago
Yup, all the popular logging frameworks (logback, log4j etc.) are all free.
3 months ago

I learnt that they have to be loosely coupled, that they have to rely upon some discovery service, they must not rely of availabilty of other services, they should have their own database.. a big portion of troubles.

Yup - in theory. In practice, this is basically going down the painful, crazy road   To me, microservices, as they are being marketed, are indeed nothing more than "the diet of the month", let's say the Paleo diet. And the terms "loosely coupled" and "own databases" makes we want to jump out of a window to be honest.

Other than that, I can pretty much second everything Tim said.

If you want to play with it, simple create two or three Spring Boot applications, that talk rest with each other, and their own databases. Then do the same thing, but from 1 main class ;) (this is pretty much what I demonstrated in my screencasts...from 1 app -> 2 apps).

And that already will let you feel some of the pain and give you some good experience.
3 months ago
It is a bit tricky to understand your question, as your text is weirdly formatted. The persistence.xml is simply the standard JPA configuration file.

In "theory" running JPA you "could" swap out ORMs, but it is a use-case I have personally never ever seen, not even just once. As far as the persistence.xml goes, sure you can specify your "HibernatePersistence" Provider or whatever in that file, but...ermm..I guess I just dont get your question