简体   繁体   中英

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. 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.

[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 ',.....).

So instead, set the option to generate POJOs to true in your configuration and it will create POJO classes with basic structure. In your DAOs, when fetching the records, fetch them into the POJO object and return that through the service.

This a sample call:

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

Hope this helps others :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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