-
1. Re: JNDI lookup problem in weblogic 10.3 with EJB3
gonorrhea Apr 7, 2009 6:06 PM (in response to hsiung)components.properties:
jndiPattern \#{ejbName}/local
This is the default setting. Why aren't you using this?
-
2. Re: JNDI lookup problem in weblogic 10.3 with EJB3
hsiung Apr 7, 2009 10:39 PM (in response to hsiung)thanks, I tried components.properties:
jndiPattern=\#{ejbName}/local embeddedEjb=false
But I still get an exception.
javax.naming.NameNotFoundException: While trying to lookup 'ServiceRegistrationBean.local' didn't find subcontext 'ServiceRegistrationBean'. Resolved ''; remaining name 'ServiceRegistrationBean/local'
The original components.properties (generated during the creation of the Seam project) was:
jndiPattern=wsRepository-ear/\#{ejbName}/local
But you're right, in the samples, the jndiPattern is like you mentioned.
Anyway, both options are not working in Weblogic 10.3.
I also tried to delete the components.properties and the entry in components.xml
<!-- core:init debug="true" jndi-pattern="@jndiPattern@"/-->
Hoping that some defaults are working,
but I got an exception:java.lang.IllegalArgumentException: You must specify org.jboss.seam.core.init.jndiPattern or use @JndiName: serviceRegistration
So I have to specify a jndi-pattern, but which one???
Any good idea?
-
3. Re: JNDI lookup problem in weblogic 10.3 with EJB3
cedneve.cedric.neve.oniryx.be Jul 15, 2009 12:36 PM (in response to hsiung)Hello,
Late answer but I just stumbled upon this problem myself so I can maybe help you out for further reference:
You need to add a reference to your EJBs in your web.xml, as explained here: http://seamframework.org/Community/JNDIForSessionBeansInWeblogic103However, once this is done, it helps resolving those EJBs from the pages but it does not help when an internal reference is made between EJBs (for example @In private MyOtherEJB).
I am still trying to find a solution for those...
-
4. Re: JNDI lookup problem in weblogic 10.3 with EJB3
zhodges Oct 29, 2009 11:04 PM (in response to hsiung)Even later answer, but hopefully this will help someone...
To use Seam injection for EJBs in Weblogic 10.3 use the @EJB annotation at the class level like so (use @EJBs for multiple):
@EJB(name="ejb/MyServiceBean/local", beanName="MyServiceBean", beanInterface=MyService.class) public class MyOtherServiceBean.... { @In(create=true) private MyService myService; }
Where ejb/MyServiceBean/local is the JNDI path you're binding to.
For example the above will be available at:
java:comp/env/ejb/MyServiceBean/localNote: this can really be anything, but this is a decent convention.
This creates a name in the current EJB's namespace to reference the EJB with the bean name of MyServiceBean. The beanInterface says which interface to use, local or remote...
The same effect can be achieved using the ejb-jar.xml and weblogic-ejb-jar.xml, but this is simpler.
Also, set in your component.xml:
<core:init jndi-pattern="java:comp/env/ejb/#{ejbName}/local"/>
Hope that helps.