quickfixj message factory produces bad type on operand stack using qf 1.6.0 and java 1.8.0_45 - quickfix

Jun 18, 2015 3:26:12 PM quickfix.mina.AbstractIoHandler exceptionCaught
SEVERE: java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
quickfix/fix44/Quote.get(Lquickfix/field/SettlType;)Lquickfix/field/SettlType; #2: invokevirtual
Reason:
Type 'quickfix/field/SettlType' (current frame, stack[1]) is not assignable to 'quickfix/CharField'
Current Frame:
bci: #2
flags: { }
locals: { 'quickfix/fix44/Quote', 'quickfix/field/SettlType' }
stack: { 'quickfix/fix44/Quote', 'quickfix/field/SettlType' }
Bytecode:
0x0000000: 2a2b b600 8257 2bb0
Is there a way to handle this error without rebuilding quickFIXJ?

In the quickfix mailing lists, it says that this is a currently unresolved problem with the 1.6.0-SNAPSHOT version of QF/J. Maybe we will treat all fields with different data types throughout the FIX versions simply as StringField in any case. But this has not been finalized yet.
I solved the problem by returning to Quickfix 1.5.2

I got the same issue with 1.6.0_1, and resolved with 1.6.4_1.

Related

Apache Flink Kryo serializer - ClassNotFoundException

I have a project in Apache Flink 1.8.1, with Scala 2.11 and Java 8. I used to use Maven for compiling and all the dependency management, but switched to Gradle... which leads me to this problem below:
j.l.ClassNotFoundException: om.tinker.my.project.ProjectPayload
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
... 3 frames excluded
at c.e.k.u.DefaultClassResolver.readName(DefaultClassResolver.java:172)
... 15 common frames omitted
Wrapped by: c.e.kryo.KryoException: Unable to find class: om.tinker.my.project.ProjectPayload
Serialization trace:
eventOutputTag (com.my.project.contexts.ProjectContext)
at c.e.k.u.DefaultClassResolver.readName(DefaultClassResolver.java:178)
at c.e.k.u.DefaultClassResolver.readClass(DefaultClassResolver.java:147)
at c.e.kryo.Kryo.readClass(Kryo.java:674)
at c.e.k.s.ReflectField.read(ReflectField.java:107)
at c.e.k.s.FieldSerializer.read(FieldSerializer.java:122)
at c.e.kryo.Kryo.readClassAndObject(Kryo.java:793)
at o.a.f.a.j.t.r.k.KryoSerializer.deserialize(KryoSerializer.java:346)
at o.a.f.s.r.s.StreamElementSerializer.deserialize(StreamElementSerializer.java:202)
at o.a.f.s.r.s.StreamElementSerializer.deserialize(StreamElementSerializer.java:46)
at o.a.f.r.p.NonReusingDeserializationDelegate.read(NonReusin...
First, the error message has a missing 'c'. The class path should be 'com.tinker.my.project.ProjectPayload'... I checked the files using that code and there's no missing 'c' in my import statements...
I also edit the Flink conf file to use a parent-first strategy...
Further background info:
I have another file called ProjectContext which has an ArrayList<ProjectPayload>. It also has the eventOutputTag (as mentioned in the serialization trace)... When i comment out ArrayList<ProjectPayload> and its getters/setters, EVERYTHING WORKS!
When i put back the instance variable and its getters/setters in ProjectContext, then ClassNotFoundException occurs...
Furthermore, i sprinkled tons of print statements, and i was able to create an instance of ProjectPayload, and log it out fine.
### Edit (June, 30, 2020) ###
In light of this serialization issue, i added this code:
env.getConfig.registerTypeWithKryoSerializer(classOf[ProjectPayload], classOf[JavaSerializer[ProjectPayload]])
and now i have this awkward (but similar) error:
"j.l.ClassNotFoundException: \u0005sr\u00008com.tinker.my.project.ProjectPayload+\"v
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
... 3 frames excluded
at c.e.k.u.DefaultClassResolver.readName(DefaultClassResolver.java:172)
... 15 common frames omitted
Wrapped by: c.e.kryo.KryoException: Unable to find class: \u0005sr\u00008com.tinker.my.project.ProjectPayload+\"v
Serialization trace:
allMyPayloads (com.tinker.my.project.ProjectContext)
at c.e.k.u.DefaultClassResolver.readName(DefaultClassResolver.java:178)
at c.e.k.u.DefaultClassResolver.readClass(DefaultClassResolver.java:147)
at c.e.kryo.Kryo.readClass(Kryo.java:674)
at c.e.k.s.ReflectField.read(ReflectField.java:107)
at c.e.k.s.FieldSerializer.read(FieldSerializer.java:122)
at c.e.kryo.Kryo.readClassAndObject(Kryo.java:793)
at o.a.f.a.j.t.r.k.KryoSerializer.deserialize(KryoSerializer.java:346)
at o.a.f.s.r.s.StreamElementSerializer.deserialize(StreamElementSerializer.java:202)
at o.a.f.s.r.s.StreamElementSerializer.deserialize(StreamElementSerializer.java:46)
at o.a.f.r.p.NonReusingDeserializationDelegate....
Turns out \u0005 is the unicode character 'ENQUIRY'. and \u00008 leads to gibberish on Google search results... will report back later
### Edit (July 1, 2020) ###
Some progress: I was initializing the ArrayList<ProjectPayload> inside the ProjectContext. When i removed that initialization, moved it outside, and then set the ArrayList value, my code got much further along. Then it complained about a HashMap<String, String> instance variable as well -- i ended up deleting it since it wasn't used.
Which now brings me to an IndexOutOfBoundsException:
j.l.IndexOutOfBoundsException: Index: 93, Size: 9
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
at java.util.ArrayList.get(ArrayList.java:433)
at c.e.k.u.MapReferenceResolver.getReadObject(MapReferenceResolver.java:62)
at c.e.kryo.Kryo.readReferenceOrNull(Kryo.java:838)
at c.e.kryo.Kryo.readObjectOrNull(Kryo.java:761)
at c.e.k.s.ReflectField.read(ReflectField.java:120)
... 12 common frames omitted
Wrapped by: c.e.kryo.KryoException: java.lang.IndexOutOfBoundsException: Index: 93, Size: 9
Serialization trace:
fooBarStr (com.tinker.my.project.contexts.ProjectContext)
at c.e.k.s.ReflectField.read(ReflectField.java:133)
at c.e.k.s.FieldSerializer.read(FieldSerializer.java:122)
at c.e.kryo.Kryo.readClassAndObject(Kryo.java:793)
at o.a.f.a.j.t.r.k.KryoSerializer.deserialize(KryoSerializer.java:346)
at o.a.f.s.r.s.StreamElementSerializer.deserialize(StreamElementSerializer.java:202)
at o.a.f.s.r.s.StreamElementSerializer.deserialize(StreamElementSerializer.java:46)
at o.a.f.r.p.NonReusingDeserializationDelegate.read(NonReusingDeserializationDelegate.java:55)
at o.a.f.r.i.n.a.s.SpillingAdaptiveSpanningRecordDeserializer.getNextRecord(SpillingAdaptiveSpanningRec...
and this Github issue on Kryo: https://github.com/EsotericSoftware/kryo/issues/456
Try this:
env.getConfig.registerTypeWithKryoSerializer(classOf[ProjectPayload], classOf[JavaSerializer[ProjectPayload]])
env.getConfig.registerTypeWithKryoSerializer(classOf[ProjectContext], classOf[JavaSerializer[ProjectContext]])
and make sure you are importing org.apache.flink.api.java.typeutils.runtime.kryo.JavaSerializer
https://ci.apache.org/projects/flink/flink-docs-stable/dev/custom_serializers.html#issue-with-using-kryos-javaserializer

Using GWT-polymer-elements in a GWT project?

I'm trying to use the elemetos polymer GWT in a project, but receives an exception.
This and the code that calls the polymer element:
public void onModuleLoad () {
try {
RootPanel.get () add (new PaperButton ().);
} Catch (Exception e) {
e.printStackTrace ();
}
This is the exessão:
Caused by: com.google.gwt.dev.shell.HostedModeException: JSNI rewriter found reference to non-existent field in a field reference or Java method tear-off: # java.util.ArrayList :: array with at / vaadin / polymer /Polymer.java(479)
lib inheritance xml
 
<Inherits name = "com.vaadin.polymer.Elements" />
the jar that was used:
vaadin-gwt-polymer-elements-1.2.3.0.jar
Complete log console:
jul 22, 2016 5:30:52 PM java.util.prefs.WindowsPreferences <init>
ADVERTÊNCIA: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
at com.google.gwt.dev.js.ast.JsVisitor.translateException(JsVisitor.java:482)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:469)
at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:444)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
at com.google.gwt.dev.js.JsToStringGenerationVisitor.visit(JsToStringGenerationVisitor.java:201)
at com.google.gwt.dev.js.ast.JsBinaryOperation.traverse(JsBinaryOperation.java:81)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:444)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
at com.google.gwt.dev.js.JsToStringGenerationVisitor.visit(JsToStringGenerationVisitor.java:436)
at com.google.gwt.dev.js.ast.JsExprStmt.traverse(JsExprStmt.java:41)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:444)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
at com.google.gwt.dev.js.JsToStringGenerationVisitor.printJsBlock(JsToStringGenerationVisitor.java:939)
at com.google.gwt.dev.js.JsSourceGenerationVisitor.visit(JsSourceGenerationVisitor.java:59)
at com.google.gwt.dev.js.ast.JsBlock.traverse(JsBlock.java:52)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:444)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
at com.google.gwt.dev.shell.Jsni.generateJavaScriptForHostedMode(Jsni.java:249)
at com.google.gwt.dev.shell.Jsni.getJavaScriptForHostedMode(Jsni.java:237)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.createNativeMethods(ModuleSpaceOOPHM.java:52)
at com.google.gwt.dev.shell.CompilingClassLoader.injectJsniMethods(CompilingClassLoader.java:1408)
at com.google.gwt.dev.shell.CompilingClassLoader.findClass(CompilingClassLoader.java:1178)
at com.google.gwt.dev.shell.CompilingClassLoader.loadClass(CompilingClassLoader.java:1223)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.vaadin.polymer.PolymerWidget.<init>(PolymerWidget.java:17)
at com.vaadin.polymer.paper.widget.PaperButton.<init>(PaperButton.java:105)
at com.vaadin.polymer.paper.widget.PaperButton.<init>(PaperButton.java:98)
at br.client.Aprend.onModuleLoad(Aprend.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:423)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:530)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:368)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.google.gwt.dev.shell.HostedModeException: JSNI rewriter found reference to non-existent field in a field reference or java method tear-off: #java.util.ArrayList::array at com/vaadin/polymer/Polymer.java(479)
at com.google.gwt.dev.shell.Jsni$JsSourceGenWithJsniIdentFixup.visit(Jsni.java:115)
at com.google.gwt.dev.js.ast.JsNameRef.traverse(JsNameRef.java:108)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
... 38 more
With the gwt-polymer-elements version you are using (1.2.3.0) you need to use GWT 2.8 Snapshot, due to JsInterop which is used. See this official notice from Vaadin:
NOTICE : We make extensive use of JsInterop a new feature in GWT for easily interacting with JavaScript. It is experimental in GWT-2.7 and will be stable in GWT-2.8.0, but starting from gwt-polymer-elements-1.2.1.0.beta1, we don't support 2.7.0 anymore nor it's legacy JsInterop syntax. If you got Uncaught java.lang.ClassCastException errors in the JavaScript console when running your application, it does mean that you are not using GWT-2.8.0-SNAPSHOT
Moreover your syntax is wrong and
RootPanel.get () add (new PaperButton ().); should be changed to RootPanel.get().add(new PaperButton());
I tested version 1.1.3.0-alpha1 with GWT 2.7 (SuperDevMode) and it is working fine. So please check your GWT version.
One more hint: For cross-browser-support you should add
<script src="your_app_name/bower_components/webcomponentsjs/webcomponents.js"></script>
to the head of your HTML file.

What is a Boxed Error in Scala?

When I run my application, the browser shows
[ExecutionException: Boxed Error]
It doesn't say anything about the line number, etc.
In the console, I have the following
! #6elaah0c8 - Internal server error, for (GET) [/testlearn] ->
play.api.Application$$anon$1: Execution exception[[ExecutionException: Boxed Error]]
at play.api.Application$class.handleError(Application.scala:289) ~[play_2.10.jar:2.1.1]
at play.api.DefaultApplication.handleError(Application.scala:383) [play_2.10.jar:2.1.1]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$17$$anonfun$apply$24.apply(PlayDefaultUpstreamHandler.scala:326) [play_2.10.jar:2.1.1]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$17$$anonfun$apply$24.apply(PlayDefaultUpstreamHandler.scala:324) [play_2.10.jar:2.1.1]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) [play_2.10.jar:2.1.1]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) [play_2.10.jar:2.1.1]
java.util.concurrent.ExecutionException: Boxed Error
at scala.concurrent.impl.Promise$.resolver(Promise.scala:52) ~[factorie-1.0.0-M4-jar-with-dependencies.jar:na]
at scala.concurrent.impl.Promise$.scala$concurrent$impl$Promise$$resolveTry(Promise.scala:44) ~[factorie-1.0.0-M4-jar-with-dependencies.jar:na]
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:116) ~[factorie-1.0.0-M4-jar-with-dependencies.jar:na]
at scala.concurrent.Promise$class.complete(Promise.scala:55) ~[factorie-1.0.0-M4-jar-with-dependencies.jar:na]
at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:58) ~[factorie-1.0.0-M4-jar-with-dependencies.jar:na]
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:23) [factorie-1.0.0-M4-jar-with-dependencies.jar:na]
Caused by: java.lang.AssertionError: assertion failed
at scala.Predef$.assert(Predef.scala:165) ~[factorie-1.0.0-M4-jar-with-dependencies.jar:na]
at cc.factorie.util.TraversableExtras$class.max2ByDouble(TraversableExtras.scala:95) ~[factorie-1.0.0-M4-jar-with-dependencies.jar:na]
at cc.factorie.package$$anon$2.max2ByDouble(package.scala:148) ~[factorie-1.0.0-M4-jar-with-dependencies.jar:na]
at cc.factorie.optimize.SampleRankExample.accumulateExampleInto(SampleRank.scala:31) ~[factorie-1.0.0-M4-jar-with-dependencies.jar:na]
at cc.factorie.optimize.OnlineTrainer$$anonfun$processExamples$3.apply(Trainer.scala:72) ~[factorie-1.0.0-M4-jar-with-dependencies.jar:na]
at cc.factorie.optimize.OnlineTrainer$$anonfun$processExamples$3.apply(Trainer.scala:63) ~[factorie-1.0.0-M4-jar-with-dependencies.jar:na]
"Boxed Error" is Scala's response to an Error being thrown within a Future. In Java, and hence Scala, subclasses of type Error have a special meaning as Fatal errors. See Differences between Exception and Error. In short, the javadoc says:
An Error is a subclass of Throwable that indicates serious problems
that a reasonable application should not try to catch. Most such
errors are abnormal conditions.
Unlike throwing other Throwables within a future, when a subclass of Error is thrown, the default Scala resolver will wrap up the Error in a java.util.concurrent.ExecutionException, with the message string "Boxed Error", and complete your promise with a failure.
To quote the futures documentation http://docs.scala-lang.org/overviews/core/futures.html w.r.t. Error being thrown:
[Error] exceptions are rethrown in the thread executing the failed
asynchronous computation. The rationale behind this is to prevent
propagation of critical and control-flow related exceptions normally
not handled by the client code and at the same time inform the client
in which future the computation failed.
If you want to do something special with the Failure, the original Error that was thrown can be extracted (but not in a way particularly amenable to pattern matching), by ExecutionException#getCause()
I don't know that's a Boxed Error, but according to your stacktrace, the root problem comes from the factorie lib, from the max2Double method at line 95.
Extract from the source code:
/**Returns both the maximum element and the second-to-max element */
def max2ByDouble(extractor: A => Double): (A, A) = {
val s1 = t.toSeq
assert(s1.length > 1) // <<<== HERE
var best1 = Double.NegativeInfinity
...
It seems that your Traversable is empty.

Akka warning about "Too many HashedWheelTimer instances"

I'm getting the following warning when my Akka 1.2-based application tries to work with more than 500 or so grid nodes:
Jan 05, 2012 1:36:43 PM org.jboss.netty.util.internal.SharedResourceMisuseDetector
WARNING: You are creating too many HashedWheelTimer instances.
HashedWheelTimer is a shared resource that must be reused across the application, so that only a few instances are created.
I'm going to dig more deeply into the Akka code to find out where the HashedWheelTimer is being used and what I should do to avoid too many of those being created. While I'm doing that, I thought I'd post the warning here in case one of the experts may be able to give me a pointer or two that may narrow and speed up my search, please?
Using Akka 1.3-RC6, I'm getting the following exception:
Jan 12, 2012 1:24:38 PM org.jboss.netty.util.HashedWheelTimer
WARNING: An exception was thrown by TimerTask.
org.jboss.netty.channel.ChannelException: Failed to open a socket.
at org.jboss.netty.channel.socket.nio.NioClientSocketChannel.newSocket(NioClientSocketChannel.java:49)
at org.jboss.netty.channel.socket.nio.NioClientSocketChannel.<init>(NioClientSocketChannel.java:83)
at org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory.newChannel(NioClientSocketChannelFactory.java:139)
at org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory.newChannel(NioClientSocketChannelFactory.java:86)
at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:218)
at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)
at akka.remote.netty.ActiveRemoteClient.connect(NettyRemoteSupport.scala:470)
at akka.remote.netty.ActiveRemoteClientHandler$$anonfun$channelClosed$1$$anon$4.run(NettyRemoteSupport.scala:599)
at org.jboss.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:519)
at org.jboss.netty.util.HashedWheelTimer$Worker.notifyExpiredTimeouts(HashedWheelTimer.java:440)
at org.jboss.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:379)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.net.SocketException: Too many open files
at sun.nio.ch.Net.socket0(Native Method)
at sun.nio.ch.Net.socket(Net.java:323)
at sun.nio.ch.Net.socket(Net.java:316)
at sun.nio.ch.SocketChannelImpl.<init>(SocketChannelImpl.java:101)
at sun.nio.ch.SelectorProviderImpl.openSocketChannel(SelectorProviderImpl.java:60)
at java.nio.channels.SocketChannel.open(SocketChannel.java:142)
at org.jboss.netty.channel.socket.nio.NioClientSocketChannel.newSocket(NioClientSocketChannel.java:47)
... 11 more
Has been fixed in Akka 2.0-M1, I've now backported the fix to 1.3 and it will be in the next RC.

Windows(dev) to Linux(prod) Zend Framework migration errors

I'm getting the following error migrating my code across from my Windows dev machine to my linxu production machine. I'm aware there are always separator and case sensitivity issues (which I have fixed), however this one seems to be coming from the Framework itself.
My controllers are all following the convention (Uppercase first camel).
I'm using the bootstrap provided by Zend_App and this is all working (well with no errors) on my dev box.
Its parsing Plugins, however can't seem to get to controllers.
Any ideas would be great. :-)
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in /****mywebroot***/library/Zend/Controller/Dispatcher/Standard.php:242 Stack trace: #0 //****mywebroot***/library/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 /****mywebroot***/library/Zend/Application/Bootstrap/Bootstrap.php(77): Zend_Controller_Front->dispatch() #2 /****mywebroot***/public/index.php(26): Zend_Application->run() #4 {main} thrown in /****mywebroot***/library/Zend/Controller/Dispatcher/Standard.php on line 242
I'm hoping this is a basic error
Triple check the case the name of files and directories your controllers are in.
This specific exception could also be caused by not having a default controller available.