I am trying to run java desktop application using command line.In this application I am using the serial port to communicate ans send and receive request and response.So i am using the RXTXserail.dll file and RXTXcomm.jar file.I am creating the application using net beans 7.1 version under the windows 7 OS.
It was running from net beans plate form but when i try to run the application jar file that time i am getting this below error
"C:\configurationtool\ModbusZigBee\dist>java -jar ModbusZigBee.jar
java.lang.UnsatisfiedLinkError: C:\Program Files\Java\jre6\bin\rxtxSerial.dll: C
an't load IA 32-bit .dll on a AMD 64-bit platform thrown while loading gnu.io.RX
TXCommDriver
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: C:\Progra
m Files\Java\jre6\bin\rxtxSerial.dll: Can't load IA 32-bit .dll on a AMD 64-bit
platformSubstance Raven Graphite failed to initialize
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
at modbuszigbee.SerialInterface.<init>(SerialInterface.java:58)
at modbuszigbee.ModbusZigBeeView.<init>(ModbusZigBeeView.java:111)
at modbuszigbee.ModbusZigBeeApp.startup(ModbusZigBeeApp.java:22)
at org.jdesktop.application.Application$1.run(Application.java:171)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)"
I am using 32 bit java 6 in my system. and rxtxserial.dll also 32 bit.i tried with 64 bit of rxtxserial.dll.But it did not work.
Please help.Thanks in advance.
Related
We have two applications launched using Java Web Start (jnlp file) and each application supporting different java version. One application supports Java/JRE 1.6 (supports java 1.5 but not Java 1.7 or 1.8) and the other supports Java/JRE 1.8 (only).
When we try to launch both the applications on the same desktop using direct JNLP links e.g. <serveraddress>/deploymentfolder/abc.jnlp, looks like the JavaWS cache gets corrupt and the applications are not working as expected.
We tried several methods of launching the applications listed below. In all cases, we configure two different .bat files to launch each application using complete java path e.g.
C:\java\jre1.6\javaws http://serveraddress/deploymentfolder/app1.jnlp
and
C:\java\jre1.8\javaws http://serveraddress2/deploymentfolder/app2.jnlp
Methods
Install JRE 1.6 using Java installer, use a copy-only (no need to install) copy of Java 1.8.
Install JRE 1.8 and used a copy-only copy of JRE 1.6
Install both versions
Use copy-only version of both versions
Along with first four methods, we tried to configure different JavaWS cache folder for different version by specifying it in deployment.properties file.
We could not get both the application running successfully in any try. In application logs, we see exceptions suggesting the cache is corrupt (pasted below).
Can anyone please suggest any ideas on how we can get these two applications running?
java.lang.RuntimeException: ERROR: Failed to recover corrupt cache entry
at com.sun.deploy.cache.CacheEntry.recover(Unknown Source)
at com.sun.deploy.cache.CacheEntry.getCodeSourceCache(Unknown Source)
at com.sun.deploy.cache.CachedJarFile.getCodeSourceCache(Unknown Source)
at com.sun.deploy.cache.CachedJarFile.findMatchingSignerIndices(Unknown Source)
at com.sun.deploy.cache.CachedJarFile.entryNames(Unknown Source)
at com.sun.deploy.cache.DeployCacheJarAccessImpl.entryNames(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler.assertTrust(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler.access$700(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler$ParentCallback.check(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler$ParentCallback.access$1500(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler$ChildElement.checkResource(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.checkResource(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
....
....
at java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
at java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
at java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
at java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
at java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
at java.awt.Window.processWindowEvent(Unknown Source)
at javax.swing.JFrame.processWindowEvent(Unknown Source)
at java.awt.Window.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
I have an application that is working for over a year,
All my classes were sitting in the default_package,
Since it got bigger (over 30 classes), I've decided to separate it to different packages.
I refactored everything, made the changes and handled all errors.
now it works perfect when I run it through eclipse, but when I export it to a runnable jar,
it is not working.
I tried both export methods:
Extract required Libraries....
and
Package required Libraries
doesn't work on either...
when I run it from command prompt I get the following error:
E:\Request Server 3.0>java -jar RequestSrvV3DB1111.jar
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at dudug.RequestServer.ServerInfoPanel.<init>(ServerInfoPanel.java:110)
at dudug.RequestServer.RequestServerDB$1.run(RequestServerDB.java:56)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Please HELP !!!
I feel silly.
#Chasmo enlightened me that the number after the class name (ServerInfoPanel.java:110)
was referring to the problematic line,
I checked there
and I found this code:
if (props.getProperty("OfflineDB").equals("0"))
dbOfflineMode.setBackground(Color.green);
else
dbOfflineMode.setBackground(Color.RED);
I forgot to add the value "OfflineDB" to my propFile, and that was the problem.
thanks #Chasmo
I am running java desktop application which is coded in java 1.4 version. i am using eclipe as my ide and trying to run that application in java 1.6 version in that project they use jcom jar file to export data to excel sheet. while i trying to click on excel button in desktop application . That functionality is not working and throwing below exception.but i build path properly in my project explorer jcom jar is present in referenced libraries. can any one plz help me to sort out this exception. thanks in advance.
Exception in thread "AWT-EventQueue-1" java.lang.UnsatisfiedLinkError: no jcom in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at jcom.IDispatch.(IDispatch.java:287)
at .StockManager.BusinessSheets.exportToExcel(BusinessSheets.java:2302)
at .StockManager.BusinessSheets$BusinessSheetPanel$3.mouseClicked(BusinessSheets.java:439)
at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at .StockManager.WaitCursorEventQueue.dispatchEvent(WaitCursorEventQueue.java:23)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
case 1:
jcom.dll is not in path.
solution:
put the jcom.dll in C:/Windows/System32
case 2:
jcom.dll is used by someother process
solution:
try to find that process and kill it.
The java.library.path is using for JNI shared libraries such as DLLs or .so files. It appears your jcom.jar (which you can see is being loaded on the third line of the stack so it finds the JAR) needs a jcom.dll. On windows, this has to be in your PATH or java.library.path
I have a weird exception in one my servers.
The same application (java, swing ) runs on several servers.
Each server runs with dual monitors.
Same jre version (jre 6 version 24)
All of them in a decent CPU/memory consumption.
In only one of them - when I drag my app from one monitor to the other it throws a java.lang.IllegalStateException exception. I have attached the full exception below.
Does anyone have any idea ?
Thank you.
And now, behold, the exception :
java.lang.IllegalStateException: Buffers have not been created
at sun.awt.windows.WComponentPeer.getBackBuffer(Unknown Source)
at java.awt.Component$FlipBufferStrategy.getBackBuffer(Unknown Source)
at java.awt.Component$FlipBufferStrategy.updateInternalBuffers(Unknown Source)
at java.awt.Component$FlipBufferStrategy.revalidate(Unknown Source)
at java.awt.Component$FlipBufferStrategy.revalidate(Unknown Source)
at java.awt.Component$FlipBufferStrategy.getDrawGraphics(Unknown Source)
at javax.swing.BufferStrategyPaintManager.prepare(Unknown Source)
at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
at java.awt.Container.paint(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Try adding the following parameter to your java command line:
-Dsun.java2d.d3d=false
having tried the following,
-Dsun.java2d.d3d=false
-Dsun.java2d.noddraw=true
-Dsun.java2d.ddoffscreen=false
-DJ2D_D3D=false
and NOT finding a solution, i stumbled on this which worked.
jframe.createBufferStrategy(1);
http://www.java-gaming.org/index.php/topic,25021.0
This is the case in the Oracle bug database: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6933331.
From the bug evaluation:
.. has no consequences other
than a stack trace dump in a console (no hang, no visual artifacts were reported)
I have written an applet program. It has some references to classes from java tools.jar in it (eg:- import com.sun.jdi.connect.IllegalConnectorArgumentsException)
When I run this applet through appletviewer utility it works fine. But when I embed this applet in HTML file and try to run it through web browser, I am getting exception about some classes not found at runtime:-
Java Plug-in 1.6.0_18
Using JRE version 1.6.0_18-b07 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Pras
java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/sun/jdi/connect/IllegalConnectorArgumentsException
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/sun/jdi/connect/IllegalConnectorArgumentsException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.sun.jdi.connect.IllegalConnectorArgumentsException
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 14 more
Caused by: java.io.FileNotFoundException: C:\pal\WTP_Workspace\JavaSocketBridge\bin\com\sun\jdi\connect\IllegalConnectorArgumentsException.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(Unknown Source)
at java.io.FileInputStream.(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 17 more
Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/sun/jdi/connect/IllegalConnectorArgumentsException
However the IllegalConnectorArgumentsException class is part of java runtime located inside tools.jar.
How I can get run it inside browser as well?
many thanks in advance.
Regards,
Pras
You are running your applet from the JRE. The class IllegalConnectorArgumentsException can only be access from the JDK since it's related to debugging.
Refer to this question.