Using securesocial module in play - java

I get the following error the moment I add the #With (SecureSocial.class) to protect one of the controller classes. Not sure why, since I do have it working in another project which has more classes.
Oops: VerifyError
An unexpected error occured caused by exception VerifyError: Bad return type in method controllers.securesocial.SecureSocial.loadCurrentUser()Lsecuresocial/provider/SocialUser; at offset 53
play.exceptions.UnexpectedException: Unexpected Error
at play.Invoker$Invocation.onException(Invoker.java:232)
at play.Invoker$Invocation.run(Invoker.java:273)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.VerifyError: Bad return type in method controllers.securesocial.SecureSocial.lo
adCurrentUser()Lsecuresocial/provider/SocialUser; at offset 53
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
at java.lang.Class.getDeclaredMethods(Class.java:1808)
at play.utils.JavaWithCaching.findAllAnnotatedMethods(Java.java:500)
at play.utils.JavaWithCaching.findAllAnnotatedMethods(Java.java:507)
at play.utils.JavaWithCaching.findAllAnnotatedMethods(Java.java:470)
at play.utils.Java.findAllAnnotatedMethods(Java.java:255)
at play.mvc.ActionInvoker.handleFinallies(ActionInvoker.java:382)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:255)
... 1 more

A VerifyError happens when the code you run is compiled against a different version than the one the JVM loads when executing the code.
How does your dependencies.yml look like? Have you run play deps in this machine?

Related

google-oauth-java-client fails with twitch

basically cross from https://discuss.dev.twitch.tv/t/using-google-oauth-client-java-fails-to-execute-token-request/24191
the exception I get is this:
Exception in thread "main" java.lang.IllegalArgumentException: key scope
at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:902)
at com.google.api.client.json.JsonParser.parse(JsonParser.java:362)
at com.google.api.client.json.JsonParser.parse(JsonParser.java:337)
at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:79)
at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:73)
at com.google.api.client.http.HttpResponse.parseAs(HttpResponse.java:444)
at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:346)
at de.cryptearth.oauth.Main.main(Main.java:67)
Caused by: java.lang.IllegalArgumentException: key scope, field private java.lang.String com.google.api.client.auth.oauth2.TokenResponse.scope
at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:902)
at com.google.api.client.json.JsonParser.parse(JsonParser.java:453)
at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:789)
... 7 more
Caused by: java.lang.IllegalArgumentException: expected collection or array type but got class java.lang.String
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:164)
at com.google.api.client.util.Preconditions.checkArgument(Preconditions.java:67)
at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:726)
... 9 more
Any Idea what might could be the issue here?
Well, tried several OAuth libs linked on oaut.net but got none to work, so I ended up in doing it low-level with URLConnection and RegEx parsing.
Side-note: I also tried the other libs on YouTube, but only could Googles own implementation to work on it.
~closed

JSR352 / JBERET - incompatible InnerClasses attribute between "javax.el.BeanELResolver$1" and "java x.el.BeanELResolver"

I have a JSR325 (Chunk processing) based java batch program and trying to run in Java SE mode using JBERET implementation. I am following the approach mentioned in this this http://www.mastertheboss.com/javaee/batch-api/running-batch-jobs-in-j2se-applications
The java batch program in Java SE mode runs fine from Eclipse but, when packaged as a Jar and run from command prompt, am getting the following exception.
What could be the problem ?
INFO: WELD-000119: Not generating any bean definitions from org.h2.value.ValueGeometry because of underlying class loading error: Ty
pe com.vividsolutions.jts.geom.CoordinateSequenceFilter not found. If this is unexpected, enable DEBUG logging to see the full erro
r.
Exception in thread "main" java.util.ServiceConfigurationError: javax.batch.operations.JobOperator: Provider org.jberet.operations.J
obOperatorImpl could not be instantiated
at java.util.ServiceLoader.fail(ServiceLoader.java:236)
at java.util.ServiceLoader.access$100(ServiceLoader.java:193)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:389)
at java.util.ServiceLoader$1.next(ServiceLoader.java:457)
at javax.batch.runtime.BatchRuntime.getJobOperator(BatchRuntime.java:57)
at com.citi.Report.App.main(App.java:15)
Caused by: org.jboss.weld.exceptions.DeploymentException: incompatible InnerClasses attribute between "javax.el.BeanELResolver$1" an
d "javax.el.BeanELResolver"
at org.jboss.weld.executor.AbstractExecutorServices.checkForExceptions(AbstractExecutorServices.java:66)
at org.jboss.weld.executor.AbstractExecutorServices.invokeAllAndCheckForExceptions(AbstractExecutorServices.java:43)
at org.jboss.weld.executor.AbstractExecutorServices.invokeAllAndCheckForExceptions(AbstractExecutorServices.java:51)
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer.createClassBeans(ConcurrentBeanDeployer.java:72)
at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:260)
at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:351)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:79)
at org.jboss.weld.bootstrap.api.helpers.ForwardingBootstrap.deployBeans(ForwardingBootstrap.java:63)
at org.jboss.weld.environment.se.Weld.initialize(Weld.java:143)
at org.jberet.se.SEArtifactFactory.<init>(SEArtifactFactory.java:31)
at org.jberet.se.BatchSEEnvironment.getArtifactFactory(BatchSEEnvironment.java:89)
at org.jberet.operations.JobOperatorImpl.<init>(JobOperatorImpl.java:69)
at java.lang.J9VMInternals.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1887)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:385)
... 3 more
Caused by: java.lang.IncompatibleClassChangeError: incompatible InnerClasses attribute between "javax.el.BeanELResolver$1" and "java
x.el.BeanELResolver"
at java.lang.Class.getDeclaringClass(Class.java:1034)
at java.lang.Class.getEnclosingClass(Class.java:2604)
at org.jboss.weld.util.reflection.Reflections.isNonStaticInnerClass(Reflections.java:388)
at org.jboss.weld.util.Beans.isTypeManagedBeanOrDecoratorOrInterceptor(Beans.java:486)
at org.jboss.weld.bootstrap.BeanDeployer.createClassBean(BeanDeployer.java:233)
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:74)
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:72)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
at java.util.concurrent.FutureTask.run(FutureTask.java:274)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
at java.lang.Thread.run(Thread.java:809)
I think the problem lies in some discrepency in dependencies. Here is a detailed discussion on this error in general:
What causes java.lang.IncompatibleClassChangeError?

"heros.solver.CountingThreadPoolExecutor - Worker thread execution failed: null Exceptions" when running nightly build soot-trunk

I was converting apk file to jimple files and then converting they back to the .dex file immediately. But I cannot do the second the step successfully.
Command line used:
java -Xmx4g -jar soot-trunk.jar soot.Main -p cg.spark verbose:true,on-fly-cg:true -w -allow-phantom-refs -force-android-jar /home/xia/Downloads/android-platforms-master/android-17 -src-prec apk -f jimple -process-dir com.halfbrick.fruitninjafree.apk
In the beginning, it keeps on throwing this exception:
java.lang.RuntimeException: Error parsing class com.google.android.gms.plus.model.moments.MomentBuffer [22,40] expecting: quoted name, identifier
at soot.JimpleClassSource.resolve(JimpleClassSource.java:61)
at soot.SootResolver.bringToHierarchy(SootResolver.java:239)
at soot.SootResolver.bringToSignatures(SootResolver.java:266)
at soot.SootResolver.bringToBodies(SootResolver.java:304)
at soot.SootResolver.processResolveWorklist(SootResolver.java:163)
at soot.SootResolver.resolveClass(SootResolver.java:131)
at soot.Scene.loadClass(Scene.java:725)
at soot.Scene.loadClassAndSupport(Scene.java:710)
at soot.Scene.loadNecessaryClasses(Scene.java:1448)
at soot.Main.run(Main.java:243)
at soot.Main.main(Main.java:147)
Caused by: soot.jimple.parser.parser.ParserException: [22,40] expecting: quoted name, identifier
at soot.jimple.parser.parser.Parser.parse(Parser.java:1454)
at soot.jimple.parser.JimpleAST.(JimpleAST.java:57)
at soot.JimpleClassSource.resolve(JimpleClassSource.java:42)
... 10 more
I found that there are some syntax mistakes (might be) in the converted jimple file. For example, in the jimple files, there are some classes named like this:
com.google.android.gms.internal.'if'
java.lang.'annotation'.Annotation
Then I fixed the mistakes manually (by remove single quote and replace 'if' with other variable name like iff).
After I fixed the above mistakes, it shows another exception:
Warning: android.content.OperationApplicationException is a phantom class!
Warning: android.database.MatrixCursor$RowBuilder is a phantom class!
Warning: android.content.ContentProviderResult is a phantom class!
[Call Graph] For information on where the call graph may be incomplete, use the verbose option to the cg phase.
[Thread-1] ERROR heros.solver.CountingThreadPoolExecutor - Worker thread execution failed: null
[Thread-8] ERROR heros.solver.CountingThreadPoolExecutor - Worker thread execution failed: null
[Thread-7] ERROR heros.solver.CountingThreadPoolExecutor - Worker thread execution failed: null
java.lang.NullPointerException
at soot.toolkits.graph.UnitGraph.(UnitGraph.java:76)
at soot.toolkits.graph.ExceptionalUnitGraph.(ExceptionalUnitGraph.java:158)
at soot.jimple.toolkits.scalar.UnreachableCodeEliminator.internalTransform(UnreachableCodeEliminator.java:79)
at soot.BodyTransformer.transform(BodyTransformer.java:51)
at soot.Transform.apply(Transform.java:105)
at soot.JimpleBodyPack.applyPhaseOptions(JimpleBodyPack.java:61)
at soot.JimpleBodyPack.internalApply(JimpleBodyPack.java:95)
at soot.Pack.apply(Pack.java:125)
at soot.jimple.JimpleMethodSource.getBody(JimpleMethodSource.java:49)
at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:91)
at soot.SootMethod.retrieveActiveBody(SootMethod.java:322)
at soot.PackManager$3.run(PackManager.java:1223)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
[Thread-6] ERROR heros.solver.CountingThreadPoolExecutor - Worker thread execution failed: null
java.lang.NullPointerException
at soot.toolkits.graph.UnitGraph.(UnitGraph.java:76)
at soot.toolkits.graph.ExceptionalUnitGraph.(ExceptionalUnitGraph.java:158)
at soot.jimple.toolkits.scalar.UnreachableCodeEliminator.internalTransform(UnreachableCodeEliminator.java:79)
at soot.BodyTransformer.transform(BodyTransformer.java:51)
at soot.Transform.apply(Transform.java:105)
at soot.JimpleBodyPack.applyPhaseOptions(JimpleBodyPack.java:61)
...
At first I think it's the bug of the tool, but the answer of other question says that the bug has been fixed. But I still get this problem. Does any one know where the problem is? Thank you very much.

Drools 6.3 error when using java 8

I am new to Drools and I am using Drools 6.3 final along with java 1.8 on eclipse. I am not using ant/Maven for building my project. The same project used to work fine with java 1.6 and Drools 5.1.
Now when i try to run the project, I get an error :
java.lang.Exception: java.lang.ClassCastException: org.drools.core.base.accumulators.BigDecimalAverageAccumulateFunction cannot be cast to org.drools.runtime.rule.AccumulateFunction
com.ibm.msg.client.jms.DetailedJMSException: JMSCC0037: A runtime exception was thrown by the MessageListener.onMessage() method. A message consumer with a registered message listener received an exception from the onMessage() method. The onMessage() method should be changed to avoid throwing exceptions.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:313)
at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:388)
at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:104)
at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl$JmsProviderMessageListener.handleOnMessageThrowable(JmsMessageConsumerImpl.java:1178)
at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl$JmsProviderMessageListener.onMessage(JmsMessageConsumerImpl.java:1050)
at com.ibm.msg.client.wmq.internal.WMQAsyncConsumerShadow.honourNoLocal(WMQAsyncConsumerShadow.java:566)
at com.ibm.msg.client.wmq.internal.WMQAsyncConsumerShadow.consumer(WMQAsyncConsumerShadow.java:400)
at com.ibm.mq.jmqi.remote.internal.RemoteAsyncConsume.driveConsumer(RemoteAsyncConsume.java:1527)
at com.ibm.mq.jmqi.remote.internal.RemoteDispatchThread.run(RemoteDispatchThread.java:395)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:209)
at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:100)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:224)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:298)
at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1220)
Caused by: java.lang.Exception: java.lang.ClassCastException: org.drools.core.base.accumulators.BigDecimalAverageAccumulateFunction cannot be cast to org.drools.runtime.rule.AccumulateFunction
at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl$JmsProviderMessageListener.handleOnMessageThrowable(JmsMessageConsumerImpl.java:1180)
... 10 more
I have also tried the solution mentioned here.
Also earlier I was getting this error which sometimes occurs or sometimes doesnt :
java.lang.Exception: java.lang.NoClassDefFoundError: org/drools/builder/CompositeKnowledgeBuilder
com.ibm.msg.client.jms.DetailedJMSException: JMSCC0037: A runtime exception was thrown by the MessageListener.onMessage() method. A message consumer with a registered message listener received an exception from the onMessage() method. The onMessage() method should be changed to avoid throwing exceptions.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:313)
at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:388)
at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:104)
at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl$JmsProviderMessageListener.handleOnMessageThrowable(JmsMessageConsumerImpl.java:1178)
at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl$JmsProviderMessageListener.onMessage(JmsMessageConsumerImpl.java:1050)
at com.ibm.msg.client.wmq.internal.WMQAsyncConsumerShadow.honourNoLocal(WMQAsyncConsumerShadow.java:566)
at com.ibm.msg.client.wmq.internal.WMQAsyncConsumerShadow.consumer(WMQAsyncConsumerShadow.java:400)
at com.ibm.mq.jmqi.remote.internal.RemoteAsyncConsume.driveConsumer(RemoteAsyncConsume.java:1527)
at com.ibm.mq.jmqi.remote.internal.RemoteDispatchThread.run(RemoteDispatchThread.java:395)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:209)
at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:100)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:224)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:298)
at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1220)
Caused by: java.lang.Exception: java.lang.NoClassDefFoundError: org/drools/builder/CompositeKnowledgeBuilder
at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl$JmsProviderMessageListener.handleOnMessageThrowable(JmsMessageConsumerImpl.java:1180)
... 10 more
Caused by: java.lang.NoClassDefFoundError: org/drools/builder/CompositeKnowledgeBuilder
Can anyone please guide me as to why these errors are occuring and what could be the possible solutions?
PS : the Drools jar which I have included in my build path :
drools-compiler-6.3.0.Final.jar
drools-core-6.3.0.Final.jar
kie-api-6.3.0.Final.jar
kie-internal-6.3.0.Final.jar
knowledge-api-6.3.0.Final-sources.jar
org.apache.servicemix.bundles.drools-5.6.0.Final_1.jar -- this is the latest which i could find

Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase

I use neo4j:2.2.4. This is my error:
Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, D:\neo4j\neo4j-enterprise-2.2.4\data\new_movie
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:366)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:59)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:91)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:181)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:71)
at traverser.Traversals.startTraversing(Traversals.java:34)
at traverser.Traversals.main(Traversals.java:28)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.transaction.XaDataSourceManager#1f6670f' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:343)
... 6 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource#1a1f567' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115)
at org.neo4j.kernel.impl.transaction.XaDataSourceManager.start(XaDataSourceManager.java:164)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507)
... 8 more
Caused by: org.neo4j.kernel.impl.storemigration.StoreUpgrader$UnexpectedUpgradingStoreVersionException: 'neostore.nodestore.db' has a store version number that we cannot upgrade from. Expected 'v0.A.1' but file is version 'NodeStore v0.A.5'.
at org.neo4j.kernel.impl.storemigration.UpgradableDatabase.checkUpgradeable(UpgradableDatabase.java:80)
at org.neo4j.kernel.impl.storemigration.StoreMigrator.needsMigration(StoreMigrator.java:135)
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.getParticipantsEagerToMigrate(StoreUpgrader.java:268)
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.migrateIfNeeded(StoreUpgrader.java:143)
at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.start(NeoStoreXaDataSource.java:344)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507)
... 11 more
The source of your error looks like
"has a store version number that we cannot upgrade from. Expected 'v0.A.1' but file is version 'NodeStore v0.A.5'. at"
You may take a look at this post : https://github.com/jexp/batch-import/issues/101
It sort of looks like you store is semi-upgraded, although I don't know how that would have happened. Could you copy-paste contents from your <graph.db>/messages.log file, whatever is in between the last:
--- INITIALIZED diagnostics START ---
and
--- INITIALIZED diagnostics END ---
that might help in investigations. Thanks

Categories

Resources