I can't get the following session bean to work in Orion 1.4.5. The error is
at the
bottom of this page. Any help much appreciated.

ConfigBuildBean - Session Bean
ConfigBuildHome - EJBHome
ConfigBuild - EJBObject

---------- ejb-jar.xml --------------------------------

<?xml version="1.0" ?>
<!DOCTYPE ejb-jar>

<ejb-jar>
   <description>C.A.I.S. Application</description>
   <enterprise-beans>

      <session>
         <description>Used in the configuration of new builds.</description>
         <display-name>Build Configuration Session Bean</display-name>
         <ejb-name>ConfigBuildHome</ejb-name>

<ejb-class>com.neuroquest.cais.ejb.config.ConfigBuildBean</ejb-class>
         <home>com.neuroquest.cais.ejb.config.ConfigBuildHome</home>
         <remote>com.neuroquest.cais.ejb.config.ConfigBuild</remote>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
      </session>

   </enterprise-beans>

   <assembly-descriptor>
      <security-role>
         <description>Users</description>
         <role-name>users</role-name>
      </security-role>
   </assembly-descriptor>

</ejb-jar>


-------- Session Bean Implementations --------------------------

public class NewAction extends Action
{
   private ConfigBuildHome home;

   public ActionForward perform(ActionMapping mapping, ActionForm form,
         HttpServletRequest request, HttpServletResponse response) {

      // turn form instance into custom form bean.
      NewForm newForm = (NewForm) form;
      //String viewName = newForm.getView();

      String initCtxFactory =
getInitParameter(Context.INITIAL_CONTEXT_FACTORY);
      String providerURL = getInitParameter(Context.PROVIDER_URL);

      try {

         Properties env = System.getProperties();
         env.put(Context.INITIAL_CONTEXT_FACTORY, initCtxFactory);
         env.put(Context.PROVIDER_URL, providerURL);

         Context ctx = new InitialContext(env);

         home = (ConfigBuildHome)ctx.lookup("ConfigBuildHome");

         ConfigBuild build = home.create();
         build.saveConfig();
      }
      catch (Exception e) {
         log(e);
         e.printStackTrace();
      }
     ...


----- The Error ------------------------------------------------------

cassia(root):/u/public/orion# java -jar orion.jar
Auto-unpacking /u/build/release/cais.ear... done.
Auto-unpacking /u/build/release/cais/cais-web.war... done.
Auto-deploying cais (Assembly had been updated)...
Auto-deploying cais-ejb.jar (ejb-jar.xml had been touched since the previous

deployment)... done.
Auto-deploying C.A.I.S. (Assembly had been updated)...
Orion/1.4.5 initialized
java.lang.ClassCastException: ConfigBuildHome_StatelessSessionHomeWrapper1
        at com.neuroquest.cais.actions.NewAction.perform(NewAction.java,
Compiled

Code)
        at

org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.ja
va,

Compiled Code)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java, Compiled

Code)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java,
Compiled

Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
        at com.evermind.server.http.d3.sw(JAX, Compiled Code)
        at com.evermind.server.http.d3.su(JAX, Compiled Code)
        at com.evermind.server.http.ef.s1(JAX, Compiled Code)
        at com.evermind.server.http.ef.do(JAX, Compiled Code)
        at com.evermind.util.f.run(JAX, Compiled Code)



Reply via email to