Sergey, > If persistence api is not available (not deployed), we receive the following > error: > java.lang.NoClassDefFoundError: javax/persistence/Column > at > org.jooq.impl.JooqUtil.isJPAAvailable(JooqUtil.java:310)[134:jooq:2.0.0-SNAPSHOT] > at > org.jooq.impl.AbstractRecord.into(AbstractRecord.java:496)[134:jooq:2.0.0-SNAPSHOT] > at org.jooq.impl.ResultImpl.into(ResultImpl.java:1231)[134:jooq:2.0.0.2] > at > org.jooq.impl.AbstractResultQuery.fetchInto(AbstractResultQuery.java:365)[134:jooq:2.0.0-SNAPSHOT]
I filed this issue as: https://sourceforge.net/apps/trac/jooq/ticket/913 I see, my catch block in isJPAAvailable() is not sufficient, then. I should catch Throwable instead of Exception, just like in JooqLogger, actually: https://github.com/lukaseder/jOOQ/commit/0efec4b0ee5b046020f67c93ea6375189e1e6146#diff-0 Would that work again for you? Cheers Lukas 2011/11/8 Sergey Epik <[email protected]>: > Hello Lukas, > >> > 2. I am not sure that JooqUtil.isJPAAvailable works correctly, because >> > Column class is in the import and we can not load class JooqUtil without >> > Column (we will have ClassNotFound exception, at least in OSGI >> > container). >> > If we want to check availability of column class we have remove binary >> > dependency and replace >> > Class.forName(Column.class.getName()); >> > with >> > Class.forName("javax.persistence.Column"); >> > and move all javax.persistence - dependent operations to a separate >> > class. >> >> Hmm, I wasn't aware of that. I thought classes were loaded lazily by >> class loaders? But then, the same applies to JooqLogger (log4j, >> slf4j), and OracleUtils (ojdbc), right? There are binary dependencies >> in those classes as well. > > If persistence api is not available (not deployed), we receive the following > error: > java.lang.NoClassDefFoundError: javax/persistence/Column > at > org.jooq.impl.JooqUtil.isJPAAvailable(JooqUtil.java:310)[134:jooq:2.0.0-SNAPSHOT] > at > org.jooq.impl.AbstractRecord.into(AbstractRecord.java:496)[134:jooq:2.0.0-SNAPSHOT] > at org.jooq.impl.ResultImpl.into(ResultImpl.java:1231)[134:jooq:2.0.0.2] > at > org.jooq.impl.AbstractResultQuery.fetchInto(AbstractResultQuery.java:365)[134:jooq:2.0.0-SNAPSHOT] > > -- > Best regards, > Sergey >
