org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'passengerController': Unsatisfied dependency expressed through field 'service'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'passengerService': Unsatisfied dependency expressed through field 'repo'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'passengerRepository': Cannot create inner bean '(inner bean)#7db4363b' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#7db4363b': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [ca/bechir/config/JpaConfig.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
Maybe, you need to specify what Java version is in your pom.xml:
For example, if you use Java 11.
Also, if you are using IntelliJ, select File -> Settings-> Build,Execution, Deployment -> Compiler -> Java Compiler. Make sure project bytecode version is set to your current version of Java, such as 11.
Select File-> Project Structure -> Project , select the right project SDK and right project language level, such as 11 in this case.
Under Platform Settings -> SDKs , make sure the right version of Java is selected.
If that still does not work, you can commit your code in github and show us.
First of all, you need to rearrange your project structure. I am using intelliJ.
My new structure is:
src -> main -> java -> ca.bechir
resources -> META-INF ->persistence.xml
webapp-> WEB-INF ->views
You may need to mark webapp as web resource content as shown: https://www.jetbrains.com/help/idea/web-application-static-content.html Also, right click on resources to mark the directory as root.
If you are using Eclipse, you may need to recreate the file structures as well.
You may want to use IntelliJ Ultimate free trial version.
I need your help to fix the SQL statement:
Caused by: java.lang.IllegalArgumentException: The string <SELECT c FROM Passenger c WHERE c.name LIKE '%' || keyword || '%''OR c.email LIKE '%' || :keyword || '%'OR c.birthdate LIKE '%' || :keyword || '%'OR c.address LIKE '%' || :keyword || '%'OR c.family LIKE '%' || :keyword || '%'OR c.paymentCard LIKE '%' || :keyword || '%'> starts a quoted range at 268, but never ends it.
I'm not really able to rearrange the structure and have it be the same in eclipse. I did make a dynamic web project with maven in eclipse. I'm also confused as to mark web resource content I mean what do I mark with regards to the project?
When you create a dynamic web project in Eclipse, do you see the WebContent folder? If so, put your views folder inside that folder.
Packaging is important, otherwise the Spring framework container cannot find the components.