[JBoss Seam] - Re: Simple selectOneMenu Example/seamgen
by griffitm
Damian,
Thanks for the reply. I thought I was on the right track from looking at this related link: http://wiki.jboss.org/wiki/Wiki.jsp?page=SeamEntityConverter
Here is my deliverableHome class:
| package gov.hhs.fda.ocio.fdaaa.entity;
|
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.framework.EntityHome;
|
| @Name("deliverableHome")
| public class DeliverableHome extends EntityHome<Deliverable> {
|
| @In(create = true)
| StatusHome statusHome;
|
| public void setDeliverableId(Integer id) {
| setId(id);
| }
|
| public Integer getDeliverableId() {
| return (Integer) getId();
| }
|
| @Override
| protected Deliverable createInstance() {
| Deliverable deliverable = new Deliverable();
| return deliverable;
| }
|
| public void wire() {
| Status status = statusHome.getDefinedInstance();
| if (status != null) {
| getInstance().setStatus(status);
| }
| }
|
| public boolean isWired() {
| if (getInstance().getType() == null)
| return false;
| if (getInstance().getStatus() == null)
| return false;
| if (getInstance().getConsequence() == null)
| return false;
| return true;
| }
|
| public Deliverable getDefinedInstance() {
| return isIdDefined() ? getInstance() : null;
| }
|
| }
|
As for the right package, I believe so. It was all generated by seamgen. Does the entity-query need to specify the entire package? I tend to think this is a problem with mapping to the deliverableHome.status property. I have 2 records in the status table which looks like this:
| ID Description
| 1 In-Progress
| 2 On-Hold
|
I set the status_id to 2, and when I bring up the record to edit it, the status selected in the select box is 1, In-Progress. In the struts world, this would tell me that the HTML fragment generated doesn't match the struts bean mapped to the action.
Any thoughts?
Thanks in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090650#4090650
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090650
18Â years, 6Â months
[JBoss Seam] - Problem with TimerService
by hasc
Hello,
i wrote a simple stateless bean to test the TimerService. i am using jboss 4.2.0GA
Whenerver i initialize the time i run into the following exception:
2007-10-02 14:56:55,437 ERROR [org.jboss.ejb.txtimer.TimerServiceImpl] Cannot create txtimer
| java.lang.IllegalStateException: Unable to persist timer
| at org.jboss.ejb.txtimer.DatabasePersistencePolicy.insertTimer(DatabasePersistencePolicy.java:124)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| ...
| ...
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
| at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:381)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57fdff:555:47023fba:53 status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57fdff:555:47023fba:53 status: ActionStatus.ABORT_ONLY >))
| at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
| at org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin.insertTimer(GeneralPurposeDatabasePersistencePlugin.java:199)
| at org.jboss.ejb.txtimer.DatabasePersistencePolicy.insertTimer(DatabasePersistencePolicy.java:120)
| ... 317 more
| Caused by: org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57fdff:555:47023fba:53 status: ActionStatus.ABORT_ONLY >)
| at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:343)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:518)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:399)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
| at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
| ... 319 more
| Caused by: javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57fdff:555:47023fba:53 status: ActionStatus.ABORT_ONLY >
| at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:744)
| at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:577)
| at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:337)
| ... 323 mor
I googled a bit and found some issues. Now I still dont know what to do. Do i need to configure the TimerService with my database (MySQL)? I think for me its not neccessary to persist the status. Its enough for me if the timer is executed as long as the application is running.
Any hints would be great.
regards,
hasc
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090639#4090639
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090639
18Â years, 6Â months