[jboss-user] [JBoss Seam] - Re: Seam EJB Injection Classloading issue
anonymous wrote : Lets try to be very straightforward... Is Seam supposed to be able to inject a reference for a SessionBean deployed anywhere in a JNDI compliant Server using @In annotation? No. Because Seam would have no metadata about that session bean. (Not in its classpath.) You can use standard EE injection (@EJB), however. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095323#4095323 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095323 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Seam EJB Injection Classloading issue
Post your code and deployed ear layout. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4092364#4092364 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4092364 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Seam EJB Injection Classloading issue
Hi Pete! Sure I can send! The only thing is that I can only post it tomorrow, code is at my job. I can even send a link for a sample project with code (war) and source, do you prefer? Tomorrow, 11 o clock Brazil time I'll send it. best regards, View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4092375#4092375 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4092375 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Seam EJB Injection Classloading issue
Here goes a sample: for foobean.jar foo.bar.server.ejb.IFoo | package foo.bar.server.ejb; | | public interface IFoo { | public void bar(); | } | foo.bar.server.ejb.IFooRemote | package foo.bar.server.ejb; | | import javax.ejb.Remote; | | @Remote | public interface IFooRemote extends IFoo { | } | foo.bar.server.ejb.impl.FooBean | package foo.bar.server.ejb.impl; | | import javax.ejb.Stateless; | import foo.bar.server.ejb.IFooRemote; | | @Stateless | public class FooBean implements IFooRemote { | public void bar() { | System.out.println("FOOBAR"); | } | } | and I have an ant target that packs up the contents of the foo.bar.server.ejb package as a jar to be added on WEB-INF/lib folder of the foo.war. - for web application components.xml | | http://jboss.com/products/seam/components"; | xmlns:core="http://jboss.com/products/seam/core"; | xmlns:persistence="http://jboss.com/products/seam/persistence"; | xmlns:web="http://jboss.com/products/seam/web"; | xmlns:security="http://jboss.com/products/seam/security"; | xmlns:transaction="http://jboss.com/products/seam/transaction"; | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; | xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd | http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd | http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd | http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd | http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd";> | | | | | | | web.xml | | http://java.sun.com/xml/ns/javaee"; version="2.5"> | | | | | org.ajax4jsf.VIEW_HANDLERS | com.sun.facelets.FaceletViewHandler | | | | | | | org.jboss.seam.servlet.SeamListener | | | | | Seam Filter | org.jboss.seam.servlet.SeamFilter | | | | Seam Filter | /* | | | | Seam Resource Servlet | | org.jboss.seam.servlet.ResourceServlet | | | | | Seam Resource Servlet | /seam/resource/* | | | | Seam Filter | org.jboss.seam.web.SeamFilter | | | | Seam Filter | /* | | | | | | Faces Servlet | javax.faces.webapp.FacesServlet | 1 | | | | Faces Servlet | *.seam | | | | | | | javax.faces.DEFAULT_SUFFIX | .xhtml | | | | facelets.DEVELOPMENT | true | | | | 10 | | | | foo.bar.web.business.FooAction | package foo.bar.web.business; | | import java.io.Serializable; | | import org.jboss.seam.ScopeType; | import org.jboss.seam.annotations.In; | import org.jboss.seam.annotations.Name; | import org.jboss.seam.annotations.Scope; | | import foo.bar.server.ejb.IFooRemote; | | @Name("foo") | @Scope(ScopeType.APPLICATION) | public class FooAction implements Serializable { | | @In | IFooRemote fooBean; | | public void bar() { | fooBean.bar(); | } | | } | foo.xhtml | http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> | http://www.w3.org/1999/xhtml"; | xmlns:ui="http://java.sun.com/jsf/facelets"; | xmlns:h="http://java.sun.com/jsf/html"; | xmlns:f="http://java.sun.com/jsf/core"; | xmlns:s="http://jboss.com/products/seam/taglib"; | xmlns:a="https://ajax4jsf.dev.java.net/ajax"; | xmlns:rich="http://richfaces.org/rich";> | | FooForm | | | | | | | | | | | I am not deploying as an EAR since the project is still under development, so I have an ant target that recreates the war and calls the JBoss JMX Bean for deploying the WAR/JAR in my workspace. Anyways, when I deploy it as an EAR I'll setup links for the SessionBeans using jboss.xml file in order to make them have the same JNDI name. If you prefer that I upload to somewhere the Eclipse projects just post a message and I can upload them (with build scripts and etc). best regards, View the original post : http://www.jboss.com/index.html?module=bb&
[jboss-user] [JBoss Seam] - Re: Seam EJB Injection Classloading issue
You can't deploy ejb's into wars. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094987#4094987 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094987 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Seam EJB Injection Classloading issue
I thought it was clear enough on the post below and that was the reason I suggested uploading somewhere the project... I am not deploying EJBs inside an WAR. I am packaging the interfaces for the classes (aka EJB-client package) so I can refer to the SessionBeans inside my Web Application. I am packaging only the interfaces not the implementation classes. Lets try to be very straightforward... Is Seam supposed to be able to inject a reference for a SessionBean deployed anywhere in a JNDI compliant Server using @In annotation? Cause if so either I am doing something wrong or there seems to be something not working as expected. I am already using an workaround to avoid this... plain simple ServiceLocator pattern... View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095036#4095036 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095036 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Seam EJB Injection Classloading issue
Sorry, no way I have time to wade through your project. And no, it was not clear from your post what you were trying to do. anonymous wrote : Lets try to be very straightforward... Is Seam supposed to be able to inject a reference for a SessionBean deployed anywhere in a JNDI compliant Server using @In annotation? Yes (much easier to parse those few short sentences ;) ). Try View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095038#4095038 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095038 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Seam EJB Injection Classloading issue
I had already tried this at my job ... sorry for the delay I had to recreate the project here at home... :D with the interface we get this: | Caused by: java.lang.IllegalArgumentException: component class is an interface: fooBean | at org.jboss.seam.Component.checkNonabstract(Component.java:285) | at org.jboss.seam.Component.(Component.java:232) | at org.jboss.seam.Component.(Component.java:217) | at org.jboss.seam.init.Initialization.addComponent(Initialization.java:949) | ... 92 more | By the way, I already tried with the simple java interface and got the same result (although I thought it wont make much sense since we know we are deploying an EJB and we will have an EJB interface anyway) best regards, View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095040#4095040 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095040 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Seam EJB Injection Classloading issue
No, but Seam needs the class to be available to its classloader. I think I got confused and thought this should work - but it only works for local ejbs not remote (where Seam can get at the actual implementation class). So I suggest you use the @Unwrap/manager pattern to make your remote ejbs into Seam components (you could easily make a generic component and instantiate lots through components.xml). View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095045#4095045 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095045 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Seam EJB Injection Classloading issue
Hmm... ok... now we have two confused :D I am ok about Seam not supporting remote EJBs but still I feel confused about it supporting local since theoretically the both should have a common behavior in relation to the client. Errr... Let me try to be clearer... I dont follow how Seam accesses the EJB "directly" when it is a local ejb since in theory all EJB access is meant to be done through the Proxy class that is created by the container. Or am I wrong? Anyway, tks a lot Pete! I'll try the manager tip! View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095048#4095048 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095048 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Seam EJB Injection Classloading issue
The problem isn't accessing the EJB instance (which Seam accesses it through JNDI), but rather the implementing class (which I'm infering isn't on your war's classpath, but on the classpath of the ear which contains it - whats on your wars classpath is the remote interface). I think this is a limitation of the way the component model is implemented that just was never removed (as opposed to a real restriction of the design of Seam's component model). Feel free to file a feature request for this - I want to see what Gavin says. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095052#4095052 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095052 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user