0 Replies Latest reply on Jan 27, 2016 3:45 PM by 6b82b4c7-162e-4d4a-af00-ce38b7de9e95

    Restful service in netbeans with glassfish and hibernate

    6b82b4c7-162e-4d4a-af00-ce38b7de9e95

      Netbeans project.

      1) create the project JAVA EE Web application

      characteristics of the project:

      Server: GlassFish Server 4.1

      java EE version: JAVA EE 7 Web

      Context Path: /RestApp

      hibernate 4.3.1

      connection name: jdbc:postgresql://localhost:5432/prueba

       

      2)i applied reverse engineering:

      hibernate.reveng.xml

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd">

      <hibernate-reverse-engineering>

        <schema-selection match-catalog="prueba" match-schema="public"/>

        <table-filter match-name="pro_eje_estrategico"/>

      </hibernate-reverse-engineering>

       

      3)hibernate mapping files and POJOs from Database with EJB3 annotations

       

      4)RESTful Web Services from Entity classes

      Persistence Unit Name:RestAppPU

      presistence provider: Hibernate (JPA 2.1)

      Data source:

        JNDI Name:jniprueba

        database connection: jdbc:postgresql://localhost:5432/prueba

      true:Use java transaction APIs

      table generation strategy APIs:None

       

      5)when i try to test the service...:

      C:\NetBeansProjects\RestApp\nbproject\build-impl.xml:1049: The module has not been deployed.

      See the server log for details.

      BUILD FAILED (total time: 1 minute 24 seconds)

      linea 1049: <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>

      i dont understand, why this is happening, can someone help me? thanks

       

      the database:

      CREATE DATABASE prueba

        WITH OWNER = postgres

          ENCODING = 'UTF8'

          TABLESPACE = pg_default;

      CREATE TABLE public.pro_eje_estrategico (

        id_eje_estrategico BIGSERIAL,

        descripcion VARCHAR(250) NOT NULL,

        usuario_bitacora VARCHAR(50) DEFAULT "current_user"() NOT NULL,

        fecha_bitacora TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT now() NOT NULL,

        registro_bitacora VARCHAR(50) DEFAULT inet_client_addr() NOT NULL,

        CONSTRAINT pro_eje_estrategico_pkey PRIMARY KEY(id_eje_estrategico)

      ) WITHOUT OIDS;

      COMMENT ON COLUMN public.pro_eje_estrategico.id_eje_estrategico

      IS 'Identificador de la entidad';

      COMMENT ON COLUMN public.pro_eje_estrategico.descripcion

      IS 'Descripción del eje estratégico';

      COMMENT ON COLUMN public.pro_eje_estrategico.usuario_bitacora

      IS 'Da referencia al usuario de creación del control de auditoría en la base de datos.';

      COMMENT ON COLUMN public.pro_eje_estrategico.fecha_bitacora

      IS 'Identifica la fecha de creación de la auditoría en la base de datos.';

      COMMENT ON COLUMN public.pro_eje_estrategico.registro_bitacora

      IS 'Da referencia al ip de creación del control de auditoría en la base de datos.';

       

      the code:http://www.mediafire.com/download/328eppe88vaab3m/RestApp.rar