Results 1 to 6 of 6
  1. #1
    coocoofly is offline Member
    Join Date
    Sep 2010
    Posts
    3
    Rep Power
    0

    Default Hibernate errors

    Hi,

    we're doing this payroll program using hibernate and gwt in eclipse 3.1 and having these errors:

    [exec] [ERROR] Errors in 'C:\opt\omega-payroll-1.3\src\com\omega\payroll\client\util\HibernateUti l.java'
    [exec] [ERROR] Line 3: The import org cannot be resolved
    [exec] [ERROR] Line 4: The import org cannot be resolved
    [exec] [ERROR] Line 9: SessionFactory cannot be resolved to a type
    [exec] [ERROR] Line 14: sessionFactory cannot be resolved
    [exec] [ERROR] Line 14: Configuration cannot be resolved to a type
    [exec] [ERROR] Line 18: ExceptionInInitializerError cannot be resolved to a type
    [exec] [ERROR] Line 23: SessionFactory cannot be resolved to a type
    [exec] [ERROR] Line 24: sessionFactory cannot be resolved

    i'm very new to java, how could this be resolved? i've been looking anywher and still cant avoid these errors, pls help.

    coocoofly

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    Presumably you or someone there has written this code (otherwise why are you compiling it)?

    So look at HibernateUtil.java and see what the problem is at those lines. After all, you have the code...we don't.

  3. #3
    coocoofly is offline Member
    Join Date
    Sep 2010
    Posts
    3
    Rep Power
    0

    Default

    here's the code and i ensure that hibernate3.jar is in the library:

    package com.company.payroll.client.util;

    import org.hibernate.SessionFactory;
    import org.hibernate.cfg.Configuration;
    import com.google.gwt.user.client.rpc.IsSerializable;

    public class HibernateUtil implements IsSerializable {

    private static final SessionFactory sessionFactory;

    static {
    try {
    // Create the SessionFactory from hibernate.cfg.xml
    sessionFactory = new Configuration().configure()
    .buildSessionFactory();
    } catch (Exception ex) {
    // Make sure you log the exception, as it might be swallowed
    throw new ExceptionInInitializerError(ex);
    }
    }

    /* ************************************************** ********************* */
    public static SessionFactory getSessionFactory() {
    return sessionFactory;
    }

    /* ************************************************** ********************* */

    }



    ________________________
    one more question, i tried this with eclipse 3.1 and what stated above is the error, but when i tried it with eclipse 3.4 it gives me a different error. what should i used, which one should i follow?

    tnx alot, ur answer is very much appreciated :)

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    Clearly it can't see the jar file for some reason...I'd always use the newest (stable) version of something if possible. There may be a bug in 3.1.

    What's the error in 3.4?

  5. #5
    coocoofly is offline Member
    Join Date
    Sep 2010
    Posts
    3
    Rep Power
    0

    Default

    when i compiled here's the errors:

    Buildfile: C:\opt\companyPayroll\build.ant.xml
    compile:
    [mkdir] Created dir: c:\opt\jakarta-tomcat-5.5.9\webapps\companyPayroll\WEB-INF\classes
    [javac] Compiling 75 source files to c:\opt\jakarta-tomcat-5.5.9\webapps\companyPayroll\WEB-INF\classes
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:11: package org.apache.commons.fileupload does not exist
    [javac] import org.apache.commons.fileupload.FileItem;
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:12: package org.apache.commons.fileupload does not exist
    [javac] import org.apache.commons.fileupload.FileItemFactory;
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:13: package org.apache.commons.fileupload does not exist
    [javac] import org.apache.commons.fileupload.FileUploadException;
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:14: package org.apache.commons.fileupload.disk does not exist
    [javac] import org.apache.commons.fileupload.disk.DiskFileItemFac tory;
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:15: package org.apache.commons.fileupload.servlet does not exist
    [javac] import org.apache.commons.fileupload.servlet.ServletFileU pload;
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:18: package com.Ostermiller.util does not exist
    [javac] import com.Ostermiller.util.CSVParser;
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er
    \LoadCsvServiceServlet.java:27: cannot find symbol
    [javac] symbol : class ServletFileUpload
    [javac] location: class com.company.payroll.server.LoadCsvServiceServlet
    [javac] ServletFileUpload upload = new ServletFileUpload( itemFactory );
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:78: cannot find symbol
    [javac] symbol : class FileItem
    [javac] location: class com.company.payroll.server.LoadCsvServiceServlet
    [javac] private FileItem getFileItem(HttpServletRequest request) {
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:101: cannot find symbol
    [javac] symbol : class FileItem
    [javac] location: class com.company.payroll.server.LoadCsvServiceServlet
    [javac] public File saveFile(FileItem fileItem) {
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:26: cannot find symbol
    [javac] symbol : class DiskFileItemFactory
    [javac] location: class com.omega.payroll.server.LoadCsvServiceServlet
    [javac] FileItemFactory itemFactory = new DiskFileItemFactory();
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:27: cannot find symbol
    [javac] symbol : class ServletFileUpload
    [javac] location: class com.company.payroll.server.LoadCsvServiceServlet
    [javac] ServletFileUpload upload = new ServletFileUpload( itemFactory );
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:39: cannot find symbol
    [javac] symbol : class FileItem
    [javac] location: class com.company.payroll.server.LoadCsvServiceServlet
    [javac] FileItem uploadItem = getFileItem(request);
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:82: cannot find symbol
    [javac] symbol : class FileItem
    [javac] location: class com.company.payroll.server.LoadCsvServiceServlet
    [javac] List<FileItem> items = upload.parseRequest(request);
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:83: cannot find symbol
    [javac] symbol : class FileItem
    [javac] location: class com.company.payroll.server.LoadCsvServiceServlet
    [javac] Iterator<FileItem> it = items.iterator();
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:84: cannot find symbol
    [javac] symbol : class FileItem
    [javac] location: class com.company.payroll.server.LoadCsvServiceServlet
    [javac] FileItem item = (FileItem) it.next();
    [javac] ^
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:84: cannot find symbol
    [javac] symbol : class FileItem
    [javac] location: class com.company.payroll.server.LoadCsvServiceServlet
    [javac] FileItem item = (FileItem) it.next();
    [javac] C:\opt\companyPayroll\src\com\company\payroll\serv er\LoadCsvServiceServlet.java:124: cannot find symbol
    [javac] symbol : class CSVParser
    [javac] location: class com.company.payroll.server.LoadCsvServiceServlet
    [javac] CSVParser csvParser = new CSVParser(inputStream);
    [javac] ^
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 20 errors

    BUILD FAILED
    C:\opt\companyPayroll\build.ant.xml:49: Compile failed; see the compiler error output for details.

    Total time: 3 seconds

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    Well, that's complaining you haven't got apache commons.

    ETA: Oh and whatever "com.Ostermiller.util" is.

Similar Threads

  1. errors
    By santosh chauhan in forum New To Java
    Replies: 5
    Last Post: 07-26-2010, 07:59 PM
  2. Errors,errors and errors
    By xpatiencex in forum New To Java
    Replies: 6
    Last Post: 04-25-2009, 04:43 AM
  3. Replies: 3
    Last Post: 03-08-2009, 01:51 AM
  4. help with these errors
    By oceansdepth in forum New To Java
    Replies: 3
    Last Post: 04-16-2008, 04:55 PM
  5. Replies: 2
    Last Post: 06-30-2007, 03:01 PM

Tags for this Thread

Posting Permissions

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