TimedObject -' TX attribute ' is not working with netbeans 5.0 and SAS 8.0

Hello,

I am building a master timer stateless session bean. I have followed the examples from this site as well as I know how, and have even removed all of the system messages and other fluff. I continue to get the following error:

EJB Timeout method must have an attribute value of TX_REQUIRES_NEW OR TX_NOT_SUPPORTED for ejb

I have looked through the TimedObject, Timer, and TimerHandle API, all of which seems very simple and does not have any TX field. The example from the site is also very simple, only requiring the declaration of a timer start, which needs a TimerHandle return(although the example does not have it returning a value, I have tried this code both as written and with a class level TimerHandle object returned from the createTimer(...).getHandle() method ), and the declaration of a void ejbTimeout(Timer timer). This method should work with no body in the method since the return is void. I also set my timer intervals to ensure that they were

I am very confused and feel that this should be very easy. Does anyone know if I am dealing with a configuration error? I know that netbeans does not directly support the use of the ejb TimerService (which seems a little crazy to me, as most non-trivial applications require a timer in some form for periodic events), so are there any deployment descriptors in any of the files which need to be set for this service to work? This error looks to me like a configuration error on some level, or possibly a missing entry in one of the myriad of xml configuration files that are required. The code for my bean is below:

package QualityPortal;

import javax.ejb.*;

/**

* This is the bean class for the MasterSchedulerBean enterprise bean.

* Created Jul 18, 2006 12:40:18 PM

* @author ttaylor

*/

public class MasterSchedulerBean implements SessionBean, MasterSchedulerLocalBusiness, TimedObject

{

private SessionContext context;

private TimerHandle timerHandle = null;

public void setSessionContext(SessionContext aContext)

{

context = aContext;

}

/**

* @see javax.ejb.SessionBean#ejbActivate()

*/

public void ejbActivate()

{

}

/**

* @see javax.ejb.SessionBean#ejbPassivate()

*/

public void ejbPassivate()

{

}

/**

* @see javax.ejb.SessionBean#ejbRemove()

*/

public void ejbRemove()

{

}

// </editor-fold>

/**

* See section 7.10.3 of the EJB 2.0 specification

* See section 7.11.3 of the EJB 2.1 specification

*/

public void ejbCreate()

{

timerHandle = startTimer();

}

public javax.ejb.TimerHandle startTimer()

{

TimerService timerService = context.getTimerService();

Timer timer = timerService.createTimer(30000, "created timer");

return timer.getHandle();

}

public void ejbTimeout(Timer timer)

{

//call to another bean here

WMLReportFactoriesBean wml = new WMLReportFactoriesBean();

wml.inspectionThroughput();

}

}

[3154 byte] By [FrustratedAndLearning] at [2007-11-26 8:54:43]
# 1

Your ejbTimeout() must have a transaction attribute, which resides in the ejb-jar.xml. You'd have to edit your descriptor to contain something like:

<container-transaction>

<method>

<ejb-name>MasterScheduler</ejb-name>

<method-name>ejbTimeout</method-name>

</method>

<trans-attribute>RequiresNew</trans-attribute>

</container-transaction>

Or NotSupported.

Hope it helps.

JoaoGuilhermeDelValle at 2007-7-6 22:51:11 > top of Java-index,Application & Integration Servers,Application Servers...