Results 1 to 5 of 5
  1. #1
    KernelPanic is offline Member
    Join Date
    Apr 2012
    Posts
    16
    Rep Power
    0

    Question [Java 7 SE+MySQL+NetBeans 7.2.1+jooq 2.4.2]NoClassDefFound error

    Dear Sirs and Madams!

    I have included jooq 2.4.2 sql query builder into my project and in this project I have CDatabaseManager singleton class, which is responsible for all data operations. Now, I try to execute query with jooq with code:
    Java Code:
        public static ArrayList<String> getMultimediaExtensions(final String category) throws SQLException
        {
            ArrayList<String> results=new ArrayList<>();
            Factory create=null;
    
            try
            {
                if(CDatabaseManager.openConnection(CDatabaseManager.host(),
                        CDatabaseManager.dbName(),
                        CDatabaseManager.username(),
                        CDatabaseManager.password(),
                        CDatabaseManager.port(),
                        CDatabaseManager.sslEnabled()))
                {
                    create=new Factory(CDatabaseManager.dbConnection(),
                            SQLDialect.MYSQL);
                    Result<Record> r=(Result<Record>)create.select().from("testMultimediaTable").fetch();
                }
            }
            catch(SQLException | DataAccessException ex)
            {
                System.out.println(ex.getMessage());
            }
            finally
            {
                if(!CDatabaseManager.closeConnection())
                {
                    results=null;
                }
            }
    
            return results;
        }   // getMultimediaExtensions
    Once I try to execute this method, I get:
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/jooq/exception/DataAccessException
    at ha.configurator.gui.CFrameMain.getMultimediaRecord s(CFrameMain.java:360)
    at ha.configurator.gui.CFrameMain.keyPressed(CFrameMa in.java:275)
    at java.awt.Component.processKeyEvent(Component.java: 6463)
    at java.awt.Component.processEvent(Component.java:628 2)
    at java.awt.Container.processEvent(Container.java:222 9)
    at java.awt.Window.processEvent(Window.java:2022)
    at java.awt.Component.dispatchEventImpl(Component.jav a:4861)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2287)
    at java.awt.Window.dispatchEventImpl(Window.java:2719 )
    at java.awt.Component.dispatchEvent(Component.java:46 87)
    at java.awt.KeyboardFocusManager.redispatchEvent(Keyb oardFocusManager.java:1895)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEv ent(DefaultKeyboardFocusManager.java:762)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKe yEvent(DefaultKeyboardFocusManager.java:1027)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAsse rtions(DefaultKeyboardFocusManager.java:899)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent (DefaultKeyboardFocusManager.java:727)
    at java.awt.Component.dispatchEventImpl(Component.jav a:4731)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2287)
    at java.awt.Window.dispatchEventImpl(Window.java:2719 )
    at java.awt.Component.dispatchEvent(Component.java:46 87)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.j ava:723)
    at java.awt.EventQueue.access$200(EventQueue.java:103 )
    at java.awt.EventQueue$3.run(EventQueue.java:682)
    at java.awt.EventQueue$3.run(EventQueue.java:680)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPri vilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPri vilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:696)
    at java.awt.EventQueue$4.run(EventQueue.java:694)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPri vilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 693)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:244)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:147)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:139)
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:97)
    Caused by: java.lang.ClassNotFoundException: org.jooq.exception.DataAccessException
    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.j ava:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:4 23)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 56)
    ... 37 more
    Now, is it mandatory to create xml database map for jooq or not? I've included both mysql connectior jar and jooq jar's into my project, why do I get this error? And db connection is established succesfully, since I can see it in MySQL Workbench!

    Sincerely,
    Marko

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,172
    Rep Power
    20

    Default Re: [Java 7 SE+MySQL+NetBeans 7.2.1+jooq 2.4.2]NoClassDefFound error

    You have the jooq.jar on your runtime classpath?
    That's where I would be checking.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    KernelPanic is offline Member
    Join Date
    Apr 2012
    Posts
    16
    Rep Power
    0

    Default Re: [Java 7 SE+MySQL+NetBeans 7.2.1+jooq 2.4.2]NoClassDefFound error

    I've set jooq.jar in Netbeans in Compile time:[Java 7 SE+MySQL+NetBeans 7.2.1+jooq 2.4.2]NoClassDefFound error-projectconfiguration.png

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,172
    Rep Power
    20

    Default Re: [Java 7 SE+MySQL+NetBeans 7.2.1+jooq 2.4.2]NoClassDefFound error

    Not sure.
    Does Netbeans include all the jars contained in the folder, or is it treating the folder as if it was a directory containing classes?
    I would include the jars individually and see if that works.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    KernelPanic is offline Member
    Join Date
    Apr 2012
    Posts
    16
    Rep Power
    0

    Default Re: [Java 7 SE+MySQL+NetBeans 7.2.1+jooq 2.4.2]NoClassDefFound error

    I got rid of the error, I had some "stealth" exception and then the class coud not be found. I've fixed it!

Similar Threads

  1. NoClassDefFound error using PDFBox
    By Aminaz in forum New To Java
    Replies: 1
    Last Post: 04-29-2012, 11:38 AM
  2. Replies: 4
    Last Post: 07-24-2011, 09:52 AM
  3. java.lang.NoClassDefFound error
    By swathi dharmaraj in forum New To Java
    Replies: 11
    Last Post: 04-14-2011, 07:33 PM
  4. JPA application noclassdeffound error
    By ishakteyran in forum New To Java
    Replies: 2
    Last Post: 03-12-2010, 08:31 PM
  5. JPA application noclassdeffound error
    By ishakteyran in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 03-11-2010, 01:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •