[ http://issues.datanucleus.org/browse/NUCRDBMS-610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20293#action_20293 ]
Andy Jefferson commented on NUCRDBMS-610:
1). I would prefer *no* other deps, presence of deps implies the chance of something else causing the problem. So just some entity, the JPA main and DataNucleus, so omit Spring (particularly as your DasJpa doesn't use it!). You have "datanucleus-api-jdo" yet are using JPA, so remove it. You have mongodb, why since using RDBMS? remove it.
What is "datanucleus.option.mapping"? Doesn't exist.
2). Post the exception you say you get with current codebase; it certainly is not what you post in the issue (since 3.1 is different code). All method instances are generated by OSGi's class loader, so since it works for everyone else who use OSGi then you must be doing "something different".
3). Please provide some step-by-step guide of what (command) you run "in Karaf", since I am not familiar with it. I would expect some sort of load bundle(s), in some order, followed by some invocation ... so what is the karaf-specific commands (or if done via a Maven plugin, what is the "mvn" plugin and method?)
> Not able to access JPQL methods like Max in karaf 2.2.6 OSGI environment
> Key: NUCRDBMS-610
> URL: http://issues.datanucleus.org/browse/NUCRDBMS-610
> Project: DataNucleus Store RDBMS
> Issue Type: Bug
> Environment: Windows xp, Java 1.6, Apache Karaf 2.2.6, OSGI
> Reporter: Sunil
> Priority: Incomplete
> Attachments: das-consumer-basic - dn.zip
> I am getting error during runtime when i try to use the Max function in a query given below (EVERY THING IS WORKING AS EXPECTED IF I AM NOT USING ANY METHOD).
> Query q = em.createQuery("SELECT max(s.studentID) FROM StudentJpa s");
> Long value = (Long)q.getSingleResult();
> System.out.println("MAX VALUE IS ***************** " + value);
> The error is given below.
> Caused by: org.datanucleus.exceptions.NucleusUserException: Expected SQLMethod class "org.datanucleus.store.rdbms.sql.method.MaxFunction" was not found!
> at org.datanucleus.store.rdbms.sql.expression.SQLExpressionFactory.invokeMethod(SQLExpressionFactory.java:341)
> at org.datanucleus.store.rdbms.query.QueryToSQLMapper.processInvokeExpression(QueryToSQLMapper.java:2835)
> at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compileResult(QueryToSQLMapper.java:593)
> at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compile(QueryToSQLMapper.java:400)
> at org.datanucleus.store.rdbms.query.JPQLQuery.compileQueryFull(JPQLQuery.java:800)
> at org.datanucleus.store.rdbms.query.JPQLQuery.compileInternal(JPQLQuery.java:279)
> at org.datanucleus.store.query.Query.executeQuery(Query.java:1748)
> at org.datanucleus.store.query.Query.executeWithMap(Query.java:1694)
> at org.datanucleus.api.jpa.JPAQuery.getSingleResult(JPAQuery.java:232)
> MY FINDINGS:
> JDOClassLoaderResolver is not able to load this class using any class loader.
> org.datanucleus.store.rdbms is exporting all the methods in that particular package but no bundle is importing it.
> I believe datanucleus is missing something here.
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://issues.datanucleus.org/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira