wood burning stoves 2.0*
The moose likes Java in General and the fly likes Java OPC Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java OPC Problem" Watch "Java OPC Problem" New topic
Author

Java OPC Problem

Eren Avsarogullari
Greenhorn

Joined: Dec 08, 2008
Posts: 1
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

Joined: Oct 13, 2005
Posts: 38039
    
  22
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

Joined: Mar 22, 2000
Posts: 12761
    
    5
javafish/clients/opc/JCustomOpc (wrong name: javafish/clients/opc/JCustomOPC)


Recall that Java is case sensitive.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38039
    
  22
Originally posted by William Brogden:


Recall that Java is case sensitive.


Aaaargh! I ought to learn to read!
 
 
subject: Java OPC Problem
 
Similar Threads
Recursion
Class path magic
NoClassDefFoundError
Exception
Interesting Question.