mtedone / podam

PODAM - POjo DAta Mocker
https://mtedone.github.io/podam
MIT License
323 stars 750 forks source link

error:Failed to import bean definitions from relative location [podam-integration-config.xml] #121

Closed AlexLuya closed 9 years ago

AlexLuya commented 9 years ago

Hello, I got an error as blow,no related info can be found on internet.

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [podam-integration-config.xml]
Offending resource: class path resource [META-INF/spring/podam-config.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/integration]
Offending resource: class path resource [META-INF/spring/podam-integration-config.xml]

    at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
daivanov commented 8 years ago

I find Spring to heavy dependency for Podam:

mtedone commented 8 years ago

Daniil,

I’ve created a simple Maven project, declared Podam as a test dependency and used it without issues. Spring loads and works fine.

Spring is the de-facto Java framework and it’s not heavy, it just does what it’s supposed to do. it’s the best Java framework and a source of inspiration for all Java developers. With the introduction of Spring boot, it’s the future. Already OpenShift is offering solutions that run Spring micro-services. The introduction of Spring integration removed > 1k lines from PodamFactoryImpl and the solution is now more modular, classes more specialised (they data providers do one thing only).

Regards,

On 4 Oct 2015, at 11:09, Daniil Ivanov notifications@github.com wrote:

I find Spring to heavy dependency for Podam:

It requires integration with existing spring context causing bug like reported. For non-Spring application it brings heavy dependency. And advantage is rather limited. — Reply to this email directly or view it on GitHub https://github.com/mtedone/podam/issues/121#issuecomment-145332028.

daivanov commented 8 years ago

Spring-messaging brings 3.8 Mb of jars to the project. This would be perfectly Ok, should be Spring part of Java Runtime, but now this is already question mark for desktop applications and no go for Android applications. It's really heavy just to do as little as messaging.

Spring is not Java future as there is no open JSR to include Spring or any of its parts into Java Runtime. Without that Spring is a third-party framework used almost solely in large enterprise applications. It was designed to simplify loose coupling and separation of concerns by utilizing dependency injection in such application. It works well there.

Current master contains 3728 instrumented lines and one before Spring introduction contains 3526 instrumented lines. This is very typical situation, when abstraction layer is introduced, but this pays off for large (> 20K lines) applications.

Best regards, Daniil

mtedone commented 8 years ago

Daniil, I understand your views. I’m thinking of replacing it with a coded Strategy pattern that reuse the current DataProviders but I’m currently too busy studying for the AWS SA/Developer/DevOps certifications, so I’ll get to it when I’ve got time. The reason is not because of Spring, but because of versioning. If future users will use another Spring version then this might be in conflict with Podam’s version and I don’t want to impose that constraint on them.

As for Spring, nowadays Spring is used by virtually any organisation that creates anything more than niche Java products, so it’s not just Enterprise. I remember using Spring back in 2004 when I was working for a small media organisation. As I said, Spring microservices is going to be the future, very much like Docker (which has just been bought by RedHat).

The advantages that Spring brings are that it avoids developers from having to rewrite common patterns code, e.g. amongst others it applies the DRY (Don’t Repeat Yourself) and DRW (Don’t reinvent the wheel) principles: https://www.codementor.io/html/tutorial/stay-dry-with-css-and-javascript-frameworks

Of course the instrumented lines will be more or less the same, but Podam Factory was reduced by 1k lines. Thanks to Spring though, we can keep the refactoring, e.g. the DataProviders, while removing the Spring dependency so that our framework doesn’t impose dependencies on its users.

Regards,

On 17 Oct 2015, at 20:19, Daniil Ivanov notifications@github.com wrote:

Spring-messaging brings 3.8 Mb of jars to the project. This would be perfectly Ok, should be Spring part of Java Runtime, but now this is already question mark for desktop applications and no go for Android applications. It's really heavy just to do as little as messaging.

Spring is not Java future as there is no open JSR to include Spring or any of its parts into Java Runtime. Without that Spring is a third-party framework used almost solely in large enterprise applications. It was designed to simplify loose coupling and separation of concerns by utilizing dependency injection in such application. It works well there.

Current master contains 3728 instrumented lines and one before Spring introduction contains 3526 instrumented lines. This is very typical situation, when abstraction layer is introduced, but this pays off for large (> 20K lines) applications.

Best regards, Daniil

— Reply to this email directly or view it on GitHub https://github.com/mtedone/podam/issues/121#issuecomment-148945222.