[JBoss Seam] - Re: ASync calls stays in JBoss queue after restart
by m_hess
Hi,
I tried to fix this by calling timer.cancel() during the destroy method, which seems to me is the way to handle timers during shutdown if I don´t want them to get persisted.
Now I´m having the "Could not destroy component: "componentName"
EJBNoSuchObjectException: Could not find stateful bean: " problem.
Important: I already searched the forums for that exception and found the "adjust Timeouts-solution". I did that, but I still get the exception. Furthermore, I get this for my ASyncTest class, as well as another class. Both do have in common, that they are created using @Startup.
Timeouts also do seem unlikely, because I can provoke this directly after startup - although all 3 timeout values are set to 30 minutes (or 1800 seconds).
I´m running Seam 1.1 GA on JBoss 4.0.5 GA.
Does anybody have a clue what else might go wrong during the shutdown phase? I tried to debug it, but it seems like I do not even enter the @Destroy method of my bean. Frankly, I´m completely lost on this one... :-(
Help, please, anybody?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995880#3995880
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995880
19 years, 4 months
[JBoss Portal] - modifying the jboss portal programatically with portal core
by FredF
I am developing some portlets using JBoss seam 1.0 and JBoss Portal 2.6.
A want to use the Portal Core API in order to add portal objects programatically, e.g. portlet instances to pages and pages to portals.
I have looked at how the included manager portlet accomplishes this. I figured out that I need an instance of the PortalObjectManagerBean and then call some methods on it.
The manager portlet uses dependency injection via the faces-config.xml and sets up various properties on the bean. I have copied that managed bean to my faces-config.xml and set getters and setters in my pojo to my attribute of class PortalObjectManagerBean but it is null when I access it.
If I explicitly create a new object all other properties of the bean is still null. I access the portal core api from a pojo that in turn is called by an seam action class.
How do I get an instance of the managerbean? Have anyone done this before and want to give me any help?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995876#3995876
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995876
19 years, 4 months
[JBoss Eclipse IDE (users)] - XDoclet shortcoming?
by scramer
Hello and merry christmas to everybody.
I'm using JBossIDE 2.0.0beta2.
The problem I am facing is with relations and the unknown-pk feature. I have two CMP EJBs:
| package de.chitec.physio.server.ejb;
|
| import java.rmi.RemoteException;
| import java.util.Date;
|
| import javax.ejb.EJBException;
| import javax.ejb.EntityBean;
| import javax.ejb.EntityContext;
| import javax.ejb.RemoveException;
|
| import org.apache.log4j.Logger;
|
| /**
| * @ejb.bean
| * name="CMPPerson"
| * display-name="CMPPerson"
| * description="Description for CMPPerson"
| * jndi-name="ejb/CMPPerson"
| * type="CMP"
| * cmp-version="2.x"
| * view-type="local"
| * reentrant = "false"
| * local-jndi-name = "ejb/CMPPerson"
| *
| * @ejb.persistence
| * table-name = "person"
| *
| * @ejb.pk
| * class="java.lang.Object"
| *
| * @ejb.finder
| * signature="java.util.Collection findByLastName(java.lang.String pLastName)"
| * query="SELECT Object(o) FROM CMPPerson o WHERE o.lastName LIKE ?1"
| *
| * @jboss.entity-command
| * name = "${jboss.entity.command}"
| * class = "${jboss.entity.class}"
| *
| * @jboss.unknown-pk
| * class="java.lang.Integer"
| * column-name="id"
| * jdbc-type="INTEGER"
| * sql-type="INTEGER"
| * auto-increment="true"
| *
| * @jboss.persistence
| * pk-constraint = "true"
| * table-name = "person"
| *
| */
| public abstract class CMPPersonBean implements EntityBean
| {
|
| public CMPPersonBean()
| {
| }
|
| public void ejbActivate() throws EJBException, RemoteException
| {
| }
|
| public void ejbLoad() throws EJBException, RemoteException
| {
| }
|
| public void ejbPassivate() throws EJBException, RemoteException
| {
| }
|
| public void ejbRemove() throws RemoveException, EJBException, RemoteException
| {
| }
|
| public void ejbStore() throws EJBException, RemoteException
| {
| }
|
| public void setEntityContext(EntityContext ctx) throws EJBException, RemoteException
| {
| }
|
| public void unsetEntityContext() throws EJBException, RemoteException
| {
| }
|
| /**
| * Getter for CMP Field lastName.
| *
| * @return The person's lastname.
| * @ejb.persistent-field
| * @ejb.persistence column-name = "lastname" sql-type = "VARCHAR"
| * @ejb.interface-method view-type="local"
| */
| public abstract String getLastName();
|
| /**
| * Setter for CMP Field lastName.
| *
| * @param pLastName The person's lastname
| * @ejb.interface-method view-type="local"
| */
| public abstract void setLastName(String pLastName);
|
|
| /**
| * Create method.
| *
| * @ejb.create-method view-type = "local"
| */
| public Object ejbCreate(String pLastName) throws javax.ejb.CreateException
| {
| setLastName(pLastName);
| return null;
| }
|
| public void ejbPostCreate(String pLastName, String pFirstName, Date pBirthday) throws javax.ejb.CreateException
| {
| }
|
|
|
| }
|
as well as
| package de.chitec.physio.server.ejb;
|
| import java.rmi.RemoteException;
|
| import javax.ejb.EJBException;
| import javax.ejb.EntityBean;
| import javax.ejb.EntityContext;
| import javax.ejb.RemoveException;
|
| import de.chitec.physio.server.interfaces.CMPPersonLocal;
|
| /**
| * @ejb.bean
| * name="CMPPatient"
| * display-name="CMPPatient"
| * description="Description for CMPPatient"
| * jndi-name="ejb/CMPPatient"
| * type="CMP"
| * cmp-version="2.x"
| * view-type="local"
| * reentrant = "false"
| * local-jndi-name = "ejb/CMPPatient"
| *
| * @ejb.persistence
| * table-name = "patient"
| *
| * @ejb.pk
| * class="java.lang.Object"
| *
| * @jboss.entity-command
| * name = "${jboss.entity.command}"
| * class = "${jboss.entity.class}"
| *
| * @jboss.unknown-pk
| * class="java.lang.Integer"
| * column-name="id"
| * jdbc-type="INTEGER"
| * sql-type="INTEGER"
| * auto-increment="true"
| *
| * @jboss.persistence
| * pk-constraint = "true"
| * table-name = "patient"
| */
| public abstract class CMPPatientBean implements EntityBean {
|
| public CMPPatientBean() {
| }
|
| public void ejbActivate() throws EJBException, RemoteException {
| }
|
| public void ejbLoad() throws EJBException, RemoteException {
| }
|
| public void ejbPassivate() throws EJBException, RemoteException {
| }
|
| public void ejbRemove() throws RemoveException, EJBException, RemoteException {
| }
|
| public void ejbStore() throws EJBException, RemoteException {
| }
|
| public void setEntityContext(EntityContext ctx) throws EJBException, RemoteException {
| }
|
| public void unsetEntityContext() throws EJBException, RemoteException {
| }
|
| /**
| * Getter for CMR Relationship
| *
| * @ejb.interface-method view-type="local"
| * @ejb.relation name = "Patient-To-Person"
| * role-name = "Patient-To-Person-Role"
| * target-ejb = "CMPPerson"
| * target-role-name = "Patient-Is-Person"
| * target-multiple = "false"
| *
| * @jboss.relation related-pk-field = "id"
| * fk-column = "person"
| *
| */
| public abstract CMPPersonLocal getPerson();
|
| /**
| * Setter for CMR Relationship
| *
| * @ejb.interface-method view-type="local"
| */
| public abstract void setPerson(CMPPersonLocal value);
|
| }
|
As you can see both CMPs use automagically generated PKs. Now for the problem:
Both of the contained beans work well if not linked via a relation. As soon as the relation comes in we got a problem. I know how it is supposed to be done (using jbosscmp-jdbc.xml). The relation code should be:
| <ejb-relation>
| <foreign-key-mapping/>
| <ejb-relation-name>Patient-To-Person</ejb-relation-name>
| <ejb-relationship-role>
| <ejb-relationship-role-name>
| Patient-To-Person-Role
| </ejb-relationship-role-name>
| <key-fields />
| </ejb-relationship-role>
| <ejb-relationship-role>
| <ejb-relationship-role-name>
| Patient-Is-Person
| </ejb-relationship-role-name>
| </ejb-relationship-role>
| </ejb-relation>
|
The problem is: I simply don't know how to generate the <foreign-key-mapping/> tag via xdoclet.
Please, please, please - help.... :-)
Greetings
Sebastian
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995872#3995872
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995872
19 years, 4 months