Getting error while saving morphia model to mongodb using CRUD interface - mongodb

During generic save action of morphia model using CRUD interface I recieve following error:
Oops: NullPointerException An unexpected error occured caused by
exception NullPointerException: null
play.exceptions.UnexpectedException: Unexpected Error at
play.modules.morphia.Model.edit(Model.java:219) at
play.modules.morphia.MorphiaPlugin.bind(MorphiaPlugin.java:607)
...
I've found that similiar error was in version 1.2.4a and was fixed in 1.2.4b.
I downoladed the latest version of morphia. On app start I recieve followind log:
12:18:59,036 INFO ~ Module morphia is available (C:\play-1.2.4\samples-and-tests\test1\modules\ morphia-1.2.4b )
12:18:59,037 INFO ~ Module secure is available (C:\play-1.2.4\modules\secure)
12:18:59,978 WARN ~ You're running Play! in DEV mode
12:19:00,110 INFO ~ Listening for HTTP on port 9000 (Waiting a first request to start) ...
12:19:11,680 INFO ~ Connected to jdbc:mysql://localhost/test1?useUnicode=yes&characterEncoding=UTF-8&connectionCollation=utf8_general_ci
12:19:14,869 INFO ~ MorphiaPlugin-1.2.4a> initialized
So, now I can't understad what version of morphia I actually use and can't understand how to fix the error.
Please, advice me something about my issue.

I got the problem, in this day morphia doesn't work with play 1.2.4 crud module. You have to rollback to 1.2.3.

Related

RuntimeException trying to run Drools examples

I downloaded Drools 7.46.0.Final and extracted the contents to my local drive. When I try to run the examples from the Linux command line using the provided runExamples.sh script I'm getting the following exception. I've tried with Java 8 and Java 11 (the only versions I have installed). Does this really require Java 6 like the message recommends or is there some other problem here?
I'm new to Drools, so I'm afraid I'm not sure how to troubleshoot this.
UPDATE: interestingly I tried version 7.44.0.Final and that runs fine. So downloaded 7.45.0.Final and that one is broken too. So something changed between 7.44 and 7.45 that's causing this.
10:06:44.154 [main] INFO o.k.a.i.utils.ServiceDiscoveryImpl.processKieService:129 - Cannot load service: org.kie.internal.process.CorrelationKeyFactory
10:06:44.157 [main] ERROR o.k.a.i.utils.ServiceDiscoveryImpl.processKieService:131 - Loading failed because There already exists an implementation for service org.drools.core.reteoo.KieComponentFactoryFactory with same priority 0
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.drools.dynamic.DynamicServiceRegistrySupplier.get(DynamicServiceRegistrySupplier.java:32)
at org.drools.dynamic.DynamicServiceRegistrySupplier.get(DynamicServiceRegistrySupplier.java:23)
at org.kie.api.internal.utils.ServiceRegistry$Impl.getServiceRegistry(ServiceRegistry.java:88)
at org.kie.api.internal.utils.ServiceRegistry$ServiceRegistryHolder.<clinit>(ServiceRegistry.java:47)
at org.kie.api.internal.utils.ServiceRegistry.getInstance(ServiceRegistry.java:39)
at org.kie.api.internal.utils.ServiceRegistry.getService(ServiceRegistry.java:35)
at org.kie.api.KieServices$Factory$LazyHolder.<clinit>(KieServices.java:358)
at org.kie.api.KieServices$Factory.get(KieServices.java:365)
at org.kie.api.KieServices.get(KieServices.java:349)
at org.drools.examples.DroolsExamplesApp.<init>(DroolsExamplesApp.java:59)
at org.drools.examples.DroolsExamplesApp.main(DroolsExamplesApp.java:52)
Caused by: java.lang.RuntimeException: Unable to build kie service url = jar:file:/home/davek/apps/drools-distribution-7.46.0.Final/examples/binaries/drools-examples-7.46.0.Final.jar!/META-INF/kie.conf
at org.kie.api.internal.utils.ServiceDiscoveryImpl.registerConfs(ServiceDiscoveryImpl.java:105)
at org.kie.api.internal.utils.ServiceDiscoveryImpl.lambda$getServices$1(ServiceDiscoveryImpl.java:83)
at java.util.Optional.ifPresent(Optional.java:159)
at org.kie.api.internal.utils.ServiceDiscoveryImpl.getServices(ServiceDiscoveryImpl.java:81)
at org.kie.api.internal.utils.ServiceRegistry$Impl.<init>(ServiceRegistry.java:60)
at org.drools.dynamic.DynamicServiceRegistrySupplier$LazyHolder.<clinit>(DynamicServiceRegistrySupplier.java:27)
... 11 more
Caused by: java.lang.RuntimeException: There already exists an implementation for service org.drools.core.reteoo.KieComponentFactoryFactory with same priority 0
at org.kie.api.internal.utils.ServiceDiscoveryImpl$PriorityMap.put(ServiceDiscoveryImpl.java:222)
at org.kie.api.internal.utils.ServiceDiscoveryImpl.processKieService(ServiceDiscoveryImpl.java:124)
at org.kie.api.internal.utils.ServiceDiscoveryImpl.registerConfs(ServiceDiscoveryImpl.java:101)
... 16 more
Unfortunately this is a known issue that I fixed with this commit.
Upcoming Drools 7.47.0.Final (to be released next week) won't suffer of this.
Switching to version 8.16.0.Beta or newer resolved this for me

gremlin server REST restfull Error encountered evaluating script

I am running a gremlin-server, and using restful api to query it. But I'm confused with this error below :
{"message":"Error encountered evaluating script: g.V().next()"}
but it is such a simple script.
for other script like "100-1" and "g", the query result is just OK. I have checked lots times for spelling and character. And I also have checked the gremlin-server logs, but there was no related records. So I ask for your help, Thanks!
You would run into that error if you don't have any data in the graph because it is an unchecked traversal. You should try a query like:
if (g.V().hasNext()) { g.V().next() }
If you're using Apache TinkerPop 3.1.2 or later, you would have seen a more informative stack trace in the Gremlin Server logs:
[WARN] HttpGremlinEndpointHandler - Invalid request - responding with 500 Internal Server Error and Error encountered evaluating script: g.V().next()
org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException

Running Play 2.4.x Locally Yields: java.lang.IllegalArgumentException: port out of range:-1

While trying to start my Play app locally I am getting a
java.lang.IllegalArgumentException: port out of range:-1
exception followed by a
(*:playRun) java.lang.reflect.InvocationTargetException
message. I can see in the trace the invalid port arg being sent (..../Scala/launcher/sbt-launch.jar" xsbt.boot.Boot "~run -1") but cannot find where to update this argument. There has to be somewhere to override default values. And... No matter what is in the application.conf (http.port) or what I pass on the command line -Dhttp.port I still get the same error. Any info would be enormously appreciated.
I had the same exception and I was in touch with the IntelliJ support team, and got the message it was a bug, because of the https protocol in the open browser field. The url parser cannot handle https and thus not extract the port number.
Bug report here: https://youtrack.jetbrains.com/issue/SCL-9971

Error in implementing hmsonline Cassandra-Trigger

Was trying to implement the triggers in Cassandra.
Have been trying to use the available Cassandra help: https://github.com/hmsonline/cassandra-triggers
Porting it on the latest version 1.2.3, and following the GettingStarted instruction.
when i tried to set the value for the trigger, inserting the data to fire the log, and checked the logs, following is the error which i received
java.lang.AssertionError
at org.apache.cassandra.thrift.ThriftSessionManager.currentSession(ThriftSessionManager.java:51)
at org.apache.cassandra.thrift.CassandraServer.state(CassandraServer.java:88)
at org.apache.cassandra.thrift.CassandraServer.validateLogin(CassandraServer.java:881)
at org.apache.cassandra.thrift.CassandraServer.set_keyspace(CassandraServer.java:1492)
at com.hmsonline.cassandra.triggers.dao.CassandraStore.getConnection(CassandraStore.java:42)
at com.hmsonline.cassandra.triggers.dao.ConfigurationStore.getConfiguration(ConfigurationStore.java:76)
at com.hmsonline.cassandra.triggers.dao.ConfigurationStore.isCommitLogEnabled(ConfigurationStore.java:44)
at com.hmsonline.cassandra.triggers.TriggerTask.run(TriggerTask.java:47)
at java.lang.Thread.run(Thread.java:636)
But we test it works fine at older version(ex: 1.1.2)
So is this a configuration problem, or the Thrift API implementation has been changed?
thanks

GenericSignatureFormatError in Play! Scala blog example

I'm working my way through the Scala blog engine tutorial (yabe) for Play! Framework, and I encountered a template execution error that refers to GenericSignatureFormatError : null when accessing comments. Specifically, the error page says:
Template execution error
Execution error occured in template /app/views/tags/display.html.
Exception raised was GenericSignatureFormatError : null.
In /app/views/tags/display.html (around line 14)
(14) | ${_arg?.comments.size() ?: 'no'}
This exception has been logged with id 666i6ifgg
The stack trace from the console is below. I can reproduce the problem within samples-and-tests/ from the github master (43b195), as follows:
% git clone https://github.com/playframework/play-scala.git
% cd play-scala/samples-and-tests/yabe
% play dependencies
~ play! 1.2, http://www.playframework.org
~ Resolving dependencies using /home/league/tmp/play-scala/samples-and-tests/yabe/conf/dependencies.yml,
~ play->scala 0.9 (from playLocalModules)
~ Installing resolved dependencies,
~ modules/scala-0.9 -> /usr/local/stow/play-1.2/share/play-1.2/modules/scala-0.9
~ lib/joda-time-1.6.jar
~ Done!
% play run
~ play! 1.2, http://www.playframework.org
~ Warning: conflict on command scala:console
~ Ctrl+C to stop
Listening for transport dt_socket at address: 8000
10:32:01,076 INFO ~ Starting /home/league/tmp/play-scala/samples-and-tests/yabe
10:32:01,079 WARN ~ Declaring modules in application.conf is deprecated. Use dependencies.yml instead (module.scala)
10:32:01,080 INFO ~ Module scala is available (/home/league/tmp/play-scala/samples-and-tests/yabe/../..)
10:32:01,080 INFO ~ Module scala is available (/usr/local/stow/play-1.2/share/play-1.2/modules/scala-0.9)
10:32:02,515 WARN ~ You're running Play! in DEV mode
10:32:02,591 INFO ~ Listening for HTTP on port 9000 (Waiting a first request to start) ...
Then, loading http://localhost:9000/ produces the error stated above, with this console output:
#666i6ifgg
Internal Server Error (500) for request GET /
Template execution error (In /app/views/tags/display.html around line 14)
Execution error occured in template /app/views/tags/display.html. Exception raised was GenericSignatureFormatError : null.
play.exceptions.TemplateExecutionException
at play.templates.BaseTemplate.throwException(BaseTemplate.java:84)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:236)
at play.templates.GroovyTemplate$ExecutableTemplate.invokeTag(GroovyTemplate.java:346)
at /app/views/Application/index.html.(line:6)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:213)
at play.templates.Template.render(Template.java:26)
at play.mvc.results.RenderTemplate.<init>(RenderTemplate.java:24)
at play.mvc.Controller.renderTemplate(Controller.java:657)
at play.mvc.ControllerDelegate.renderTemplateForScala(ControllerDelegate.java:46)
at play.mvc.results.Template.<init>(Template.scala:12)
at play.mvc.ScalaController.Template(ScalaController.scala:77)
at controllers.Application$.index(app/controllers.scala:27)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:540)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:498)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:492)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:469)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:157)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.reflect.GenericSignatureFormatError
at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:385)
at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:116)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:74)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:58)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1196)
at java.beans.Introspector.getBeanInfo(Introspector.java:423)
at java.beans.Introspector.getBeanInfo(Introspector.java:189)
at java.beans.Introspector.getBeanInfo(Introspector.java:250)
at java.beans.Introspector.<init>(Introspector.java:404)
at java.beans.Introspector.getBeanInfo(Introspector.java:189)
at java.security.AccessController.doPrivileged(Native Method)
at /app/views/tags/display.html.(line:14)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:213)
... 16 more
I was able to work around this problem by switching to the Sun JDK. I didn't realize that my Ubuntu was set to use OpenJDK instead. The installation guide claims that either one should work. Perhaps that is untrue, or perhaps I got unlucky with a particular bug related to this version of OpenJDK.
For anyone else having this problem, update-java-alternatives -l shows the available JDKs; I see:
java-6-openjdk 1061 /usr/lib/jvm/java-6-openjdk
java-6-sun 63 /usr/lib/jvm/java-6-sun
These come from the Ubuntu packages
sun-java6-bin 6.24-1build0.10.10.1
openjdk-6-jre-headless 6b20-1.9.7-0ubuntu1
Use this to select:
update-java-alternatives -s java-6-sun
Try changing this:
${_arg?.comments.size() ?: 'no'}
to
${(_arg?.comments.size() > 0) ? '': 'no'}
This should work.