[JNDI/Naming/Network] - Re: java.lang.ClassCastException: $Proxy78 cannot be cast to
by areyyyyy
Hi,
Thanks for ur reply.
Here i am providing remote interface and stateful session beans:
@Stateful(name = "uhomeSession")
@Remote( { LoginSession.class })
public class LoginSessionBean implements LoginSession {
@PersistenceContext(unitName = "Model")
private EntityManager em;
private PropertyLogger pl;
private Ruser sessionUser;
private FinderMethods fm;
public LoginSessionBean() throws UnknownException, WarningException {
pl = PropertyLogger.getInstance();
fm = new FinderMethods();
pl.write("Leaving LoginSessionBean constructor", 1, "LoginSessionBean",
"LoginSessionBean");
}
... some more methods
}
@Remote
public interface LoginSession {
Object mergeEntity(Object entity);
void checkSessionUser(String methodName) throws WarningException;
void logout();
... some more methods
}
and i am working with server JBOSS4.2.3GA.
Still i am getting same exception mentioned earlier.
and JNDI VIEW is
+- uhome (class: org.jnp.interfaces.NamingContext)
| +- DefaultSessionBean (class: org.jnp.interfaces.NamingContext)
| | +- remote (proxy: $Proxy96 implements interface com.vs.uhome.model.session.DefaultSession,interface org.jboss.ejb3.JBossProxy)
| +- uhomeSession (class: org.jnp.interfaces.NamingContext)
| | +- remote (class: java.lang.Object)
| | +- remoteStatefulProxyFactory (proxy: $Proxy65 implements interface org.jboss.ejb3.ProxyFactory)
I have deployed both stateless (DefaultSessionBean) and stateful (LoginSessionBean).I could call stateless from my servlet but i could not call statefull session beans.
and to mention i have deployed web files in war and all ejb files as jar inside uhome.ear file with application.xml file given below
<!DOCTYPE application PUBLIC "-//Sun Microsystems,
Inc.//DTD J2EE Application 1.2//EN"
"http://java.sun.com/j2ee/dtds/application_1_2.dtd">
<display-name>Uhome Application</display-name>
<web-uri>ViewController.war</web-uri>
<context-root>/ViewController</context-root>
Model.jar
Please tell me why stateful session beans remote node did not implement the proxy of loginsession? and what jndi string should i use to lookup for the login session?
Thanks
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225601#4225601
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225601
17 years
[EJB 3.0] - Re: Web Beans + JPA
by skajotde
"epbernard" wrote : If we are OK to go the non standard route, I can look at adding a method on HibernateEntityManagerFactory.
| Set<Class<?>> getEntities();
| returning the list of entities.
|
| Or even better you can do
|
| Collection metadatas = (Map) ( (HibernateEntityManagerFactory) emf ).getSessionFactory().getAllClassMetadata().values();
|
| for(ClassMetadata metadata : metadatas) {
| Class<?> entityType = metadata.getMappedClass(EntityMode.POJO);
| if (entityType != null)
| doStuffCauseItsAnEntity( entityType );
| }
I think it is good way, so
public Collection<Class<?>> discoverEntities();
is executed in context of deployed PU. EMF should take responsibility to discover which entities belong to it and expose API to get that information. So code for hibernate is ready, and for EMF which now doesn't expose similair API code discoverEntities should throw exception ..?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225600#4225600
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225600
17 years