On Jul 28, 2010, at 4:23 PM, Paul Sandoz wrote:
> Hi Sandor,
>
> IIRC the naming rules for EJB lookup were only standardized for EE 6.
>
> I think you would need to ask on a WL forum about JNDI look of EJBs
> or do a web search, perhaps it is not possible (and i am incorrectly
> assuming it is).
>
The following information was provided by a WL engineer.
You can either lookup an EJB directly in the global JNDI tree or use
an ejb-ref:
1. ejb-ref
In WLS, standard ejb-refs can be mapped to the target EJB in a number
of ways. If the target EJB is packaged in the same application as the
component declaring the ejb-ref, ejb-links or auto-wiring can be used
to resolve the target EJB. If the target EJB is packaged in another
application, you can use the <ejb-reference-description> element (in
weblogic-ejb-jar.xml or weblogic.xml) to map the ejb-ref to the global
JNDI name of the target EJB.
2. lookup in global JNDI tree
Note that our EJB container does not yet support global default EJB
names that were introduced in EJB 3.1 so you must manually configure a
JNDI name for your EJB. This can be done by using the mappedName
attribute of the EJB or specifying a JNDI name for the EJB in a
weblogic-ejb-jar.xml. Also, note that we do not yet support binding
local business interfaces into the global JNDI tree (use local-ejb-
refs instead to obtain references to local EJBs).
A. mappedName
If an EJB is configured with a mappedName, each of its remote
interfaces will be bound into the global JNDI tree with the name
<mappedName>#<fully qualified interface name>. This is the
recommended approach since it doesn't require any WLS specific
annotations or descriptors.
B. explicit JNDI name settings
An EJB can be configured with specific JNDI name settings using
the weblogic-ejb-jar.xml descriptor or the weblogic.javaee.JNDIName
annotation. If using weblogic-ejb-jar.xml, note that you need to use
the <business-interface-jndi-name-map> element to specify JNDI names
for EJB 3.0 style business interfaces. For EJB 2.x style home
interfaces, use the <jndi-name> element. (Note, we're currently
working to simplify our weblogic-ejb-jar.xml schema to simplify the
JNDI settings).
Paul.
> Paul.
>
> On Jul 28, 2010, at 3:57 PM, Ecker, Sandor (ext) wrote:
>
>> Hallo Paul,
>>
>> Thanks! I'm tring to do it.
>>
>> I get something like this:
>>
>> 28.07.2010 15:52:17 com.sun.jersey.api.core.ScanningResourceConfig
>> logClasses
>> INFO: Provider classes found:
>> class com.siemens.imo.ra.cgis.presentation.list.restful.EJBProvider
>> 28.07.2010 15:52:18
>> com.sun.jersey.server.impl.application.WebApplicationImpl in
>> itiate
>> INFO: Initiating Jersey application, version 'Jersey: 1.1.5.1
>> 03/10/2010 02:33 P
>> M'
>> tring to look up: java:comp/env/ManagerService
>> javax.naming.NameNotFoundException: While trying to look up comp/
>> env/Manage
>> rService in /app/webapp/cars/9964479.; remaining name 'comp/env/
>> ManagerSe
>> rvice'
>> at
>> weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(Basic
>> NamingNode.java:1139)
>> at
>> weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNaming
>> Node.java:144)
>> at
>> weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.j
>> ava:254)
>> at
>> weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:393)
>>
>>
>> I have tried it so:
>>
>> String jndiName = "java:comp/env/" + c.getName();
>> System.out.println("tring to look up: " + jndiName);
>>
>> final Object o = ic.lookup(jndiName);
>>
>> And so too:
>>
>> String jndiName = "java:comp/env/" + c.getSimpleName();
>> System.out.println("tring to look up: " + jndiName);
>>
>> final Object o = ic.lookup(jndiName);
>>
>> But the same exception...
>>
>> Maybe Weblogic needs other naming?
>>
>> Thanks,
>> Regards,
>> Sandor
>>
>> -----Original Message-----
>> From: Paul Sandoz [mailto:Paul.Sandoz_at_oracle.com]
>> Sent: Mittwoch, 28. Juli 2010 13:00
>> To: users_at_jersey.dev.java.net
>> Subject: Re: [Jersey] RE: @EJB inj. Glassfish3 OK, WebLogic10.3 NOTOK
>>
>> Hi Sandor,
>>
>> WebLogic 10.3 does not support Java EE 6, which is the simple answer
>> to why injection does not work.
>>
>> A JAX-RS 1.1 implementation requires close integration with the app
>> server to support the requirements of injection.
>>
>> It is possible to add focused injection support by using a Jersey
>> API,
>> see here:
>>
>> http://jersey.576304.n2.nabble.com/EJB-Dependency-Injection-into-a-RESTFul-Web-Service-Jersey-td2409954.html
>>
>> Paul.
>>
>>
>> On Jul 27, 2010, at 3:57 PM, Ecker, Sandor (ext) wrote:
>>
>>> Hi,
>>>
>>> Ok, I have just tried the http://download.java.net/maven/2/com/sun/jersey/samples/jersey-ejb/1.3/jersey-ejb-1.3-project.zip
>>> on GF and WL.
>>>
>>> On GFv3 it works fine, but on WL not (no exceptions but does not
>>> work)...
>>>
>>> I don't know what to do now... Does it mean that WL is not
>>> supported?
>>>
>>> Thanks,
>>> Regards,
>>> Sandor
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>