2 Replies Latest reply on Aug 8, 2006 5:11 AM by Carlo de Wolf

    @EJB problem

    alex wing Newbie

      When I run jboss ejb 3.0 tutorial,there is a java file like this:


      package org.jboss.tutorial.extended.bean;

      import javax.ejb.EJB;
      import javax.ejb.Remote;
      import javax.ejb.Remove;
      import javax.ejb.*;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;
      import javax.persistence.PersistenceContextType;

      /**
      * comment
      *
      * @author Bill Burke
      */
      @Stateful
      @Remote(ShoppingCart.class)
      public class ShoppingCartBean implements ShoppingCart
      {
      @PersistenceContext(type=PersistenceContextType.EXTENDED) EntityManager em;

      @EJB StatelessLocal stateless;

      private Customer customer;

      public long createCustomer()
      {
      customer = new Customer();
      customer.setName("William");
      em.persist(customer);
      return customer.getId();
      }

      public void update()
      {
      customer.setName("Bill");
      }
      public void update2()
      {
      customer.setName("Billy");
      }

      public void update3()
      {
      stateless.update(customer);
      }

      public Customer find(long id)
      {
      return em.find(Customer.class, id);
      }

      @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
      public void never()
      {
      customer.setName("Bob");
      }



      @Remove
      public void checkout()
      {
      }
      }

      i can not compile this file ,the error message is can not find symbol
      [javac] symbol? class EJB

      jboss-ejb3x.jar in the classpath