Issue Details (XML | Word | Printable)

Key: GLASSFISH-19021
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: naman_mehta
Reporter: dapeng_hu
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
glassfish

Fail to validate component-level resource definitions with same JNDI in different component scope

Created: 20/Aug/12 08:56 AM   Updated: 24/Aug/12 08:37 AM   Resolved: 24/Aug/12 08:37 AM
Component/s: deployment
Affects Version/s: future release
Fix Version/s: 4.0

Time Tracking:
Not Specified

File Attachments: 1. Java Source File HelloEJB.java (7 kB) 20/Aug/12 08:56 AM - dapeng_hu
2. Java Source File HelloStatefulEJB.java (7 kB) 20/Aug/12 08:56 AM - dapeng_hu
3. Text File server.log (81 kB) 20/Aug/12 08:56 AM - dapeng_hu


Tags: validation deployment resource-definition
Participants: dapeng_hu and naman_mehta


 Description  « Hide

I found a problem when running the devtest connector/v3/datasource-definition/. I add one data source (as below) in each of the EJB class HelloEJB.java and HelloStatefulEJB.java respectively. Although these two component-level data sources share the same JNDI name, they do not conflict because they are in different EJB scope.

@DataSourceDefinition(name = "java:comp/env/Test_DataSource",
minPoolSize = 0,
initialPoolSize = 0,
className = "org.apache.derby.jdbc.ClientXADataSource",
portNumber = 1527,
serverName = "localhost",
user = "APP",
password = "APP",
databaseName = "hello-stateful-ejb-comp",
properties = {"connectionAttributes=;create=true"}
)

But the application deployment fails when validate resource descriptors, and throws out the following exception. Could you take a look?

[#|2012-08-19T20:39:21.708-0700|SEVERE|44.0|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=12;_ThreadName=Thread-2;|Application validation fails for given application [datasource-definitionApp] for jndi-name [java:comp/env/Test_DataSource]
java.lang.IllegalStateException: Application validation fails for given application [datasource-definitionApp] for jndi-name [java:comp/env/Test_DataSource]
at com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:106)
at com.sun.enterprise.deployment.BundleDescriptor.visit(BundleDescriptor.java:621)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:755)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:244)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:235)
at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:188)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:222)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:96)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:871)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:811)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:373)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:228)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:466)

For your convenience, the HelloEJB.java, HelloStatefulEJB.java and the server's log file are attached.



naman_mehta added a comment - 24/Aug/12 08:37 AM

Fixed the issue.

Sending dol/src/main/java/com/sun/enterprise/deployment/util/ApplicationValidator.java
Transmitting file data .
Committed revision 55618.