Skip to main content

Merging from JBoss to GlassFish fails

14 replies [Last post]
tashtego
Offline
Joined: 2009-05-12

Hi.

I am developing some EJB3 application with a JSF webapp as GUI. Deploying it under JBoss works fine. When I am trying to deploy the same app under GlassFish, my context lookup for the session beans fails :-( What will I have to change for that?

The session beans only use @Stateless or @Stateful annotations. I even tried adding name= and mappedName to this annotation, but it doent change the result.

Help would be appreciated :(

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Martin Gainty

If the DB host is known populate all of the necessary property's in persistence.xml e.g.
Example 1-2 Configuring a Vendor Extension in the Persistence.xml File (Java SE)

oracle.toplink.essentials.PersistenceProvider
false

(otherwise you will need a JTA-DATA-SOURCE element to specify a valid JPA lookup)

http://www.oracle.com/technology/products/ias/toplink/JPA/essentials/top...

HTH
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

> Date: Wed, 8 Jul 2009 00:17:06 -0700
> From: glassfish@javadesktop.org
> To: users@glassfish.dev.java.net
> Subject: Re: Merging from JBoss to GlassFish fails
>
> added exclude-unlisted-classes, my persistence.xml looks like following, but the error stays the same. here first the verifier error:
>
> tests.persistence.DefaultProviderVerification
> -
>
> Test validity of EJB 3.0 persistence unit. This test tests validity using a portable persistence provider. Please refer to EJB 3.0 Persistence API Specification for further information.
>

> -
>
> For [ myapp#myappCore.jar#myappPU ]
> Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
>
> Exception Description: predeploy for PersistenceUnit [myappPU] failed.
>
> Internal Exception: Exception [TOPLINK-7243] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.ValidationException
>
> Exception Description: Missing meta data for class [de.xyz.myapp.core.model.AbstractEntity]. Ensure the class is not being excluded from your persistence unit by a true setting. If this is the case, you will need to include the class directly by adding a [de.xyz.myapp.core.model.AbstractEntity] entry for your persistence-unit.
>

>
>
>
>

>
>
>
>
oracle.toplink.essentials.PersistenceProvider > jdbc/myappdb
> false
>
>
>
>
> help would be apreciated :(
> [Message sent by forum member 'tashtego' (tashtego)]
>
> http://forums.java.net/jive/thread.jspa?messageID=354599
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

_________________________________________________________________
Insert movie times and more without leaving Hotmail®.
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tu...
[att1.html]

tashtego
Offline
Joined: 2009-05-12

i have a existing jta datasource. everything works fine when i turn my abstract entity which was flagged as abstract and @mappedsuperclass to a simple @entity class. the only problem i have left is using mappedsuperclass in glassfish/toplink. everything else runs fine.

tashtego
Offline
Joined: 2009-05-12

is this an official jboss bug?

tashtego
Offline
Joined: 2009-05-12

by the way i managed all other problems by now. means my app runs under
- glassfish AND jboss
- toplink AND hibernate
- Postgres AND mysql...

only file that has to be changed is persistence.xml. And the last trouble
that i have is this @~*+ damned @mappedsuperclass, which doesnt work :(

matterbury
Offline
Joined: 2008-05-01

Perhaps I'm just confused, but your persistence.xml says Hibernate and yet the error message says Toplink.

FWIW, this is what a working persistence.xml of mine contains (only the relevant difference):
[code]

oracle.toplink.essentials.PersistenceProvider jdbc/telco
[/code]

tashtego
Offline
Joined: 2009-05-12

its really confusing. i am in deed using hibernate. but before deploying to glassfish i am running the validator that tries to test the EAR. and this test verifier tells me the tries to test with toplink. i am examining the sample tutorial right now and will post my solution then. thx so far for the help

tashtego
Offline
Joined: 2009-05-12

well to get this finally done i would try to switch from hibernate to toplink. but i dont want to list every entity in persistence.xml. is there any property to tell toplink to discover all entities automatically?

tashtego
Offline
Joined: 2009-05-12

added exclude-unlisted-classes, my persistence.xml looks like following, but the error stays the same. here first the verifier error (abstractEntity is my mappedsuperclass):

tests.persistence.DefaultProviderVerification
-

Test validity of EJB 3.0 persistence unit. This test tests validity using a portable persistence provider. Please refer to EJB 3.0 Persistence API Specification for further information.

-

For [ myapp#myappCore.jar#myappPU ]
Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.EntityManagerSetupException

Exception Description: predeploy for PersistenceUnit [myappPU] failed.

Internal Exception: Exception [TOPLINK-7243] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.ValidationException

Exception Description: Missing meta data for class [de.xyz.myapp.core.model.AbstractEntity]. Ensure the class is not being excluded from your persistence unit by a true setting. If this is the case, you will need to include the class directly by adding a [de.xyz.myapp.core.model.AbstractEntity] entry for your persistence-unit.

oracle.toplink.essentials.PersistenceProvider jdbc/myappdb
false

help would be apreciated :(

Message was edited by: tashtego

tashtego
Offline
Joined: 2009-05-12

removing the @mappedsuperclass and making it an @entity would deploy my EJB3 project with toplink. but i would like to use the mappedsuperclass :( ...

mvatkina
Offline
Joined: 2005-04-04

Does it work if you do not run verifier as part of deployment?

tashtego
Offline
Joined: 2009-05-12

Seems like this adresses the error. Why isnt my mapped superclass accepted? ;(

Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
Exception Description: predeploy for PersistenceUnit [myAppPU] failed.
Internal Exception: Exception [TOPLINK-7243] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.ValidationException
Exception Description: [b]Missing meta data for class [/b][de.myapp.core.model.AbstractEntity]. Ensure the class is not being excluded from your persistence unit by a true setting. If this is the case, you will need to include the class directly by adding a [de.myapp.core.model.AbstractEntity] entry for your persistence-unit.

matterbury
Offline
Joined: 2008-05-01

In my experience, you cannot simply take an EAR from JBOSS and drop it into GF and expect it to work, because there are [still] app.server specific deployment descriptors. What descriptors are in your EAR and which ones, if any, did you add for GF?

For this particular message, what is in your persistence.xml?

tashtego
Offline
Joined: 2009-05-12

i only have persistence.xml, web.xml and faces-config.xml, i am working with annotations as far as possible. and tried not to programm specific for jboss or glassfish but to stay independant from app server implementations. but it seems that it didnt work out so far. my persistence.xml looks like following:

sekhar
Offline
Joined: 2003-06-25

Take a look at my blog : http://weblogs.java.net/blog/sekhar/archive/2008/02/migration_jboss.html . In this blog I described in detail how to migrate a JSF EJB 3 sample ( from JBoss samples ) to GlassFish.