-
1. Re: Problem in EJB lookp with Jboss Embedded
matt.nirgue Jan 12, 2009 12:26 PM (in response to pedrosena)Try to change your logging configuration so you can see what happens when JBoss Embedded starts but also when your Seam components are initialized... you should find something like:
INFO [Component] Component: yourComponent, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: com.yourproject.util, JNDI: yourJNDI
This should help you figuring out why you can't get your component
-
2. Re: Problem in EJB lookp with Jboss Embedded
pedrosena Jan 12, 2009 7:17 PM (in response to pedrosena)Hi Matt,
Thanks for your reply.
I did what you told me, now I'm more surprised:
INFO [org.jboss.ejb3.MCKernelAbstraction] installing bean: jboss.j2ee:ear=travelnetwork-business.ear,jar=ejb-0.0.1.jar,name=hosting,service=EJB3 with dependencies: INFO [org.jboss.ejb3.MCKernelAbstraction] and supplies: INFO [org.jboss.ejb3.MCKernelAbstraction] Class:br.com.netsar.tnw.core.model.service.INetSarHostingProvider INFO [org.jboss.ejb3.EJBContainer] STARTED EJB: br.com.netsar.tnw.business.model.facade.HostingFacade ejbName: hosting
My EJB is correctly installed, but when I try to lookup it, the lookup fails.
Actually my component is not a Seam-managed EJB, just a default EJB.
Any tips?
Thnaks again,
Pedro Sena
-
3. Re: Problem in EJB lookp with Jboss Embedded
dthibau1 Jan 12, 2009 7:24 PM (in response to pedrosena)Don't you have a file named component.properties in your classpath which overrides the snippet of your components.xml ?
With JBoss Embeded, I use a component .properties like that :
# #Thu Dec 27 14:22:39 CET 2007 jndiPattern=\#{ejbName}/local embeddedEjb=true
-
4. Re: Problem in EJB lookp with Jboss Embedded
coenos Jan 13, 2009 3:01 PM (in response to pedrosena)Hi,
I'm facing the same problem. I see the EJB is created, but at runtime I get the
not bound
exception.Also this statement:
INFO [Component] Component: yourComponent, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: com.yourproject.util, JNDI: yourJNDI
Is a JBOSS log statement. In embedded JBoss I don't see the JNDI name statement in the console.
I have tried to set the @JndiName explicitly but this doesn't work either.
Note that I can access the Entity Beans (plus Home and List classes) correctly, so these Seam components are started up correctly.
I think the problem lies in the fact that the JNDI name from components.properties is not set at startup time in the embedded jboss server.
Regards,
Coen -
5. Re: Problem in EJB lookp with Jboss Embedded
coenos Jan 13, 2009 3:47 PM (in response to pedrosena)Ok I solved the issue by indeed changing the components.xml from
<core:init debug="true" jndi-pattern="application-name/#{ejbName}/local" />
to
<core:init debug="true" jndi-pattern="#{ejbName}/local" />
But the upper tag works only on JBoss. And the lower tag only on Tomcat Embedded JBoss.
Cheers,
Coen -
6. Re: Problem in EJB lookp with Jboss Embedded
cpopetz Jan 13, 2009 4:27 PM (in response to pedrosena)Yup, but as mentioned above, you can create a components.properties for each type of deployment (tomcat vs jboss), with a line in each that says:
jndiPattern=<the correct jndi pattern here>
and then use:
<core:init debug="true" jndi-pattern="@jndiPattern@"/>
in your components.xml, and have your build script copy the correct components.properties into WEB-INF/classes for the deployment in question.
-
7. Re: Problem in EJB lookp with Jboss Embedded
coenos Jan 13, 2009 4:42 PM (in response to pedrosena)actually,
the components.properties doesn't get picked up by Seam at startup...
This is why I have to change the components.xml :(
-
8. Re: Problem in EJB lookp with Jboss Embedded
cpopetz Jan 13, 2009 5:27 PM (in response to pedrosena)Well, that's either a bug or misconfiguration. Seam will look for the first components.properties in the servletContext using ServletContext.getResourceAsStream, and then it will search classpaths using classloader.getResourceAsStream(). My guess is that if you are placing your components.properties in your classpath and it isn't being used, then there's probably a blank components.properties higher up in the classpath.