Hey,

I guess you'll want to supply some properties to your InitialContext ... create 
a property file with content like

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099/
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

and read it into a properties object and feed that to your call to 'new 
InitialContext()' ... that should do the trick.

- Steve

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of andrewi
Sent: Thursday, August 25, 2005 3:55 PM
To: jboss-user@lists.sourceforge.net
Subject: [JBoss-user] [Installation, Configuration & Deployment] - Need
to specify class name in environment or system property


hi

when i try running the client i get 

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
        at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
        at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
        at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
        at javax.naming.InitialContext.lookup(Unknown Source)
        at org.meerkat.fraud.client.Client.main(Client.java:12)

the client source is 

package org.meerkat.fraud.client;

import javax.naming.InitialContext;

import org.meerkat.fraud.ejb.JFraud;

public class Client 
{
        public static void main(String[] args) throws Exception
        {
                InitialContext ctx = new InitialContext();
                JFraud test = (JFraud) ctx.lookup(JFraud.class.getName());
                System.out.println("Creating 1");
                test.addCustomer("Andrews Place", "Andrew" );
                System.out.println("Done");
        }
}

any ideas ?

tia
Andrew

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

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


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to