簡體   English   中英

JOOQ對Axis2 WebServices的支持

[英]JOOQ Support for Axis2 WebServices

我有一個帶有Axis2 Web服務的SOA應用程序,並且正在使用JOOQ創建我的實體並訪問數據庫。 在我的數據服務文件中,我有以下代碼:

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

如果我在與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!

最后的警告只是無限期地重復,直到服務觸發服務超時為止。

謝謝您的幫助。

我花了一段時間,但我設法解決了這個問題。

事實證明,嘗試傳遞使用上述方法的jooq生成的類時會發生此錯誤(“ TableImpl”,“ TableFieldImpl”,.....)。

因此,在配置中將生成POJO的選項設置為true,它將創建具有基本結構的POJO類。 在您的DAO中,當獲取記錄時,將它們獲取到POJO對象中並通過服務將其返回。

這是一個示例調用:

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

希望這對其他人有幫助:)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM