This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 230139 - Portable JNDI names for EJB deployed at Glassfish does not respect JavaEE spec
Summary: Portable JNDI names for EJB deployed at Glassfish does not respect JavaEE spec
Status: NEW
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 8.0.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: TomasKraus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-22 19:03 UTC by Michel Graciano
Modified: 2014-09-22 23:30 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Graciano 2013-05-22 19:03:40 UTC
I've been testing some JavaEE ideas and I have faced some issue due to Glassfish deployment for Maven Web projects. Basically the issue is that GF plugin have been using the project (POM) name as the deployed artifact name instead of the WAR name (as expected [1]). So, I have some JNDI lookup code which is generated by Nb as:

c.lookup("java:global/tdc-2013_annotation-processors-demo-web_war_1.0-SNAPSHOT/ScriptRepository");

but to run I have to change the lookup to:
c.lookup("java:global/Annotation_Processors_Demo_-_Web/ScriptRepository!tdc2013.hibernate.model.ScriptRepository");

I have to change it because the in-place deployment is not following correctly the specified behaviour.

I have read some parts of NB code and it looks to me that the issue is at o.n.m.glassfish.eecommon.api.Utils.computeModuleID, specifically at moduleID = ProjectUtils.getInformation(FileOwnerQuery.getOwner(fo)).getDisplayName(). AFAIU it should be something like o.n.m.j2ee.deployment.config.ConfigSupportImpl.getDeploymentName(), where the folder name is considered for in-place deployment.

I have tried to define the name of the module at ejb-jar.xml file too, without success too (it has not worked at GF too, so maybe this last part is not a NB issue)

I had no time yet to dig it further but if my assumptions are correct maybe we can fix it soon.

The code that I used are available at https://github.com/mgraciano/tdc-2013/blob/master/annotation-processors/ap-demo-web/src/main/java/tdc2013/web/ScriptProviderImpl.java. I should say that these code are still under development and is just a prove of concept, we still need to clear it up.

Product Version: NetBeans IDE 7.3 (Build 201302132200)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11

[1] http://stackoverflow.com/questions/3431357/how-can-i-config-module-and-application-name-for-jndi-lookups
Comment 1 TomasKraus 2013-05-22 22:10:33 UTC
There is no chance to get this fixed in 7.3.1 which is in high resistance mode now. But I'll fix it in trunk for 7.4.
Comment 2 Michel Graciano 2013-05-22 22:26:14 UTC
Thanks a lot. Fixing it for 7.4 is good enough.
Comment 3 sf.marcius 2014-04-15 14:51:24 UTC
I have the same issue.

Created a maven enterprise application, with ejb, war and ear modules.

When I run it from netbeans (ear module right click >> run) it deploys the application to MyApp-ear/target/gfdeploy/_MyApp-ear_1.0-SNAPSHOT
Tried to add a <application-name>MyApp-ear<application-name> to the application.xml on the ear module, to get rid of the version from the app-name, but Netbeans won't honor it.

I just wanna get rid of the version portion on the application name, cause it messes up the portable jndi names, making a refactory necessary every version change.

Probably, deploying the ear with the adjusted application.xml manually on the autodeploy would work, but I would like to run it from inside netbeans.

This happens on the latest Netbeans 8.0 Final.
Comment 4 thufir 2014-09-22 23:30:11 UTC
isn't the JNDI name in the glassfish logs?