Hi guys,

I am investigating how useful EJB can be for the product for which I am the
architect.  I know just the big picture of EJB.  Downloaded jBoss,  and
guess how pleased I was to see it running immediately.  Wrote a simple Hello
World example,  and could _deploy_ it successfully immediately too.
Happiness!

Running Solaris,  JDK1.3,  jBoss-2.0-FINAL.

Enter: dark clouds

I have been trying for DAYS now to run my client.  I've tried modifying the
ejb-jar.xml.  I've tried changing names of packages.  I've tried adding a
jboss.xml file.  I've tried many ways to write the client.  It just won't
run.  (I've searched the archive of this list,  but didn't find anything
similar.)

I get this when I deploy it:
+++++++++++++++
[Auto deploy] Auto deploy of
file:/info/dev-parfo/jBoss-2.0_FINAL/deploy/HelloWorld.ja
r
[J2EE Deployer] Stopping module HelloWorld.jar
[Container factory]
Undeploying:file:/info/dev-parfo/jBoss-2.0_FINAL/bin/../tmp/deploy/HelloWorl
d.jar/ejb1020.jar
[Container factory] Undeployed application:
file:/info/dev-parfo/jBoss-2.0_FINAL/bin/../tmp/deploy/HelloWorld.jar/ejb102
0.jar
[J2EE Deployer] Destroying application HelloWorld.jar
[J2EE Deployer] deployment.cfg file deleted.
[J2EE Deployer] File tree
file:/info/dev-parfo/jBoss-2.0_FINAL/tmp/deploy/HelloWorld.jar deleted.
[J2EE Deployer] Deploy J2EE application:
file:/info/dev-parfo/jBoss-2.0_FINAL/deploy/HelloWorld.jar
[J2EE Deployer] Create application HelloWorld.jar
[J2EE Deployer] Installing EJB package: HelloWorld.jar
[J2EE Deployer] Starting module HelloWorld.jar
[Container factory]
Deploying:file:/info/dev-parfo/jBoss-2.0_FINAL/bin/../tmp/deploy/HelloWorld.
jar/ejb1022.jar
[Verifier] Verifying
file:/info/dev-parfo/jBoss-2.0_FINAL/bin/../tmp/deploy/HelloWorld.jar/ejb102
2.jar
[Container factory] Deploying parfo.Hello
[Container factory] Deployed application:
file:/info/dev-parfo/jBoss-2.0_FINAL/bin/../tmp/deploy/HelloWorld.jar/ejb102
2.jar
[J2EE Deployer] J2EE application:
file:/info/dev-parfo/jBoss-2.0_FINAL/deploy/HelloWorld.jar is deployed.
+++++++++++++++++


Is that correct?

Then when I run my client,  I get this error:
++++++++++++++++++
javax.naming.NameNotFoundException: parfo.HelloHome not bound
        at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC
all.java:245)
        at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
        at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:295)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:279)
        at javax.naming.InitialContext.lookup(InitialContext.java:350)
        at HelloClient.main(HelloClient.java:23)
+++++++++++++++++


My ejb-jar.xml looks like this:
+++++++++++++
<?xml version="1.0" encoding="Cp1252"?>
<ejb-jar>
 <description>Lek med beans</description>
 <display-name>TestAvBeans</display-name>
 <enterprise-beans>
  <session>
   <ejb-name>parfo.Hello</ejb-name>
   <home>parfo.HelloHome</home>
   <remote>parfo.Hello</remote>
   <ejb-class>parfo.HelloBean</ejb-class>
   <session-type>Stateless</session-type>
   <transaction-type>Bean</transaction-type>
  </session>
 </enterprise-beans>
</ejb-jar>
++++++++++++++++++


My client code looks like this:
++++++++++++++
import parfo.*;

import javax.ejb.*;
import javax.naming.*;
import javax.rmi.*;
import java.util.*;

public class HelloClient {
    public static void main(String[] args) {
        try {
            System.setProperty("java.naming.factory.initial",
                               "org.jnp.interfaces.NamingContextFactory");
            System.setProperty("java.naming.provider.url",
                               "localhost:1099");

            Properties props = System.getProperties();
            System.out.println("Got props");

            Context ctx = new InitialContext(props);
            System.out.println("Got context");

            Context context = new InitialContext();
            Object boundObject = context.lookup("java:parfo.HelloHome");
            HelloHome helloHome = (HelloHome) PortableRemoteObject.narrow(
                boundObject, HelloHome.class);
            Hello _hello = helloHome.create();

            HelloHome home;
            home = (HelloHome) ctx.lookup("java:parfo/HelloHome");
            System.out.println("Got home object #1");

            home = (HelloHome) ctx.lookup("HelloHome");
            System.out.println("Got home object #2");

            home = (HelloHome) PortableRemoteObject.narrow(
                ctx, HelloHome.class);
            System.out.println("Got home object #3");

            Hello hello = home.create();

            System.out.println(hello.hello());

            hello.remove();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
}
++++++++++++

and even though I try different ways to get the reference to the Home
object,  none of them work (I comment out different ones to test.)

Any ideas?

Kind regards
Pär


______________________________________s_p_r_a_y_
Dr. Pär Fornland



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

Reply via email to