简体   繁体   English

JOOQ对Axis2 WebServices的支持

[英]JOOQ Support for Axis2 WebServices

I have an SOA application with Axis2 Web Service, and I am using JOOQ to create my entities and access the database. 我有一个带有Axis2 Web服务的SOA应用程序,并且正在使用JOOQ创建我的实体并访问数据库。 In my data service file I have the following code: 在我的数据服务文件中,我有以下代码:

public Contact[] findContactByName(String name) { 
     try { 
            Contact[] result =  new ContactFacade().findContactsByName(name); 
            return result; 
     } catch (Exception ex) { 
            // TODO: Add Error Logger 
            return null; 
     } 
}

If I call this code within the same project as the web service it works fine, but when I call the service from the client application, I get the following messages in the console. 如果我在与Web服务相同的项目中调用此代码,则它可以正常工作,但是当我从客户端应用程序调用服务时,会在控制台中收到以下消息。

[WARN] Unable to locate a BeanInfo cache for class org.jooq.impl.AbstractQueryPart (stopClass=class java.lang.Object). This will negatively affect performance!
[WARN] Unable to locate a BeanInfo cache for class org.jooq.impl.AbstractTable (stopClass=class org.jooq.impl.AbstractQueryPart). This will negatively affect performance!
[WARN] Unable to locate a BeanInfo cache for class org.jooq.impl.TableImpl (stopClass=class org.jooq.impl.AbstractTable). This will negatively affect performance!
[WARN] Unable to locate a BeanInfo cache for class org.jooq.impl.IdentityImpl (stopClass=class java.lang.Object). This will negatively affect performance!
[WARN] Unable to locate a BeanInfo cache for class org.jooq.impl.AbstractQueryPart (stopClass=class java.lang.Object). This will negatively affect performance!
[WARN] Unable to locate a BeanInfo cache for class org.jooq.impl.AbstractField (stopClass=class org.jooq.impl.AbstractQueryPart). This will negatively affect performance!
[WARN] Unable to locate a BeanInfo cache for class org.jooq.impl.TableFieldImpl (stopClass=class org.jooq.impl.AbstractField). This will negatively affect performance!
[WARN] Unable to locate a BeanInfo cache for class org.jooq.impl.IdentityConverter (stopClass=class java.lang.Object). This will negatively affect performance!
[WARN] Unable to locate a BeanInfo cache for class org.jooq.impl.DefaultDataType (stopClass=class java.lang.Object). This will negatively affect performance!
[WARN] Unable to locate a BeanInfo cache for class org.jooq.impl.DefaultDataType (stopClass=class java.lang.Object). This will negatively affect performance!
[WARN] Unable to locate a BeanInfo cache for class org.jooq.impl.DefaultDataType (stopClass=class java.lang.Object). This will negatively affect performance!

The last warning just keeps repeating indefinitely until a service timeout is fired by the service. 最后的警告只是无限期地重复,直到服务触发服务超时为止。

Thank you for your help. 谢谢您的帮助。

It took me a while, but I managed to tack down the issue and solved it. 我花了一段时间,但我设法解决了这个问题。

It turns out that this error occurs when trying to pass jooq's generated classes that are using the above ('TableImpl','TableFieldImpl ',.....). 事实证明,尝试传递使用上述方法的jooq生成的类时会发生此错误(“ TableImpl”,“ TableFieldImpl”,.....)。

So instead, set the option to generate POJOs to true in your configuration and it will create POJO classes with basic structure. 因此,在配置中将生成POJO的选项设置为true,它将创建具有基本结构的POJO类。 In your DAOs, when fetching the records, fetch them into the POJO object and return that through the service. 在您的DAO中,当获取记录时,将它们获取到POJO对象中并通过服务将其返回。

This a sample call: 这是一个示例调用:

List<Contact> contactsList = context.selectFrom(Tables.CONTACT)
.where(Tables.CONTACT.NAME.equal("somevalue")).fetchInto(Contact.class);

Hope this helps others :) 希望这对其他人有帮助:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM