Problem with Bean

Hi Guys

I tried connecting the view to the backend. I followed the tutorial

And the starter project from the tutorial works fine. But when I try to implement the same logic in my school project I get the error:



Parameter 0 of constructor in com.cryptoportfoliotracker.logic.AssetManager required a bean named ‘entityManagerFactory’ that could not be found.


Consider defining a bean named ‘entityManagerFactory’ in your configuration.

I researched a lot in the last few days and all the solutions that I read about aren’t working for me.
What am I missing?

I also tried defining the bean ‘entityManagerFactory’ in my main method.

public LocalSessionFactoryBean sessionFactory() {
    LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();

    return sessionFactory;

after that I get slightly other error also about the bean creation error.

My code is here:

Any help would be appreciated. Thanks

Why are you excluding DataSourceAutoConfiguration?

And where is your database configuration in your

I did this because I had a problem earlier with JPA.
No there is no DB connection in the properties.

If I don’t exclude it I get other errors related to bean.

this is with bean ‘entityManagerFactory’ in my main method.
without bean ‘entityManagerFactory’ in my main method.

I did this because I had a problem earlier with JPA.

You have to fix those problems instead of ignoring them. You are just postponing them and they gonna bite you later

Yes, that’s what I’m trying to figure out. But I get so much errors since I’ve been trying to implement JpaRepositories and don’t know where to start fixing those issue. One issue goes away and another one shows up.

Okay so I got almost everything working. Now I just have strange error from the binder:
Even though I’m not using the entity Asset in the view component. But Asset extends CryptoAsset.

Regarding this issue
Your @Entity classes aren’t mapped correctly (Asset and Transaction classes)
Basic attribute type should not be persistence entity.

@beautiful-vespa Yes! Thank you. I figured that out.