Bug 1004191

Summary: Custom JNDI name to lookup EJB in EAP6
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Hisanobu Okuda <hokuda>
Component: EJBAssignee: David M. Lloyd <david.lloyd>
Status: CLOSED NOTABUG QA Contact: Jan Martiska <jmartisk>
Severity: urgent Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.1.0CC: david.lloyd, dpospisi, hokuda, sappleto, wfink
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://c.na7.visual.force.com/apex/Case_View?id=500A000000CS83l
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-26 04:16:12 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
sample reproducer none

Description Hisanobu Okuda 2013-09-04 07:46:37 UTC
Description of problem:
I want to look up EJB using a custom JNDI name like "com/foo/bar/ejb/session/Hello" instead of a default name like "ejb:myapp/myejbmodule//HelloBean!com.foo.bar.ejb.session.Hello?stateful".

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Jaikiran Pai 2013-09-06 10:51:55 UTC
I can't find an example, but this is already possible. All you have to do is setup proper JNDI name linking in the naming subsystem. Take a look at the naming subsystem xsd for more details.

Comment 2 Hisanobu Okuda 2013-09-09 06:11:17 UTC
Hello Jaikiran,
Thanks for the suggestion, but it does not work for me. Please find the attached samplebz.tar.gz and deploy it as follow:-

1. extract it
2. copy standalone-ha.xml to $JBOSS_HOME/standalone/configuration
3. deploy samplebz.jar
4. run eap610
   $ $JBOSS_HOME/bin/standalone.sh -c standalone-ha.xml -Djboss.node.name=node1
5. add jboss-client.jar and samplebz.jar to CLASSPATH and run the client
   $ java sample.Client610

Then, you would get an error like:-

Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial

Our customer wants to invoke remote clustered ejb. Need to use jboss ejb client API and look up for "ejb:..." to invoke remote clustered ejb. Is my understanding correct?

Comment 3 Hisanobu Okuda 2013-09-09 06:12:12 UTC
Created attachment 795503 [details]
sample reproducer

Comment 4 Jaikiran Pai 2013-09-09 12:48:18 UTC
Hi Hisanobu,

For discussing about that error, please create a thread either in the forums or the eap6 support mailing list. That way it gets the right audience and more people can take a look.

Comment 5 Hisanobu Okuda 2013-09-10 04:13:26 UTC
Hi Jaikiran,

Created a thread:-
https://community.jboss.org/discussion/create.jspa?sr=amenu&draftID=288782

Comment 6 Hisanobu Okuda 2013-09-10 09:13:17 UTC
[errata]
The right URL is:-

https://community.jboss.org/message/836828#836828

Comment 7 Hisanobu Okuda 2013-09-25 02:29:12 UTC
I'd like to request inclusion to EAP 6.3.0. How do I do that?

Comment 9 Dimitris Andreadis 2013-10-24 18:27:45 UTC
Assigning jpai EJB issues to david.lloyd. Please re-assign to Cheng or others as needed.

Comment 17 Dominik Pospisil 2014-09-16 12:14:50 UTC
Closing based on the testing with WF and 6.x master. In both runtimes clustered ejb lookup works using custom bindings. In the above provided example, the lookup should be defined as:

<lookup name="java:jboss/exported/hoge/Hello" lookup="java:jboss/exported/samplebz/SecureHelloBean!sample.Hello"/>