我有一个使用以下方法的会话Bean:
@POST
@Consumes("application/x-www-form-urlencoded")
@Path("/calculate")
@Produces("application/json")
public CalculationResult calculate(@FormParam("childProfile") String childProfile,
@FormParam("parentProfile") String parentProfile) {
...
}
Run Code Online (Sandbox Code Playgroud)
返回的CalculationResult无法映射到JSON,并发生以下异常:
Caused by: com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class com.test.UniqueName and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)...
Run Code Online (Sandbox Code Playgroud)
如何SerializationFeature在Wildfly中配置Jackson及其?
我从Hibernate 4.2切换到Hibernate 4.3,我的项目不再工作了.我得到了一个
HibernateException:无法找到当前的JTA事务
当我做
Session s = sessionFactory.getCurrentSession();
Run Code Online (Sandbox Code Playgroud)
我意识到org.hibernate.transaction.TransactionManagerLookup不再存在.它在Hibernate 4.3中被删除了.我该如何更改当前配置?
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">testDS</property>
<property name="current_session_context_class">jta</property>
<property name="transaction.manager_lookup_class">com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup</property>
<property name="transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
<property name="connection.release_mode">auto</property>
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="hibernate.hbm2ddl.auto">create-drop</property>
<property name="hibernate.show_sql">true</property>
<mapping class="test.entities.Person" />
<mapping class="test.entities.CreditCard" />
<mapping class="test.entities.ExampleRevEntity" />
</session-factory>
Run Code Online (Sandbox Code Playgroud)