When i migrate spring 3 to spring 4, iBatis is no longer support for spring 4. After google, i have added dependency 'mybatis-2-spring' into pox.xml but extended class 'SqlMapClientDaoSupport' class is deprecated. So could you please help is there any updated or upgraded class which is related to 'SqlMapClientDaoSupport' class that is used in MyBatis?
If you want to use iBATIS 2.x with Spring 4+, adding mybatis-2-spring to the dependencies list is the right solution.
SqlMapClientDaoSupport is still deprecated, but it should work fine.
If you want to remove the warnings, just add #SuppressWarnings("deprecation") to your DAOs.
#SuppressWarnings("deprecation")
public class YourDao extends SqlMapClientDaoSupport {
Hope you find the time to upgrade to the latest version of MyBatis (3.5.3 at the moment) soon. :)
Related
I created a new Kafka Stream project based on Quarkus 2.1.2 following these two guides:
https://quarkus.io/guides/kafka-streams
https://quarkus.io/guides/kafka-schema-registry-avro
I put some Avro schemas in the src/main/avro/ folder and built the project with Maven.
The build is successful but there aren't any Java classes in the target/generated-sources/avsc directory.
As said by the guide with the new version of Quarkus
there’s no need to use a specific Maven plugin to process the Avro schema, this is all done for you!
I also double-checked that the generate-code goal was enabled for the quarkus-maven-plugin.
Am I missing something or is the guide incomplete in some way? Because it doesn't seems that the class generation is automatically managed by Quarkus.
p.s. I'm using Java 11.0.2 and Maven 3.8.1
Thank you,
Mauro
As suggested by #Ladicek I tried to add the quarkus-avro dependency and now I can find the auto-generated classes.
I think that the guide https://quarkus.io/guides/kafka-schema-registry-avro should be modified because the "default" dependency quarkus-apicurio-registry-avro has quarkus-avro in its dependency while Confluent's kafka-avro-serializer doesn't (obviously).
I opened a issue to improve the guide.
Thank you very much
I am using Spring LDAP 2.3.1 and want to customize my repository by adding my own create method. I was hoping I could use the functionality described in section 2.6 of the Spring Data Commons documentation but it did not seem to work.
Is this functionality implemented for Spring LDAP?
Not sure what you mean with own create method. Custom repository implementations are available for every Spring Data module, see reference docs.
I have a Spring - JPA project generated using Spring Roo. Now for some requirement we are replacing our JPA layer with some other framework (MyBatis) which is not JPA-compliant. I have done the changes and they are working fine also. I have removed all the JPA dependencies from my pom.xml file.
I am facing issues with my JUnit test project which is used to test DAO layer. Spring Roo is looking for the javax.persistence.Entity class which is part of JPA specific jar.
Please find below the error details below:
can't determine annotations of missing type javax.persistence.Entity
when weaving type ****.**.***Test
when weaving classes
when weaving
when batch building BuildConfig[null] #Files=12 AopXmls=#0
[Xlint:cantFindType]
error at (no source information available
Can anyone please advise me how to remove this error without adding a JPA dependency?
You could try to make a push-in from your test .aj file to the related .java file and then remove the necessary code (imports, annotations) that makes that your Spring Roo shell shows that error.
If you are not sure about how to make a push-in, you could read Spring Roo 1.3.2.RELEASE documentation http://docs.spring.io/spring-roo/docs/1.3.2.RELEASE/reference/html/removing.html#removing-step-by-step-1
Regards,
I have configured spring data jpa with my spring app
I am using Spring 3.2 and spring data jpa 1.1.0
Xml configuration
Repo class
public class TestRepo extends JpaRepository <Test, Long>{}
Error subclass PagingAndSortingRepository needed by JpaRepository cannot be found
I dont see any such class in the spring data jpa jar. Am I missing any jar?
Have you included the spring-data-commons library
I'm working on a maven project which uses seam 2.2.0, hibernate 3.5.0-CR-2 as JPA provider, DB2 as database server and Websphere 7 as application server. Now I'm facing de following problem:
In my EJBs that are seen also as SEAM components I want to use the EntityManager from EJB container (#PersistenceContext private EntityManager em) not Seam's EntityManager (#In private EntityManager em). But this is the problem, I cannot obtain an EntityManager using #PersistenceContext.
On server logs it sais that it cannot create an EntityManagerFactory and gets a ClassCastException:
java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence incompatible with javax.persistence.spi.PersistenceProvider
After a lot of debugging and searching on forums I'm assuming that the problem is that Websphere doesn't use the Hibernate JPA provider.
Has anyone faced this problem and has a solution? I configured already WAS class loader order for my application to load the classes with the application class loader first and I\ve packed all necessary jars in application ear as written in: WAS InfoCenter: Features for EJB 3.0 development . If necessary I'll post my persistence.xml, components.xml files and stack trace.
I've found this problem discussed also here:
Websphere EntityManagerFactory creation problem
Hibernate 3.3 fail to create entity manager factory in Websphere 7.0. Please help
Any hint will be useful.
Thanks in advance!
Mihaela
I suspect that you've included the JPA API jar in your EAR. When using "parent last" (also known as "load classes with application class loader first"), your application is loading a second copy of the javax.persistence.spi.PersistenceProvider class, which is incompatible with the copy included in WAS. You need to either remove those classes from your EAR or change back to "parent first" delegation mode.