[JBoss Seam] - problem with messages in scheduler.
by Stateless Bean
hi,
I got in messages properties some text like:
| myText = xxx yyy zzz
|
and my messages
| @In
| protected Map<String, String> messages;
|
in normal case it works when i do somethink like:
String someString = messages.ge("myText");
someString get "xxx yyy zzz",
but i got method scheduled each minute and when i use messages in method i still get not "xxx yyy zzz", but "myText", why?
If I run my medthod like <s:link action="sfsb.method", messages work!!!!
here is my controler:
| @Name("engineControler")
| public class EngineControler extends GameSystem {
| public EngineControler() {}
|
| @In(create=true)
| EngineProcessor processor;
|
| public String calcUserPoints() {
| try {
| long interval = 1 * 500;
| @SuppressWarnings("unused")
| Timer timer = processor.scheduleUserPoints(new Date(), interval, null);
|
| }
| catch (RuntimeException e) {
| log.error("Scheduler ->engineControler - calcUserPoints(): " + e.getMessage());
| }
| return "success";
| }
|
and processor
| @Name("processor")
| public class EngineProcessor extends GameSystem {
| public EngineProcessor() {}
|
| @SuppressWarnings("unchecked")
| @Asynchronous
| @Transactional
| public Timer scheduleUserPoints(@Expiration Date when,
| @IntervalDuration long interval,
| Person p) {
| try {
| long a = System.currentTimeMillis();
| //=================================================
| String someString = messages.ge("myText");
| //=================================================
| long b = System.currentTimeMillis();
| System.out.println("TIME: " + (b - a) + " ms.");
| }
| catch (RuntimeException e) {
| log.error("processor -> scheduleUserPoints(): " +
| e.getMessage());
| }
| return null;
| }
|
can anyone explain why my messages instance can't work in scheduler?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043582#4043582
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043582
19 years
[EJB 3.0] - what´s the error
by sashaxiv
Jboss tells me:
javax.persistence.PersistenceException: org.hibernate.MappingException: Could not determine type for: com.satdatatelecom.satdataweb.model.usuario.ejb.UsuarioEJB, for columns: [org.hibernate.mapping.Column(idUsuario)]
this is my code:
@Entity
@Table(name="usuario")
public class UsuarioEJB {
private Double idUsuario;
private String login;
private String password;
private Integer mensajes;
private Boolean borrado;
private UsuarioDetallesEJB usuariodetalles;
private EmpresaEJB empresa;
private SessionEJB session;
private ConfUsuarioEJB confUsuarioEJB;
private List concesiones;
.......................
@Id
@Column(name="idUsuario")
@GeneratedValue(strategy=GenerationType.IDENTITY)
public Double getUsuario(){
return this.idUsuario;
}
public void setUsuario(Double idUsuario){
this.idUsuario = idUsuario;
}
...................
in other aplications i use Long instead Double for id attributes. Can be this
the error? I can´t understand it.
Please help!! Thanks everybody
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043579#4043579
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043579
19 years