permanently NullpointerException when call entity bean

Hi

After i had permanently this problems i try it with another description in this forum.Maybe i get feedbck.....

Problem 1:

I use sample database 搒ample?coming with the application server (jdbc:derby:sample) and code from the tutorials. I can map the database as entity, create persistent unit, create session beans but when i call a servlet or jsp class to

retrieve data form database mapped on entity bean i become ever NullpointerException.!

I work on win xp system and thought maybe this problem depends on my user setting on my user directory where i see two directories:

C:\Document and Setting\me\.netbeans-derby

C:\Document and Setting\me\.netbeans\5.5

!!?

now Problem 2:

Now i create an ejb module with an entity bean and persistent unit, a session bean and a java class in the ejb module and try to see what happen here....

So i become now this error:

javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter

!!?

How could i test if in jndi there are entries for this component?

here is my class which calls the session bean :

package client;

import ejb3.Manufacturer;

import ejb3.ManufacturerFacadeLocal;

import java.util.Collection;

import java.util.Iterator;

import java.util.logging.Level;

import java.util.logging.Logger;

import javax.naming.Context;

import javax.naming.InitialContext;

import javax.naming.NamingException;

public class client {

ManufacturerFacadeLocal mfl = null;

public client() {

mfl = lookupManufacturerFacade();

}

public void readData()

{

Collection all = mfl.findAll();

Iterator it = all.iterator();

while (it.hasNext())

{

Manufacturer mf = (Manufacturer)it.next();

System.out.println(mf.getManufacturerId());

}

}

private ManufacturerFacadeLocal lookupManufacturerFacade() {

try {

Context c = new InitialContext();

return (ManufacturerFacadeLocal)c.lookup("java:comp/env/ejb/ManufacturerFacade");

}

catch(NamingException ne) {

Logger.getLogger(getClass().getName()).log(Level.SEVERE,"exception caught" ,ne);

throw new RuntimeException(ne);

}

}

public static void main( String[] args )

{

client ec = new client();

ec.readData();

}

}

I will be very thankful for any help

thank you

[2554 byte] By [serkolaa] at [2007-11-27 5:09:42]
# 1
Hi Serkola,To problem 1: Where exactly, in which source line, do you get a NullPointerException? To problem 2: Why don't you use injection of the resource or an injected SessionContext?... Michael
michaelhhha at 2007-7-12 10:29:35 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...