[jboss-user] [Beginners Corner] - newbie: stateless component

mars1412 do-not-reply at jboss.com
Mon Oct 29 05:36:21 EDT 2007


hi,

for test reasons, I have created a very simple class, that only returns some simple values (see below for details). However, since the class does not need to keep any state, I think I should add the @Stateless annotation. But this does not work - without the @Stateless annotation it works fine, and I can access all the methods/data as expected, but when I add the @Stateless annotation, the JBoss server will mutter:


  | javax.el.ELException: /public.xhtml: Could not instantiate Seam component: localeTest
  | ...
  | Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: localeTest
  | ...
  | Caused by: javax.naming.NameNotFoundException: LocaleTest not bound  at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
  | 

any ideas?


  | package com.twentyfouract.test000.session;
  | 
  | import java.io.Serializable;
  | import java.util.Date;
  | 
  | import javax.ejb.Stateless;
  | 
  | import org.jboss.seam.annotations.Name;
  | 
  | // does not work with this stateless annotation
  | @Stateless
  | @Name("localeTest")
  | public class LocaleTest implements Serializable {
  | 
  | 	long lValue = 3;
  | 
  | 	double dValue = 3124.1415926;
  | 
  | 	/**
  | 	 * UID for serialization
  | 	 */
  | 	private static final long serialVersionUID = -1157053379099060115L;
  | 
  | 	public long getlValue() {
  | 		return lValue;
  | 	}
  | 
  | 	public void setlValue(long value) {
  | 		lValue = value;
  | 	}
  | 
  | 	public Date getCurrentDate() {
  | 		return new java.util.Date();
  | 	}
  | 
  | 	public double getdValue() {
  | 		return dValue;
  | 	}
  | 
  | 	public void setdValue(double value) {
  | 		dValue = value;
  | 	}
  | }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099761#4099761

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099761



More information about the jboss-user mailing list