Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

I wrote a simple Web Based Application insertion Program using Hibernate

Tushar2098Nov 11 2013

And all i came up with the following error

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception 

root cause

java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Error reading configuration file java.util.ServiceLoader.fail(ServiceLoader.java:224) java.util.ServiceLoader.parse(ServiceLoader.java:301) java.util.ServiceLoader.access$200(ServiceLoader.java:181) java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:349) java.util.ServiceLoader$1.hasNext(ServiceLoader.java:432) org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:247) org.hibernate.integrator.internal.IntegratorServiceImpl.<init>(IntegratorServiceImpl.java:53) org.hibernate.service.internal.BootstrapServiceRegistryImpl.<init>(BootstrapServiceRegistryImpl.java:89) org.hibernate.service.internal.BootstrapServiceRegistryImpl.<init>(BootstrapServiceRegistryImpl.java:66) org.hibernate.service.ServiceRegistryBuilder.<init>(ServiceRegistryBuilder.java:76) org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1850) org.Servlet.PersonalDetails.doGet(PersonalDetails.java:124) javax.servlet.http.HttpServlet.service(HttpServlet.java:621) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) 

root cause

java.io.FileNotFoundException: D:\Stay Out!! (The system cannot find the file specified) java.util.zip.ZipFile.open(Native Method) java.util.zip.ZipFile.<init>(ZipFile.java:214) java.util.zip.ZipFile.<init>(ZipFile.java:144) java.util.jar.JarFile.<init>(JarFile.java:152) java.util.jar.JarFile.<init>(JarFile.java:89) sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:93) sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69) sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:98) sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122) sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:150) java.net.URL.openStream(URL.java:1035) java.util.ServiceLoader.parse(ServiceLoader.java:296) java.util.ServiceLoader.access$200(ServiceLoader.java:181) java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:349) java.util.ServiceLoader$1.hasNext(ServiceLoader.java:432) org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:247) org.hibernate.integrator.internal.IntegratorServiceImpl.<init>(IntegratorServiceImpl.java:53) org.hibernate.service.internal.BootstrapServiceRegistryImpl.<init>(BootstrapServiceRegistryImpl.java:89) org.hibernate.service.internal.BootstrapServiceRegistryImpl.<init>(BootstrapServiceRegistryImpl.java:66) org.hibernate.service.ServiceRegistryBuilder.<init>(ServiceRegistryBuilder.java:76) org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1850) org.Servlet.PersonalDetails.doGet(PersonalDetails.java:124) javax.servlet.http.HttpServlet.service(HttpServlet.java:621) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) 

Here Is My Entity Class Source Code

package org.Servlet;

import java.io.IOException;

import java.io.PrintWriter;

import javax.persistence.Column;

import javax.persistence.Id;

import javax.servlet.ServletException;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import org.hibernate.Session;

import org.hibernate.SessionFactory;

import org.hibernate.cfg.Configuration;

public class PersonalDetails extends HttpServlet {

  private static final long serialVersionUID = 1L;

  @Id

  @Column(name="EMPLOYEE_ID")

  private int employeeId;

  @Column(name="FIRST_NAME")

  private String firstName;

  @Column(name="LAST_NAME")

  private String lastName;

  @Column(name="EMAIL")

  private String email;

  @Column(name="PASSWORD")

  private String password;

  public int getEmployeeId() {

  return employeeId;

  }

  public void setEmployeeId(int employeeId) {

  this.employeeId = employeeId;

  }

  public String getFirstName() {

  return firstName;

  }

  public void setFirstName(String firstName) {

  this.firstName = firstName;

  }

  public String getLastName() {

  return lastName;

  }

  public void setLastName(String lastName) {

  this.lastName = lastName;

  }

  public String getEmail() {

  return email;

  }

  public void setEmail(String email) {

  this.email = email;

  }

  public String getPassword() {

  return password;

  }

  public void setPassword(String password) {

  this.password = password;

  }  

    public PersonalDetails() {

        super();

    }

  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

   PersonalDetails person=new PersonalDetails();

  try{

  response.setContentType("text/html");

  PrintWriter out=response.getWriter();

  out.println("Hello Worlds");

  int emp_id=Integer.parseInt(request.getParameter("id"));

  String emp_fname=request.getParameter("fname");

  String emp_lname=request.getParameter("lname");

  String emp_email=request.getParameter("email");

  String emp_password=request.getParameter("password");

  person.setEmployeeId(emp_id);

  person.setFirstName(emp_fname);

  person.setLastName(emp_lname);

  person.setEmail(emp_email);

  person.setPassword(emp_password);

  }

  catch(Exception e)

  {

  System.out.println(e.getMessage());

  e.printStackTrace();

  }

  try{

  SessionFactory sessionfactory=new Configuration().configure().buildSessionFactory();//Error Line

  Session session=sessionfactory.openSession();

  session.beginTransaction();

  session.save(person);

  session.getTransaction().commit();

  session.close();

  }

  catch(Exception e)

  {

  System.out.println(e.getMessage());

  e.printStackTrace();

  }

  }

}

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 9 2013
Added on Nov 11 2013
0 comments
998 views