Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment of EJB_Timer_App fails with reference to an application class #618

Closed
pdudits opened this issue Jan 27, 2016 · 7 comments
Closed

Comments

@pdudits
Copy link
Contributor

pdudits commented Jan 27, 2016

When deploying an ejb jar into embedded container on 4.1.161-SNAPSHOT following exception is thrown:

Exception Description: Predeployment of PersistenceUnit [__EJB__Timer__App] failed.
Internal Exception: Exception [EclipseLink-7250] (Eclipse Persistence Services - 2.6.2.qualifier): org.eclipse.persistence.exceptions.ValidationException
Exception Description: [<an application class>] uses a non-entity [<another application class in same persistence unit>] as target entity in the relationship attribute [field <field>].
    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:2035)
    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2026)
    at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactoryImpl(PersistenceProvider.java:347)
    at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:313)
    at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:207)
    at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:114)
    at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)
    at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)
    at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)
    at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:434)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
    at org.glassfish.ejb.persistent.timer.PersistentEJBTimerService.deployEJBTimerService(PersistentEJBTimerService.java:1463)
    at org.glassfish.ejb.persistent.timer.PersistentEJBTimerService.initEJBTimerService(PersistentEJBTimerService.java:1369)
    at org.glassfish.ejb.persistent.timer.DistributedEJBTimerService.initPersistentTimerService(DistributedEJBTimerService.java:98)
    at com.sun.ejb.containers.EJBTimerService.initEJBTimerService(EJBTimerService.java:230)
    at com.sun.ejb.containers.EJBTimerService.getEJBTimerService(EJBTimerService.java:205)
    at com.sun.ejb.containers.EJBTimerService.getEJBTimerService(EJBTimerService.java:187)
    at com.sun.ejb.containers.BaseContainer.<init>(BaseContainer.java:825)
    at com.sun.ejb.containers.StatelessSessionContainer.<init>(StatelessSessionContainer.java:143)
    at com.sun.ejb.containers.StatelessSessionContainer.<init>(StatelessSessionContainer.java:137)
    at com.sun.ejb.containers.StatelessContainerFactory.createContainer(StatelessContainerFactory.java:61)
    at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:224)
    at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:290)
    at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:100)
    at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:206)
    at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:314)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:496)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:487)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:360)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:360)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
    at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:134)
    .....
Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.2.qualifier): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [__EJB__Timer__App] failed.
Internal Exception: Exception [EclipseLink-7250] (Eclipse Persistence Services - 2.6.2.qualifier): org.eclipse.persistence.exceptions.ValidationException
Exception Description: [class <appClass>] uses a non-entity [class <appClass>] as target entity in the relationship attribute [field <field>].
    at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:231)
    ... 66 more
Caused by: Exception [EclipseLink-7250] (Eclipse Persistence Services - 2.6.2.qualifier): org.eclipse.persistence.exceptions.ValidationException
Exception Description: [class <appClass>] uses a non-entity [class <appClass>] as target entity in the relationship attribute [field <field>].
    at org.eclipse.persistence.exceptions.ValidationException.nonEntityTargetInRelationship(ValidationException.java:1381)
    at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor.getReferenceDescriptor(RelationshipAccessor.java:553)
    at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor.getOwningMapping(RelationshipAccessor.java:469)
    at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.OneToManyAccessor.processOneToManyMapping(OneToManyAccessor.java:210)
    at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.OneToManyAccessor.process(OneToManyAccessor.java:143)
    at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processNonOwningRelationshipAccessors(MetadataProject.java:1628)
    at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage3(MetadataProject.java:1917)
    at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:577)
    at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:604)
    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1948)
    ... 64 more

The core issue is, that we are deploying timer service here and its persistence context (the entity backing table EJB__TIMER__TBL), so in no way it should process any of the application classes at this point. Application's persistence context have been successfully loaded earlier, before EJB initialization started.

Tried to debug this, but with checked out eclipselink tag 2.6.2 I land at empty line on MetadataProject.1877 so I cannot proceed further without access to sources of 2.6.2-p1.

@pdudits
Copy link
Contributor Author

pdudits commented Jan 27, 2016

Issue is not present in 4.1.1.154, is present with 4.1.1.161-SNAPSHOT with eclipselink downgraded to 2.6.1-p1.

@smillidge
Copy link
Contributor

We'll package the source and get it into the Patched Projects Repo.

@smillidge
Copy link
Contributor

Could you describe in more detail the applications you are deploying and the order.

@pdudits
Copy link
Contributor Author

pdudits commented Jan 27, 2016

I'm deploying an EJB jar with persistence context and timer service. Based on my last comment this doesn't seem to be related to eclipselink upgrade, so I went through changes in 161.

Reverting 82819f4, which seemed as a probable cause doesn't solve this. Instead it is likely caused by switching to using standard orm.xml file in ejb-timer-app, which was done in e14ece3. Eclipselink will then pickup not only timer's orm.xml, but also application's one. I'll know for sure in about 20 minutes, when I build embedded jar again.

@smillidge
Copy link
Contributor

@pdudits
Copy link
Contributor Author

pdudits commented Jan 27, 2016

Thank you, hopefully I won't be needing them. I was right in my last comment, it was standard name of orm.xml. PR follows.

Concerning test case, do you have some standard way of providing them, like arquillian? I'm not sure I can extract the test from my project now, especially, since it's about same age as ARQ, and therefore uses embedded API directly.

pdudits added a commit to pdudits/Payara that referenced this issue Jan 27, 2016
…orm.xml

When application contains META-INF/orm.xml, then this file is also processed
when EJB Timer Service is deployed. To prevent this ejb-timer-service-app
was using non-standard name. This reverts parts of e14ece3, that switched back
to standard
smillidge added a commit that referenced this issue Jan 27, 2016
Fix for Payara  #618 - Deployment of EJB_Timer_App fails when app has orm.xml
@smillidge
Copy link
Contributor

Fixed by #621

Pandrex247 added a commit to Pandrex247/Payara that referenced this issue Jun 12, 2019
PAYARA-3665 PAYARA-3676 4.191.Maintenance

Approved-by: Jonathan Coustick <jonathan.coustick@payara.fish>
Pandrex247 added a commit to Pandrex247/Payara that referenced this issue Jun 12, 2019
…a#618)"

This reverts pull request payara#618.

> * Merge pull request payara#3870 from Pandrex247/PAYARA-3676-Asadmin-Prompt-Issues
> 
>     PAYARA-3676 PAYARA-3665 Fix More Asadmin Prompt Issues
> 
> 
> * PAYARA-3665 Merge conflicts
> 
> ‌
> 
> Notable changes are in the second commit: String vs. char
Pandrex247 added a commit to Pandrex247/Payara that referenced this issue Jun 12, 2019
Revert "PAYARA-3665 PAYARA-3676 4.191.Maintenance (pull request payara#618)"
Pandrex247 added a commit to Pandrex247/Payara that referenced this issue Jun 12, 2019
arieki pushed a commit to arieki/Payara that referenced this issue Sep 20, 2022
…rise

Revert "FISH-5747 Upgrade Corba to version 4.2.4.payara-p1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants