[JBoss Seam] - Re: two basic questions for EntityHome
by wschwendt
"gavin.king(a)jboss.com" wrote : Please test the fix.
Sorry for not replying earlier. The CVS checkout of the entire source tree was very slow yesterday. Atfer it was finally finished, I built a Seam version based on this source tree yesterday evening.
Looking at your modification of ManagedEntityIdentityInterceptor, the added method clearWrapper() looks ok to me. But unfortunately, I cannot really test it, because i ran into other problems with the Seam version built with the CVS source.
In short, when I define an EntityHome component using XML,
a context var. with the name of this component is stored in conversation context and bound to an object of a class like org.jboss.seam.framework.EntityHome_$$_javassist_14
This class has all the expected properties such as
createdMessage Successfully created
deletedMessage Successfully deleted
entityClass class aws.objekte.Customer
entityManager org.jboss.seam.persistence.EntityManagerProxy@186a830
id
idDefined false
instance Customer custNum: 0 firstName: null lastName: null
managed false
newInstance
In contrast, when I define an EnityHome component by extension and annotate it with @Stateful, the corresponding context var. in conversation context is bound to a class such as
class org.javassist.tmp.java.lang.Object_$$_javassist_15
As this class is defined by extension of EntityHome, it should have the properties shown above such as createdMessage, id, instance etc.
But in my case it surprisingly has only the following 3 properties, with all the other properties missing:
id
managed
toString()
(all other properties such as "createdMessage" or "instance" missing).
Consequently, when an EL expression is evaluated that references the instance property of this EntityHome component, an exception is thrown
javax.el.PropertyNotFoundException, Property 'instance' not found on type
Which is no surprise, given that the generated Java assist class shown above is lacking (not only) the instance property.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063994#4063994
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063994
19Â years
[Beginners Corner] - Re: Lookup ejb by its COMP_NAME
by kanth_seenu
ejb-jar.xml
<![CDATA[LicenseVerifier]]>
<ejb-name>LicenseVerifier</ejb-name>
com.dhyan.nms.server.common.license.interfaces.LicenseVerifierHome
com.dhyan.nms.server.common.license.interfaces.LicenseVerifier
<local-home>com.dhyan.nms.server.common.license.interfaces.LicenseVerifierLocalHome</local-home>
com.dhyan.nms.server.common.license.interfaces.LicenseVerifierLocal
<ejb-class>com.dhyan.nms.server.common.license.ejb.LicenseVerifierBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref >
<ejb-ref-name>ejb/LicenseVerifier</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.dhyan.nms.server.common.license.interfaces.LicenseVerifierLocalHome</local-home>
com.dhyan.nms.server.common.license.interfaces.LicenseVerifierLocal
<ejb-link>LicenseVerifier</ejb-link>
</ejb-local-ref>
jboss.xml
<ejb-name>LicenseVerifier</ejb-name>
<jndi-name>LicenseVerifier</jndi-name>
<local-jndi-name>LicenseVerifierLocalHome</local-jndi-name>
<ejb-local-ref>
<ejb-ref-name>ejb/LicenseVerifier</ejb-ref-name>
<local-jndi-name>LicenseVerifier</local-jndi-name>
</ejb-local-ref>
<method-attributes>
</method-attributes>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063993#4063993
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063993
19Â years
[Beginners Corner] - Lookup ejb by its COMP_NAME
by kanth_seenu
I have given the code that I used to lookup a bean by its COMP_NAME, after googling for several hours, posting this here to get some clues atleast.
Code:
Context initial = new InitialContext();
| Object objref = initial.lookup("java:comp/env/ejb/LicenseVerifier");
| LicenseVerifierLocalHome home = (LicenseVerifierLocalHome) objref;
| LicenseVerifierLocal license = home.create();
Exception:
javax.naming.NameNotFoundException: env not bound
JNDI View
java:comp namespace of the LicenseVerifier bean:
+- env (class: org.jnp.interfaces.NamingContext)
| +- ejb (class: org.jnp.interfaces.NamingContext)
| | +- LicenseVerifier[link -> LicenseVerifierLocalHome] (class: javax.naming.LinkRef)
| +- security (class: org.jnp.interfaces.NamingContext)
| | +- subject[link -> java:/jaas/SecurityPolicy/subject] (class: javax.naming.LinkRef)
| | +- security-domain[link -> java:/jaas/SecurityPolicy] (class: javax.naming.LinkRef)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063988#4063988
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063988
19Â years