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
actionscript-3
oop
teradata
cxf
bigtable
blob
x86-64
opc-ua
ms-application-insights
terminal
mediarecorder
jshell
psexec
mamp
distinct
guidewire
repeater
k-means
versioning
web-parts
loader
audio-streaming
conditional-formatting
caldav
glibc
ajaxcontroltoolkit
polybase
serenity-js
policy
gsuite
datastax-enterprise
deployment-descriptor
multiple-inheritance
setup-project
selenium3
contextmenustrip
eclipse-jdt
apache-falcon
border-layout
hippocms
oracle-bpm-suite
redhat-brms
jibx
ssdp
aspnetboilerplate
bootstrap-carousel
codepen
activeandroid
nao-robot
extjs3
programming-pearls
grib
qt3d
google-scholar
android-music-player
joystick
rowname
netlink
gdi
diameter-protocol
skbio
wordpress-plugin
play-json
openhab
android-filterable
eula
vspackage
perfect-scrollbar
connection-timeout
system.io.packaging
qf-test
os.walk
sync
gnip
xts
jsmpp
infor-eam
.net-reflector
vbaccelerator
code-complete
fade
infomaker
kohana-orm
azure-pack
wpd
http-compression
reference-manual
esi
netbiscuits
custom-cursor
parsec
pex-and-moles
xpolog
norton
silverlight-2.0
focus-stealing

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