included the CODE
but this is NOT ROCKET SCIENCE
BEAN CASTING ERRORS
package interf;
import javax.ejb.Init;
import javax.ejb.PostActivate;
//import javax.ejb.PostConstruct;
//import javax.ejb.PreDestroy;
import javax.ejb.PrePassivate;
import javax.ejb.Remove;
import javax.ejb.SessionContext;
import org.dom4j.Document;
import com.cyclus.servlet.*;
import java.util.*;
public interface interf
{
public abstract String getDescriptor();
public abstract String getStatus();
//public String test(String ID,String value);
//setup destruction consistency
public void create()throws Exception ;
public void destroy();
public void disconnect(String Id);
public String prcBEAN(String txt);
public String prcBEAN(Object obj);
public String prcBEAN_s(Servlet srv);
}
package bean;
import javax.ejb.spi.*;
//import javax.ejb.* ;//additional options
import javax.annotation.*; //EJB,EJBs,Resource,Resources
import javax.annotation.security.PermitAll;
import javax.annotation.security.RolesAllowed;
import javax.ejb.Remote;
import javax.ejb.Local;
import javax.ejb.Remove;
import javax.ejb.Stateless;
import javax.ejb.Stateful;
import javax.ejb.SessionContext;//get the session context
//Statefull accross session info
import javax.ejb.Init; //init
//import javax.ejb.PostConstruct;// init routine
//import javax.ejb.PreDestroy;
import javax.ejb.PrePassivate; //sleep
import javax.ejb.PostActivate; //Unsleep
//import javax.ejb.Resource; addition special jar
import javax.ejb.TimedObject;
import javax.ejb.Timer;
import javax.ejb.Timeout;
import javax.ejb.TimerService;
//message beans
import javax.ejb.MessageDriven;
import javax.ejb.ActivationConfigProperty; //message bean
//transaction
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.ejb.*;//pck up the rest
// Jboss additions
import org.jboss.annotation.ejb.LocalBinding;
import org.jboss.annotation.ejb.RemoteBinding;
import org.jboss.annotation.ejb.Service;
import org.jboss.annotation.ejb.Management;//jmx
import org.jboss.annotation.ejb.Producer; //message queue
//import org.jboss.ejb3.remoting.RemoteBinding;
//import org.jboss.ejb3.remoting.LocalBinding;
import org.jboss.annotation.security.SecurityDomain;
//import java.util.*;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Date;
//import javax.ejb.Inject;
import javax.jms.*;
import org.dom4j.Document; //dom4j
//import com.cyclus.bean.*; //include Cyclus stuff all in the bean
//import com.cyclus.beanClient.*;
import com.cyclus.servlet.Servlet;
import com.cyclus.*;//error
import com.cyclus.String.*;//error
import org.dom4j.Document; //dom4j
import com.cyclus.servlet.*;
import interf.*;
the BEAN :
/*
*
* @stateless Nothing is remembered in the bean itself
* @Local ({LocalBeanInterface.class}) Tag CLASSor individual
Method
* @LocalBinding (jndiBinding="beanName")
* @Remote ({RemoteBeanInterface.class})
* @RemoteBinding (jndiBinding="beanName")
* class bean implements LocalBeanInterface.RemoteBeanInterface
* @statefullCall the same stud and all bean variables remain
*
*/
@Service//("DomCrawl/BeanService")
// a service request does not execute any
initalisation or post actions
//@Stateful(name="ejb/RequestBean") //global containers/DBXmlEJB
//
//@Stateless(name="ejb302")
//@SecurityDomain("Cyclus") //Conf used Roles
@RemoteBinding( jndiBinding="ejb/bean/remote") //global ejb/DBXmlEJB
@LocalBinding( jndiBinding="ejb/bean/local") //global ejb/DBXmlEJB
@Remote( interf.class)
@Local( interf.class)
public class Bean implements interf
{
public String getDescriptor() {return "Bean MINEJB";}
public String getStatus() {return "Bean MINEJB";}
public void create()throws Exception {}
public void destroy() {}
public void disconnect(String Id) {}
try {x2=ben.prcBEAN(this);} catch (Throwable e) {System.out.print("\n
bean err object");}WORKS
try {x3=ben.prcBEAN_s(ses);} catch (Throwable e) {System.out.print("\n
bean err servlet");} FAILS
try {x1=ben.prcBEAN("this is some text to return ");} catch
(Throwable e) {System.out.print("\n bean text");} WORKS
depending on what object is passed IT FAILS
as soon it is a home brewed class i pass EJB do not function any more !!!
ANY Suggestions
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3950117#3950117
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3950117
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user