• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java OPC Problem

 
Eren Avsarogullari
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks...

İ connected my Java Application with S7 300 via JEasyOPC API(Java-OPC Bridge)...

For JCustomOpc.dll, my classpath is in System Variables : -DJava.library.path = D:\THESIS\OPC\jeasyopc-2.3.2\jeasyopc-2.3.2\lib
library.path = D:/THESIS/OPC/Yeni Klas�r/JEasyOPC/JEasyOPC2/lib/JCustomOpc

this dll is not catched by application and below exception is thrown...

My sample code is below and when i run, i catch "NoClassDefFoundError" exception...

Please help...

Eren



Exception in thread "main" java.lang.NoClassDefFoundError: javafish/clients/opc/JCustomOpc (wrong name: javafish/clients/opc/JCustomOPC)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(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 java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(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 java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at javafish.clients.opc.SynchReadItemExample.main(SynchReadItemExample.java:19)
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch
Hardly an advanced question. I thought it would be very complicated, but a NoClassDefFoundError with "wrong name" means the class file is not in its correct folder to match the package name. You will need to check the package name in the .java class against the name of the folder the .class file is in.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javafish/clients/opc/JCustomOpc (wrong name: javafish/clients/opc/JCustomOPC)


Recall that Java is case sensitive.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by William Brogden:


Recall that Java is case sensitive.


Aaaargh! I ought to learn to read!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic