Any idea what would cause this assertion failure in a Groovy script?
Exception in thread "Thread-2" groovy.lang.GroovyRuntimeException: exception while dumping process stream
at org.codehaus.groovy.runtime.ProcessGroovyMethods$ByteDumper.run(ProcessGroovyMethods.java:488)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: Bad file descriptor
at java.io.FileInputStream.available(Native Method)
at java.io.BufferedInputStream.read(BufferedInputStream.java:325)
at java.io.FilterInputStream.read(FilterInputStream.java:90)
at org.codehaus.groovy.runtime.ProcessGroovyMethods$ByteDumper.run(ProcessGroovyMethods.java:484)
... 1 more
I'm running Groovy 1.8.3 with JVM 1.6.0_14. I noticed an old bug report that was similar but I perform a waitFor() call after every process is started and it's reported to be fixed in 1.6.x.
I can't trap the exception apparently so I don't know exactly where it is happening. However, I'm guessing it occurs in this code segment:
def pipedOutputStream = new PipedOutputStream()
process.consumeProcessOutput(
new TeeOutputStream(System.out, pipedOutputStream),
new TeeOutputStream(System.err, pipedOutputStream))
new PipedInputStream(pipedOutputStream).eachLine {
(it =~ /condition/).find { process.destroy() }
}
System.exit(0)
Related
I have a project which is using Vertx and Micronaut DI
however something in this process breaks a simple capability in groovy of coercing a map to an interface
I have created a simple script like this. The same script in a simple groovy only project works just fine.
Has anyone else seen anything like this and what if anything needs to be fixed. I don't understand the error as the script itself isn't using DI or Vertx. I am assuming its something going wrong with Micronaut pre processors ?
package ioc
def map
map = [
i: 10,
hasNext: { map.i > 0 },
next: { map.i-- },
]
def iter = map as Iterator
iter.each {println it}
Which when i run it generates the following error.
Caught: java.lang.NoClassDefFoundError: io/vertx/codegen/annotations/DataObject
java.lang.NoClassDefFoundError: io/vertx/codegen/annotations/DataObject
at io.vertx.lang.groovy.VertxExtensionModule.asType(VertxExtensionModule.java:32)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at ioc.coerce.run(coerce.groovy:9)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Caused by: java.lang.ClassNotFoundException: io.vertx.codegen.annotations.DataObject
... 8 more
Process finished with exit code 1
Has any one seen anything like this and were able to fix it? Its a bit weird by itself.
can any body tell me the actual reason causing the below error:
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:7349)
at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1257)
at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:1449)
at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:1355)
at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:1340)
at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:7236)
at oracle.adf.model.bc4j.DCJboDataControl.executeIteratorBindingWithParams(DCJboDataControl.java:2987)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1541)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2150)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:740)
...
...
..
.
Caused by: java.lang.NullPointerException
at oracle.jdbc.driver.OraclePreparedStatement.setObjectAtName(OraclePreparedStatement.java:15884)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObjectAtName(OraclePreparedStatementWrapper.java:911)
at weblogic.jdbc.wrapper.PreparedStatement_oracle_jdbc_driver_OraclePreparedStatementWrapper.setObjectAtName(Unknown Source)
at oracle.jbo.server.OracleSQLBuilderImpl.bindParamValue(OracleSQLBuilderImpl.java:4669)
at oracle.jbo.server.BaseSQLBuilderImpl.bindParametersForStmt(BaseSQLBuilderImpl.java:3687)
at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:22684)
From the stacktrace, it seems some bind variable that is required by your view object query is not being set correctly.
If it works intermittently, it could be that the bind variable is lost at some point. To debug/test, try it with a hard-coded value for your bind variable and see if that works first (if you have a ViewCriteria, try removing that first) - then run the task flow and see if it works consistently.
I would suggest running the application in JDeveloper with -Djbo.debugoutput=console argument. It gives you a lot if information of what your business components are doing and you could catch the error cause in console logs.
I want to execute instance of supertype AbstractEntryProcessor (lets say SomeEntryProcessor) with IMap.executeOnKey method.
Server side ClassLoader doesn't have this class (SomeEntryProcessor).
So it expectedly fails with:
java.lang.ClassNotFoundException: com.package.SomeEntryProcessor
com.hazelcast.nio.serialization.HazelcastSerializationException: java.lang.ClassNotFoundException: com.package.SomeEntryProcessor
at com.hazelcast.nio.serialization.DefaultSerializers$ObjectSerializer.read(DefaultSerializers.java:190) ~[hazelcast-3.2.3.jar:3.2.3]
at com.hazelcast.nio.serialization.StreamSerializerAdapter.read(StreamSerializerAdapter.java:40) ~[hazelcast-3.2.3.jar:3.2.3]
at com.hazelcast.nio.serialization.SerializationServiceImpl.readObject(SerializationServiceImpl.java:279) ~[hazelcast-3.2.3.jar:3.2.3]
at com.hazelcast.nio.serialization.ByteArrayObjectDataInput.readObject(ByteArrayObjectDataInput.java:433) ~[hazelcast-3.2.3.jar:3.2.3]
at com.hazelcast.map.client.MapExecuteOnKeyRequest.read(MapExecuteOnKeyRequest.java:88) ~[hazelcast-3.2.3.jar:3.2.3]
But after this executeOnKey hangs forever.
I believe this happens due to infinite wait in method
ClientCallFuture.get(long timeout, TimeUnit unit) {
...
this.wait(waitMillis); // line 103 in hazelcast 3.2.3
}
Has anyone seen the same?
Created an issue https://github.com/hazelcast/hazelcast/issues/3842, but no response received
Sorry somehow missed the issue. Can you try a 3.3.x release? I guess the issue is fixed on those versions.
We have a number of sections of code in the format:
try
{
// code
}
catch(std::exception &e)
{
// log exception
}
catch(...)
{
// log unknown exception.
}
Every so often, the unknown exception code triggers, and logs an unknown exception.
I always thought that all exceptions were meant to derive from std::exception, and thus catching std::exception would catch all exceptions.
Is there some other exception that I should be catching?
If my code ends up in the unknown exception handler, is there any way that I can find out what exception was actually caught?
edit
We managed to locate the cause of the problem- despite saying that they had, the customer had not installed .NET 3.5, which our code depends on, and the system fell over when trying to use the XML parser.
Is there some other exception that I should be catching?
This depends on your code. Libraries you call can throw exceptions not derived from std::exception, examples are MFC's CException or Microsoft's _com_error. Also, an access violation might be catched by catch(...), which is the reason why I would not use catch(...) in my code - it's just to broad for me.
2.If my code ends up in the unknown exception handler, is there any way that I can find out what exception was actually caught?
You can run your code in the debugger and configure the debugger to break your program when the exception is thrown (first chance). Then you know exactly which line of code triggers the exception and should be able to see what exactly is thrown.
What is the meaning of groovy.lang$run.call(Unknown Source) and on what circumstances it will throw, this is the error what i'm getting in my groovy program
at groovy.lang$run.call(Unknown Source)
at groovy.lang.run(groovy.lang.Two_Script:6)
...................................................
...................................................
at groovy.lang.run(groovy.lang.Two_Script:6)
at groovy.lang$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121)
at one_script.run(level_one_script.groovy:5)
why it has not thrown at the compile time only # runtime it has thrown any Idea ?
attached the sample groovy these are very simple recursive calls;
level_one_script.groovy
new Two_Script(binding).run()
Two_Script.groovy
new Three_Script().run()
Three_Script.groovy
println "Anish"
the exception was thrown while evaluating Three_Script.groovy , it give me recurive call on Two_Script.groovy
Exception occurred while executing the script [level_one_script.groovy] - [java.lang.StackOverflowError].
try
{
compiledScript.eval(bindings)
//compiledScript is the type of CompiledScript
}
Surprising part is if i remove the call new Three_Script().run() from "Two_Script.groovy"
it shows me correct result
Surprising
If the Groovy scripts are all defined in a package, the error is not thrown.
If the scripts are moved to the default package (no package), the error is thrown.
What is the actual exception thrown (first few lines)
Looks like there's problem in your file level_one_script.groovy at line 5