[jboss-user] [EJB 3.0] - @EJB problem

ziqew do-not-reply at jboss.com
Tue Aug 8 04:12:29 EDT 2006


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 

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

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



More information about the jboss-user mailing list