How do I determine the cause of this error stack
Is it complaining about a missing Jar file ?
Thanks
Caught Exception while Creating QueueConnection from QueueConnectionFactory com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI. The Java(tm) MQI has thrown an exception describing the problem. See the linked exception for further information. com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI. The Java(tm) MQI has thrown an exception describing the problem. See the linked exception for further information.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)
at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:233)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6889)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6277)
at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:285)
at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6233)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:120)
at connection.JMSConnection.makeQueueConnectionMQSeries(JMSConnection.java:228)
at connection.JMSConnection.makeQueueConnection(JMSConnection.java:614)
at testType.JMS_PTP.setupMsgTransportProtocol(JMS_PTP.java:335)
at testType.JMS_PTP.run(JMS_PTP.java:806) Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9546: Error return code received. [1=java.lang.reflect.InvocationTargetException[null],3=NativeConstructorAccessorImpl.newInstance0]
at com.ibm.mq.jmqi.JmqiEnvironment.processESESecurity(JmqiEnvironment.java:989)
at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:809)
at com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:615)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6881)
... 8 more Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.ibm.mq.jmqi.JmqiEnvironment.processESESecurity(JmqiEnvironment.java:896)
... 11 more Caused by: java.lang.NoClassDefFoundError: com/ibm/mq/headers/MQDataException
at com.ibm.mq.ese.service.ServicesFactoryImpl.createPolicyService(ServicesFactoryImpl.java:173)
at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.createServices(InterceptedJmqiImpl.java:224)
at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.<init>(InterceptedJmqiImpl.java:184)
at com.ibm.mq.ese.jmqi.ESEJMQI.<init>(ESEJMQI.java:117)
... 16 more Caused by: java.lang.ClassNotFoundException: com.ibm.mq.headers.MQDataException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 20 more Linked Exception: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9546: Error return code received. [1=java.lang.reflect.InvocationTargetException[null],3=NativeConstructorAccessorImpl.newInstance0]
-----------------------------------------------
In order to identify the cause of an error in a StackTrace it is common to read the stack from bottom to up and look for the Caused by words. That is the main reason of your problem. In your particular case:
Caused by: java.lang.ClassNotFoundException: com.ibm.mq.headers.MQDataException
So that states that this class MQDataException was not found on your classpath. So you should put the jar that contain this class on the classpath of your application and it should work fine.
It is complaining about a missing class file. Where that file should be is up to you.
If its a standalone application, just install the WebSphere MQ Client in the location of your choice and add the just a few jars to the classpath as given here: http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzaw.doc%2Fjm10330_.htm . This would be easier I guess.
Related
When I startup my SpringBoot app (where I am using Cassandra as the DB), I get the following trace during startup :
Could not register Graph extensions; this is normal if Tinkerpop was explicitly excluded from classpath
Unable to load JNR native implementation. This could be normal if JNR is excluded from the classpath
java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler
at com.datastax.oss.driver.internal.core.os.Native$LibcLoader.load(Native.java:42)
at com.datastax.oss.driver.internal.core.os.Native.<clinit>(Native.java:59)
at com.datastax.oss.driver.internal.core.time.Clock.getInstance(Clock.java:34)
at com.datastax.oss.driver.internal.core.time.MonotonicTimestampGenerator.buildClock(MonotonicTimestampGenerator.java:109)
at com.datastax.oss.driver.internal.core.time.MonotonicTimestampGenerator.<init>(MonotonicTimestampGenerator.java:43)
at com.datastax.oss.driver.internal.core.time.AtomicTimestampGenerator.<init>(AtomicTimestampGenerator.java:52)
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:423)
at com.datastax.oss.driver.internal.core.util.Reflection.buildFromConfig(Reflection.java:246)
at com.datastax.oss.driver.internal.core.util.Reflection.buildFromConfig(Reflection.java:108)
at com.datastax.oss.driver.internal.core.context.DefaultDriverContext.buildTimestampGenerator(DefaultDriverContext.java:373)
at com.datastax.oss.driver.internal.core.util.concurrent.LazyReference.get(LazyReference.java:55)
at com.datastax.oss.driver.internal.core.context.DefaultDriverContext.getTimestampGenerator(DefaultDriverContext.java:759)
at com.datastax.oss.driver.internal.core.session.DefaultSession$SingleThreaded.init(DefaultSession.java:349)
at com.datastax.oss.driver.internal.core.session.DefaultSession$SingleThreaded.access$1100(DefaultSession.java:300)
at com.datastax.oss.driver.internal.core.session.DefaultSession.lambda$init$0(DefaultSession.java:146)
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
at io.netty.util.concurrent.PromiseTask.run(PromiseTask.java:106)
at io.netty.channel.DefaultEventLoop.run(DefaultEventLoop.java:54)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: jnr.posix.POSIXHandler
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
... 25 common frames omitted
The application starts fine, but is there a workaround to avoid/suppress this?
Looks like this was asked a long time ago, but I just ran across the same issue and resolved it myself, so I'm posting the solution here.
In my build.gradle file I added the following import
compile "com.github.jnr:jnr-posix:3.1.15"
I am trying to query a hive table via jdbc that uses avro storage format but I am getting a class not found error in the mr job spawned by the query. The strange thing is that I can run the query from hive shell without the exception occurring.
I can run a query that does not spawn a map reduce job (select * from table limit 10) and it works fine.
2014-03-12 10:23:34,040 WARN [main] org.apache.hadoop.mapred.YarnChild: Exception running child : java.io.IOException: java.lang.reflect.InvocationTargetException
at org.apache.hadoop.hive.io.HiveIOExceptionHandlerChain.handleRecordReaderCreationException(HiveIOExceptionHandlerChain.java:97)
at org.apache.hadoop.hive.io.HiveIOExceptionHandlerUtil.handleRecordReaderCreationException(HiveIOExceptionHandlerUtil.java:57)
at org.apache.hadoop.hive.shims.HadoopShimsSecure$CombineFileRecordReader.initNextRecordReader(HadoopShimsSecure.java:344)
at org.apache.hadoop.hive.shims.HadoopShimsSecure$CombineFileRecordReader.<init>(HadoopShimsSecure.java:291)
at org.apache.hadoop.hive.shims.HadoopShimsSecure$CombineFileInputFormatShim.getRecordReader(HadoopShimsSecure.java:405)
at org.apache.hadoop.hive.ql.io.CombineHiveInputFormat.getRecordReader(CombineHiveInputFormat.java:560)
at org.apache.hadoop.mapred.MapTask$TrackedRecordReader.<init>(MapTask.java:168)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:409)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:165)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1548)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:160)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.hadoop.hive.shims.HadoopShimsSecure$CombineFileRecordReader.initNextRecordReader(HadoopShimsSecure.java:330)
... 11 more
Caused by: java.lang.NoClassDefFoundError: org/apache/avro/mapred/FsInput
at org.apache.hadoop.hive.ql.io.avro.AvroGenericRecordReader.<init>(AvroGenericRecordReader.java:82)
at org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat.getRecordReader(AvroContainerInputFormat.java:51)
at org.apache.hadoop.hive.ql.io.CombineHiveRecordReader.<init>(CombineHiveRecordReader.java:65)
... 16 more
Caused by: java.lang.ClassNotFoundException: org.apache.avro.mapred.FsInput
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 19 more
Probably hive.aux.jars.path: The location of the plugin jars that contain implementations of user defined functions and serdes. The CLI can pick up another config value from your JDBC hiverserver/hiverservre2. Try running set hive.aux.jars.path; in the two environments and compare the results. Eg. here Denny adds all avro JARs to hive.aux.jars.path in hive-site.xml.
The solution is to execute the following sql stmt for each new connection created.
add jar /hive-ext/avro-mapred-1.7.5-cdh5.0.0-beta-2-hadoop2.jar ;
The path /hive-ext is local to the hive server ie on the same machine that is running the hive server
Be sure to change your statement to match the name of your avro-mapred jar file
Help me to solve this error.....
I do have the jars in the same deploy folder....Do not know why it is not linking....My error log is as follows...
Caused by: java.lang.UnsatisfiedLinkError: com.sun.medialib.codec.jpeg.Encoder.njpeg_encode_init()J
at com.sun.medialib.codec.jpeg.Encoder.njpeg_encode_init(Native Method)
at com.sun.medialib.codec.jpeg.Encoder.<init>(Encoder.java:26)
at com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageWriter.<init>(CLibJPEGImageWriter.java:148)
... 45 more
I am using BPM API to retrieve a list of task assigned to a particular user. But, While running the class file I am getting following error:--
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/j2ee/ws/common/jaxws/ServiceDelegateImpl
at oracle.bpm.client.BPMServiceClientFactory.<init>(BPMServiceClientFactory.java:102)
at oracle.bpm.client.BPMServiceClientFactory.getInstance(BPMServiceClientFactory.java:144)
at project3.Fixture.getBPMServiceClientFactory(Fixture.java:33)
at project3.Fixture.getBPMServiceClient(Fixture.java:49)
at project3.GetProcessInstances.testGetProcessInstances(GetProcessInstances.java:29)
at project3.GetProcessInstances.main(GetProcessInstances.java:24)
Caused by: java.lang.ClassNotFoundException: oracle.j2ee.ws.common.jaxws.ServiceDelegateImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
... 6 more
I have already added the following Jar file to my project:--
Oracle.bpm.runtime.jar
Oracle.bpm.client.jar
Bpm-services.jar
Wsclient.jar
But still the issue is not resolved..
Any Suggestion??????
Aside from the reason it is not working you should be using the TaskQueryService provided by Oracle out of the box.
I wrote an simple project using java rmi and exported to an executable jar file. When I tries to run it, sometimes i got exceptions and sometimes it works. When I specify -Djava.rmi.server.codebase=file:serverClasses/, it seems it didn't create the jar file correctly.
Here is the stacktrace:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: com.ServerBootstrap.IServer
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:413)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:377)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:177)
at com.v3q6.eece411.A2.ServerBootstrap.ChatRoomServer.main(ChatRoomServer.java:37)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: com.ServerBootstrap.IServer
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:403)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.ClassNotFoundException: com.ServerBootstrap.IServer
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:728)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:672)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:609)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:646)
at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:311)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:255)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1548)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1510)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1749)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
... 12 more
It seems the program doesn't recognize the codebase. In my case, all the files are local. Does anyone know what is the problem? thanks
Try explicitly specifying the name of the JAR file containing the com.ServerBootstrap.IServer class in your codebase, e.g.
-Djava.rmi.server.codebase=file:serverClasses/myjarfile.jar
The "Dynamic code downloading using JavaTM RMI (Using the java.rmi.server.codebase Property)" doc provides more information on the use of codebase and the options for its specification.
With a relative path specified for java.rmi.server.codebase, make sure that you are in the correct directory (the parent directory of "serverClasses") when starting the client. If that's hard to ensure, an absolute path for the codebase might be more reliable.
Also, remember that when running with the -jar option, the -classpath option is completely ignored. I don't think that's a problem here; the RMIClassLoader should still be able to work using the server's codebase setting. But if you are relying on the client having access to additional classes specified on the classpath, that won't work. You'll need to use the Class-path attribute in the main JAR file's manifest.
That's not a complete stacktrace, and I think you may have left out the part that shows the root cause of your problem.
If I recall correctly, ClassNotFoundException can sometimes be due to an exception thrown during static initialization of the class that is being loaded, or some class that it depends on. If this occurs, it will show up as a nested exception in the first stacktrace for the problem, at the next level of nesting. I recall (maybe incorrectly) that if your application repeats the attempted class load, the initialization exception is not in the resulting stacktrace.
EDIT: The complete stacktrace says that my theory is not correct.