Note that there are some explanatory texts on larger screens.

plurals
  1. PO(AS7) Error calling remote EJB method with proxified CDI bean in parameter
    primarykey
    data
    text
    <p>Can I call a remote EJB method with CDI bean in parameter method?</p> <p>Like this:</p> <p>I have a <strong>LoggedUserProducer.java</strong> thats produces a User from the database.</p> <pre><code>public class LoggedUserProducer { @Produces @SessionScoped @LoggedUser public User produceLoggedUser() throws Exception { ... //load user from database with a request token return user; } } </code></pre> <p>And I have a JSF Bean thats make the EJB call:</p> <p><strong>CarController.java</strong></p> <pre><code>@Named @ViewScoped public class CarController implements Serializable { @Inject //I have a producer to create the EJB proxy private RepairRemote repairRemote; //My remote EJB @Inject @LoggedUser private User loggedUser; //my User produced by LoggedUserProducer private Car car; public void repairCar() throws Exception { ... //some actions... Repair repair = new Repair(this.car) repair.setPerformedBy(loggedUser); //setting my proxified cdi bean into a POJO repairRemote.repair(repair); //here throws ClassNotFoundException; } </code></pre> <p>and the Exception:</p> <pre><code>java.lang.RuntimeException: ClassNotFoundException marshaling EJB parameters at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:229) at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:216) ... at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105) at org.jboss.weld.proxies.RepairRemote$-248248579$Proxy$_$$_WeldClientProxy.repair(RepairRemote$-248248579$Proxy$_$$_WeldClientProxy.java) at com.mycompany.services.controller.CarController.repairCar(CarController.java:118) at com.mycompany.services.controller.CarController$Proxy$_$$_WeldSubclass.repairCar(CarController$Proxy$_$$_WeldSubclass.java) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ... at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.ClassNotFoundException: com.mycompany.portalcarweb.client.model.User$Proxy$_$$_WeldClientProxy from [Module "deployment.portalcarweb.war:main" from Service Module Loader] </code></pre> <p><br/></p> <p>I don't know why my remote EJB can't find the class <strong>com.mycompany.portalcarweb.client.model.User$Proxy$_$$_WeldClientProxy</strong></p> <p>My <strong>User.java</strong> is deployed in a JBoss 7 module. My EJB client and server have the <code>jboss-deployment-structure.xml</code> in <code>WEB-INF</code> folder and declaring the correct module to access this class.</p> <p>Thanks (sorry my english).</p> <p><br/></p> <p><em>update</em></p> <p>My two webapps are packaged in WARs file.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload