Hi!
I've a problem with my test client(se code below). It sometimes freezes if i
starts it more than once without restarting the jboss server.
Restarting the jboss server always solve the problem - until i've done some
restarts of the client, then it freeze again on some point.
It seems like it freeze in the prosess of getting the initialcontext.

/Jon


public class TestClient {
  private static TagIssuerCode tagIssuerCode = null;
  private static short issuer = 199;
  private static short country = 472;

  public static void main(String[] args) {
    System.setSecurityManager(new SecurityManager());
    try

      Thread.currentThread().setContextClassLoader(new URLClassLoader(new
URL[] {new URL("http://localhost:8083/")}));
      System.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
      System.setProperty("java.naming.provider.url","localhost:1099");
      Context ctx = new InitialContext(System.getProperties());
      System.out.println("Got context");
      javax.naming.NamingEnumeration enum1 = ctx.list("");
      while(enum1.hasMore()) {
        System.out.println("Context object:" + enum1.next());
      }

      // Get a reference to the Bean
      Object ref  = ctx.lookup("TagIssuerCode");
      System.out.println("Got reference");

      // Get a reference from this to the Bean's Home interface
      TagIssuerCodeHome home =
(TagIssuerCodeHome)PortableRemoteObject.narrow (ref,
TagIssuerCodeHome.class);

      // Create an Interest object from the Home interface
      //System.out.println("Start creating");
      //TagIssuerCode tagIssuerCode =
home.create(issuer,country,"SOMEWHERE","SW");
      TagIssuerCodePK pk = new TagIssuerCodePK((short)199,(short)472);
      System.out.println("HIT...");
      TagIssuerCode tagIssuerCode = home.findByPrimaryKey(pk);
      System.out.println(tagIssuerCode.getAbbrevation());
      System.out.println(tagIssuerCode.getDescription());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
 }



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to