hej,
chcialam uruchomic moja 1sza app z ejb bo czas najwyzszy zaczac. W eclipse utworzylam projekt typu EJB, w nim do ejbModule dodalam ejb sesyjny i mam tam 3 klasy:
package test.session;
import javax.ejb.Local;
import org.jboss.ejb3.annotation.LocalBinding;
@Local
public interface TestSessionBeanLocal {
void test();
}
package test.session;
import javax.ejb.Stateless;
/**
* Session Bean implementation class TestSessionBean
*/
@Stateless
public class TestSessionBean implements TestSessionBeanLocal {
/**
* Default constructor.
*/
public TestSessionBean() {
// TODO Auto-generated constructor stub
}
public void test(){
System.out.println("TEST");
}
}
w eclipse dalam run on server (JBoss 5) i chyba jest run. do tej samej paczki dodalam klase test:
package test.session;
import javax.naming.Context;
import javax.naming.InitialContext;
public class TestClient {
public static void main(String[] args) throws Exception{
String jndiName = "TestSessionBeanLocal/local";
Context ic = new InitialContext();
TestSessionBean obj = (TestSessionBean)ic.lookup(jndiName);
obj.test();
}
}
i dostaje err:
**Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
**
o co chodzi?? totalnie nie kumam:/ i na prawde nie moge dojsc po googlach.
bede wdzieczna za wszystkie sugestie..
pzdr,
misty