[#GLASSFISH-15762] Error - "Could not resolve a

advertisement

[GLASSFISH-15762]

Error - "Could not resolve a persistence unit corresponding to the persistence-context-ref-name" even if there's only one persistence-unit

Created: 31/Jan/11 Updated: 04/Feb/11 Resolved: 04/Feb/11

Status: Resolved

Project: glassfish

Component/s: entity-persistence

Affects

Version/s:

Fix Version/s: None

Type: Bug

Reporter:

Labels:

Resolution: v3.0.1

Incomplete

None

, 3.1_b40

infinitypluszero

Remaining

Estimate:

Not Specified

Priority:

Assignee:

Votes:

Major

Mitesh Meswani

0

Time Spent: Not Specified

Original

Estimate:

Attachments:

Not Specified

Tags:

Description cdisampleapp.zip persistence.xml server.log

3_1-exclude

When deploying a perfectly compatible JEE6 War file with glassfish 3.0.1 or 3.1.b40 Beta, I get the following error:

Could not resolve a persistence unit corresponding to the persistence-context-ref-name

[xxx.controller.MemberRegistration/em/em] in the scope of the module called [app]. Please verify your application.. Please see server.log for more details.

This is a minor variation on the weld demo maven archetype project with Seam 3 beta jars

(seam-solder) added. There is only one persistence unit so I don't see why there's any confusion here. Adding @PersistenceContext(name="foo") at the injection point MemberRegistration doesn't solve the problem either.

Note that the way deploys just fine on another JEE 6 compliant Server – JBoss AS 6.0.Final. I believe this is a bug since as per JEE 6 spec, server container should be swapped without issues.

Comments

Comment by Hong Zhang

[ 31/Jan/11 ] assign to mitesh for initial evaluation

Comment by Mitesh Meswani

[ 31/Jan/11 ]

Can you please describe the structure of your app. It is hard to reproduce the issue with the description provided. It would be great if you can attach the archive that reproduces the issue.

Comment by infinitypluszero

[ 31/Jan/11 ]

It's a standard WAR file structure. The project is a slight modification from http://seamframework.org/Documentation/WeldQuickstartForMavenUsers . As mentioned above, it has Seam 3 jars and here's the listing in the WEB-INF\lib: backport-util-concurrent-3.1.jar drools-api-5.1.1.jar drools-core-5.1.1.jar ehcache-1.5.0.jar hibernate-envers-3.5.6-Final.jar inflector-0.7.0.jar jboss-logging-3.0.0.Beta4.jar joda-time-1.6.jar mvel2-2.0.16-SNAPSHOT.jar picketlink-idm-api-1.1.7.GA.jar picketlink-idm-common-1.1.7.GA.jar picketlink-idm-core-1.1.7.GA.jar picketlink-idm-spi-1.1.7.GA.jar primefaces-2.2.RC2.jar seam-faces-3.0.0.Beta2.jar seam-persistence-3.0.0.Beta2.jar seam-security-api-3.0.0.Alpha2.jar seam-security-impl-3.0.0.Alpha2.jar seam-solder-api-3.0.0.Beta1.jar seam-solder-impl-3.0.0.Beta1.jar

I've also attached the persistence.xml. Also, glassfish team should STOP asking developers to attach a WAR file for every issue. Most developers work for a commercial/financial/healthcare companies and cannot upload source code to a public repository. If you can't reproduce the issue, I'd like to hear some questions or log files and I'll be happy to help. If the information is not sufficient in the log file, perhaps it's time to add a jira to enhance the glassfish log file.

Comment by Mitesh Meswani

[ 04/Feb/11 ]

I tried the example app you pointed to. Had some unrelated issues to get it going [1]. I am able to deploy it. I will attach the app next.

I am closing the issue as "works for me". Please reopen with a reproduction which contains the

"slight modification".

[1] Issues

-could not compile it as generated needed to change pom

-could not deploy it due to what appears to be http://java.net/jira/browse/GLASSFISH-15721 .

-Removed dependencies on seam-solder to work around it

Comment by Mitesh Meswani

[ 04/Feb/11 ] cdisample app variant that deploys without issues

Generated at Fri Feb 05 12:25:32 UTC 2016 using JIRA 6.2.3#6260sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.

Download