-
1. Re: Using an EJB3 in seam
pmuir Nov 12, 2007 9:54 AM (in response to german.castro)Ok, but whats the deployed structure of your project?
-
2. Re: Using an EJB3 in seam
german.castro Nov 12, 2007 10:53 AM (in response to german.castro)The way of use an ejb or resources is the same of other kind of projects??
I also was trying to use a datasource from a seam action and this returns null (ds is null):
@Resource (mappedName="jndi") DataSource ds;
The deploy structure is this:
ClientPortal.ear
|-- ClientPortalWeb.war
| |-- META-INF
| | `-- MANIFEST.MF
| |-- WEB-INF
| | |-- classes
| | | |-- ClientPortalWeb-ds.xml
| | | |-- META-INF
| | | | `-- persistence.xml
| | | |-- ..... actions
| | | |-- components.properties
| | | |-- import.sql
| | | |-- messages_en.properties
| | | |-- seam.properties
| | | `-- security.drl
| | |-- components.xml
| | |-- faces-config.xml
| | |-- jboss-web.xml
| | |-- lib
| | | |-- jboss-seam-debug.jar
| | | |-- jboss-seam-ui.jar
| | | |-- jsf-facelets.jar
| | | |-- richfaces-impl.jar
| | | `-- richfaces-ui.jar
| | |-- pages.xml
| | `-- web.xml
| |-- error.xhtml
| |-- home.xhtml
| |-- img
| | |-- cal-next.png
| | |-- cal-prev.png
| | |-- dtpick.gif
| |-- index.html
| |-- layout
| | |-- display.xhtml
| | |-- edit.xhtml
| | |-- loginout.xhtml
| | |-- menu.xhtml
| | `-- template.xhtml
| |-- login.page.xml
| |-- login.xhtml
| |-- stylesheet
| | `-- theme.css
|-- META-INF
| |-- MANIFEST.MF
| `-- application.xml
|-- jboss-seam.jar
|-- lib
| |-- antlr-runtime.jar
| |-- commons-beanutils.jar
| |-- commons-digester.jar
| |-- drools-compiler.jar
| |-- drools-core.jar
| |-- ejb-api.jar
| |-- el-api.jar
| |-- janino.jar
| |-- jboss-el.jar
| |-- jboss-seam-gen.jar
| |-- jboss-seam-ioc.jar
| |-- jboss-seam-mail.jar
| |-- jboss-seam-pdf.jar
| |-- jboss-seam-remoting.jar
| |-- jbpm-jpdl.jar
| |-- jsf-api.jar
| |-- jsf-impl.jar
| |-- mvel14.jar
| `-- richfaces-api.jar
`-- servicesClientPortal.jar
|-- META-INF
| |-- MANIFEST.MF
| `-- ejb-jar.xml
`-- cl
`-- ..... ejbs -
3. Re: Using an EJB3 in seam
arussel Nov 12, 2007 10:57 AM (in response to german.castro)if you're using jboss, you can have a look in jmx-console or web console to see what is in the JNDI.
Can you see what you're looking for ?
alex -
4. Re: Using an EJB3 in seam
german.castro Nov 12, 2007 11:01 AM (in response to german.castro)Yes i can see the jndi.
If i use a wrong name i got an exception, but this only returns a null resource, without exception. -
5. Re: Using an EJB3 in seam
german.castro Nov 12, 2007 11:16 AM (in response to german.castro)Mmmm... seem to be that isn't finding any jndi...
could be related with this message?
INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
How i fix it? -
6. Re: Using an EJB3 in seam
pmuir Nov 12, 2007 1:07 PM (in response to german.castro)So where does the Seam project appear in that structure.
-
7. Re: Using an EJB3 in seam
german.castro Nov 12, 2007 1:15 PM (in response to german.castro)The seam project is the ClientProjectWeb.war
-
8. Re: Using an EJB3 in seam
pmuir Nov 12, 2007 1:18 PM (in response to german.castro)That certainly should work.
-
9. Re: Using an EJB3 in seam
german.castro Nov 12, 2007 5:11 PM (in response to german.castro)
Well after many hours :( i found in documentation that a EJB must be called using the annotation @Name("name") and Component.getInstance("name") and not using a jndi lookup ...
newbie mistake...
But what happends if i have an EJB from other application (not seam) that isn't seam aware? I have been many time trying to call ejb seam awareness and don't works. -
10. Re: Using an EJB3 in seam
pmuir Nov 12, 2007 5:13 PM (in response to german.castro)No, thats how you lookup a Seam component. Ask about looking up EJBs in the EJB forum ;)
-
11. Re: Using an EJB3 in seam
german.castro Nov 13, 2007 7:56 AM (in response to german.castro)Mmm... but something is wrong in the seam conf, because if i add a webservice in the archive .jar that contains the EJBs, this works fine. But any call to jndi (@Resource or @EJB) from a 'seam action' in archive .war don't works.
Exist an example that call an EJB from seam? in the examples i only saw calls EJB like seam components. -
12. Re: Using an EJB3 in seam
pmuir Nov 13, 2007 8:12 AM (in response to german.castro)Seam doesn't alter EJB3 lookups in any way.
We don't have an example in the Seam distro which does this.