SerialContextProvider
simteq Dec 29, 2001 11:51 AMI am using JBoss 2.4.1a on W2K.
I have created and deployed an EJB however when I try to access it I get an error message 'unable to find SerialContextProvider'.
The class is being run from a .bat file ie:
@echo off
set CLASSPATH=.;e:\j2ee\lib\j2ee.jar
set CLASSPATH=%CLASSPATH%;e:\server\jboss\client\jboss-j2ee.jar
set CLASSPATH=%CLASSPATH%;e:\server\jboss\client\jaas.jar
set CLASSPATH=%CLASSPATH%;e:\server\jboss\client\jbosssx-client.jar
set CLASSPATH=%CLASSPATH%;e:\server\jboss\client\jboss-client.jar
set CLASSPATH=%CLASSPATH%;e:\server\jboss\client\jnp-client.jar
set CLASSPATH=%CLASSPATH%;e:\server\jboss\deploy\logon.jar
set CLASSPATH=%CLASSPATH%;e:\server\resources
echo %CLASSPATH%
java TMSLogon
.........................
and the source of the class is:
import javax.naming.*;
import java.io.*;
import java.util.*;
import javax.rmi.PortableRemoteObject;
import Logon;
import LogonHome;
public class TMSLogon
{
public static void main( String[] args )
{
try
{
String username = "simteq";
String password = "merlin";
// Get a naming context
InitialContext ctx = new InitialContext();
System.out.println("Got context");
NamingEnumeration bindings = ctx.listBindings("");
while ( bindings.hasMore())
{
Binding bind = (Binding)bindings.next();
System.out.println("ROOT." + bind.getName() + "\n");
}
NamingEnumeration list = ctx.list("TMS");
while ( list.hasMore())
{
NameClassPair nc = (NameClassPair)list.next();
System.out.println("TMS." + nc + "\n");
}
// Get a reference to the Logon Bean
Object ref = ctx.lookup("TMS/Logon");
System.out.println("Got reference");
// Get a reference from this to the Bean's Home interface
LogonHome home = (LogonHome)PortableRemoteObject.narrow(ref, LogonHome.class);
System.out.println("Got logon home");
// Create a Logon object from the Home interface
Logon logon = home.create();
// call the connectAs method
System.out.println(logon.connectAs("Simteq","Merlin"));
}
catch ( ClassCastException ce )
{
System.out.println( "LOGON ERROR: " + ce.getMessage() );
}
catch ( Exception e )
{
System.out.println( "LOGON FAILURE: " + e.getMessage() );
}
}
...............................................
the output shows it is finding the initial context okay but then fails,
Any ideas.