Quantcast
Channel: GlassFish Related Items on Java.net
Viewing all articles
Browse latest Browse all 1091

Problem to send or retrieve an entity ( Rest module > EJB module )

$
0
0

Hello folks,

I have 2 componentes that are deployed in my GF4:
- application-server.ear: contains 2 ejb modules and a java module that contains my entities...i have a persistence.xml inside /META-INF/ and another in jar that contains entities...
- application-rest.war: web services, lookup on EJBs...in pom.xml i have a dependency to entities jar..

persistence.xml from ejb

<?xml version="1.0" encoding="UTF-8"?></p><persistence xmlns="http://java.sun.com/xml/ns/persistence"<br />
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence<br />http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"<br />
	version="2.0"><br /><persistence-unit name="Weee_PU"><jta-data-source>jdbc/Weee</jta-data-source><br /><jar-file>lib/entities.jar</jar-file></p><properties><property name="eclipselink.ddl-generation" value="create-tables" /><property name="eclipselink.ddl-generation.output-mode" value="database" /></properties></persistence-unit></persistence>

persistence.xml from entities.jar

<?xml version="1.0" encoding="UTF-8"?></p><persistence xmlns="http://java.sun.com/xml/ns/persistence"<br />
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence<br />http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"<br />
	version="2.0"><br /><persistence-unit name="Weee_PU"><jta-data-source>jdbc/Weee</jta-data-source><br /><class>...</class></p><properties><property name="eclipselink.ddl-generation" value="create-tables" /><property name="eclipselink.ddl-generation.output-mode" value="database" /></properties></persistence-unit></persistence>

My deploy structure (glassfish_home/glassfish/domains/domain1/autodeploy) :

   - application-server.ear
          - user-ejb-module.jar
          - folder called 'lib'
                  - entities.jar

  - application-rest.ear
          - web-inf
              - lib
                   - entities.jar

The problem is when i call a webservice and try to send an object ( like User.java that is annotated with @Entity ) throgh EJBs method.

When EJB receives my entity object, all attributes are null and if i try to retrieve a entity, when REST class receives object from EJB, all fields are null.

Any ideas what's going on?

Thanks in advance.


Viewing all articles
Browse latest Browse all 1091

Trending Articles