ejb.jar missing
piter Jul 8, 2002 8:43 PMI've been attempting to get my ejb client program to lookup my ejb from the naming context in JBoss 3.0
In the documentation it says I need to include the following Jar files to my classpath.
ejb.jar
jaas.jar
jbosssx-client.jar
jboss-client.jar
jnp-client.jar
I can include all of the above Jar files except the ejb.jar?! I searched the directories in JBoss and couldn't find it.
My client keeps giving me the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: Ljavax/transaction/TransactionManager;
If I include all the Jar files in the jboss/client directory I get the following exception:
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
???
Is there some configuration setting I missing to do in JBoss itself?
my JNDI context lookup is:
try
{
Properties p = new Properties();
p.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" );
p.put("java.naming.provider.url", "jnp://localhost:1099" );
p.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces" );
// Get a naming context
InitialContext jndiContext = new InitialContext( p );
System.out.println("Got context");
// Get a reference to the Interest Bean
Object ref = jndiContext.lookup("HelloEjb");
System.out.println("Got reference");
// Get a reference from this to the Bean's Home interface
HelloEjbHome home = (HelloEjbHome)PortableRemoteObject.narrow(ref, HelloEjbHome.class);
// Create an Interest object from the Home interface
HelloEjb helloEjb = home.create();
// call the calculateCompoundInterest() method to do the calculation
System.out.println("Interest on 1000 units, at 10% per period, compounded over 2 periods is:");
System.out.println(helloEjb.sayHello( "some saying.."));
}
catch(Exception e)
{
System.out.println(e.toString());
}