datanucleus


Weird “com.vividsolutions.jts.geom.Geometry” ClassNotResolvedException exception


I'm performing a JDOQL query that could look a bit complex:
Query q = pm.newQuery(IxlTest.class, "id == :tId && parameterGroups.get(oGroup.key).contains(tp) && oGroup.contains(opt) && opt.displayInResults");
q.setResult("oGroup, opt");
vars.append(TestTypeOptionsGroup.class.getName() + " oGroup;");
vars.append(TestTypeOption.class.getName() + " opt;");
vars.append(TestParameterGroup.class.getName() + " tpGroup;");
vars.append(TestParameter.class.getName() + " tp;");
q.declareVariables(vars.toString());
System.out.println(q.execute(testId));
There is no reason that I can think of that DN would need that Geometry class, as my classes have nothing to do with geometry. This is parameterGroups mapping in IxlTest
#Persistent(defaultFetchGroup = "true", table = "ixl_test_parameter_groups_rel")
#Join(column = "test_fk", extensions = { #Extension(vendorName = "datanucleus", key = "primary-key", value = "false") })
#Key(types = { String.class }, column = "test_parameter_group_key", mappedBy = "name", dependent = "true")
#Value(types = { TestParameterGroup.class }, column = "test_parameter_group_fk", dependent = "true")
private Map<String, TestParameterGroup> parameterGroups;
These are TestParameterGroup fields
#Persistent(primaryKey = "true", valueStrategy = IdGeneratorStrategy.IDENTITY)
private long id;
private String name;
private String key;
private boolean active;
#Column(name = "script_substitute")
private boolean scriptSubstitute;
#Column(name = "substitute_all")
private boolean substituteAll;
#Column(name = "script_value_when_checked")
private String scriptValueWhenChecked;
#Column(name = "script_value_when_unchecked")
private String scriptValueWhenUnChecked;
#Persistent(defaultFetchGroup = "true")
#Key(types = { String.class }, mappedBy = "key", dependent = "true")
#Value(types = { TestParameter.class }, column = "parameters_group_id", dependent = "true")
private Map<String, TestParameter> parameters;
These are TestParameter fields
#Persistent(primaryKey = "true", valueStrategy = IdGeneratorStrategy.IDENTITY)
private long id;
private String key;
private String value;
private boolean active;
#Column(name = "script_substitute")
private boolean scriptSubstitute;
#Column(name = "substitute_all")
private boolean substituteAll;
I'm still building up my query but just to make sure nothing is wrong, I tried running it before completing the whole query and I got this exception:
javax.jdo.JDOException: Class "com.vividsolutions.jts.geom.Geometry" was not found in the CLASSPATH. Please check your specification and your CLASSPATH.
at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:570)
at org.datanucleus.api.jdo.JDOQuery.execute(JDOQuery.java:252)
Class "com.vividsolutions.jts.geom.Geometry" was not found in the CLASSPATH. Please check your specification and your CLASSPATH.
org.datanucleus.exceptions.ClassNotResolvedException: Class "com.vividsolutions.jts.geom.Geometry" was not found in the CLASSPATH. Please check your specification and your CLASSPATH.
at org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:245)
at org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:410)
at org.datanucleus.store.rdbms.sql.expression.SQLExpressionFactory.invokeMethod(SQLExpressionFactory.java:382)
at org.datanucleus.store.rdbms.sql.expression.ObjectExpression.invoke(ObjectExpression.java:783)
at org.datanucleus.store.rdbms.query.QueryToSQLMapper.processInvokeExpression(QueryToSQLMapper.java:2871)
at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compilePrimaryExpression(AbstractExpressionEvaluator.java:200)
at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileUnaryExpression(AbstractExpressionEvaluator.java:169)
at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileAdditiveMultiplicativeExpression(AbstractExpressionEvaluator.java:148)
at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileRelationalExpression(AbstractExpressionEvaluator.java:123)
at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileOrAndExpression(AbstractExpressionEvaluator.java:65)
at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.evaluate(AbstractExpressionEvaluator.java:46)
at org.datanucleus.query.expression.Expression.evaluate(Expression.java:337)
at org.datanucleus.query.expression.DyadicExpression.evaluate(DyadicExpression.java:70)
at org.datanucleus.query.expression.DyadicExpression.evaluate(DyadicExpression.java:67)
at org.datanucleus.query.expression.DyadicExpression.evaluate(DyadicExpression.java:67)
at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compileFilter(QueryToSQLMapper.java:461)
at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compile(QueryToSQLMapper.java:381)
at org.datanucleus.store.rdbms.query.JDOQLQuery.compileQueryFull(JDOQLQuery.java:883)
at org.datanucleus.store.rdbms.query.JDOQLQuery.compileInternal(JDOQLQuery.java:343)
at org.datanucleus.store.query.Query.executeQuery(Query.java:1747)
at org.datanucleus.store.query.Query.executeWithArray(Query.java:1666)
at org.datanucleus.api.jdo.JDOQuery.execute(JDOQuery.java:243)
Why is DN thinking that I need any geo-based class ?
The query is simply weird (IMHO). You have
parameterGroups.get(oGroup.key).contains(tp)
yet "parameterGroups" is a Map, so "parameterGroups.get(...)" is a TestParameterGroup. Consequently what is "TestParameterGroup.contains" trying to do. Or "oGroup.contains(...)" also for that matter.
If you have that class being thrown in an exception then you either reference it, or you include all sorts of random jars in the classpath, such as "datanucleus-spatial" for example.

Related Links

How to load entity with its 1 to 1 relation in DataNucleus, using native SQL query with JOINS
How to fetch related object using JDOQL named query?
Datanucleus enhancement with Bazel
DN 4.0.x and oracle : java.util.Date mapped to wrong rdbms type
Is ReferentialJDOStateManager not used in DataNucleus 4.x?
DataNucleus JDO primary key with enum
How to create a Datanucleus JPA 2.x query with CriteriaQuery that is based on values from an embedded map
How do I replace Hibernate with DataNucleus JPA in a JHipster project?
getting this error while enhancing using Datanucleus. any idea
Weird “com.vividsolutions.jts.geom.Geometry” ClassNotResolvedException exception
Does DataNucleus persist JodaTime's DateTime differently with a non-local timezone?
Bulk update with datanucleus errors out
Detailed and clear specification for datanucleus jdo extensions?
Unique constraint with DataNucleus discriminator based multitenancy
Datanucleus fetchgroup composite key
Is there a good step-by-step tutorial for using datanucleus and maven?

Categories

HOME
airflow
macros
netty
wifi
ebay-api
mifare
livecharts
magento-1.9.2.1
bitbucket
grid
pdf-generation
soap-client
jcodemodel
distinct
point-of-sale
oxid
saucelabs
opengrok
yui
react-select
sha1
infopath
loss
bookmarklet
virtuemart
gpo
computation-theory
datazen-server
ng-tags-input
prepros
struts
ithit-webdav-server
windowserror
units-of-measurement
edsdk
unity3d-5
circle
node-soap
apache-falcon
angularjs-resource
http-proxy
repeat
outlook-2010
nscollectionview
latency
google-chrome-console
android-graphview
aura-framework
autodesk-data-management
result
ack
qtwebkit
activeandroid
confluent
noise
printer-control-language
node.js-client
pyautogui
therubyracer
addressbook
android-music-player
eclipse-mars
ldd
jira-agile
airwatch
nimbus
razorengine
jmh
fadein
mojolicious
consul-template
clearquest
stereotype
grails-3.0.9
genome
parseexception
veeam
service-broker
aiff
launcher
novell
powerpoint-2010
pnunit
step
facebook-java-api
kuka-krl
logo-lang
netbeans-plugins
jfilechooser
raddatepicker
tlbimp
azure-scheduler
pymel
urlfetch
linqdatasource
quit
expresso-store
hypertable
aspmenu-control
eeprom
sqlbuddy
code-organization
mscorlib
isgl3d
openwrap
youtube.net-api
sessiontracking
hs-err
javah
arraycollection
file-storage
user-preferences
unauthorized

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App