I'm a new jboss' user. I try to run example of mastering 2 EJB on jboss,but I have 
many problem about deployment file.I'm using "jboss3.2.3Tomcat.4.1.29 and Ant 1.6.1. 
The example I try to run is HelloWorld. Ant compile the java file correctly. But When 
jar file is put in jboss deploy directory, the server console give me:

11:09:34,069 INFO  [MainDeployer] Starting deployment of package: 
file:/home/raffaele/jboss-3.2.3/server/default/deploy/Hello.jar
11:09:34,074 INFO  [MainDeployer] Deployed package: 
file:/home/raffaele/jboss-3.2.3/server/default/deploy/Hello.jar 
But at http://localhost:8080/jmx-console/index.jsp in jboss.j2ee nothing happened. 
When I run the test client, client console give me:

run.Client:
     [java]
     [java]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
     [java]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
     [java]     at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
     [java]     at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at Exception in thread "main" javax.naming.NameNotFoundException: 
HelloHome not bound 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:324)
     [java]     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
     [java]     at sun.rmi.transport.Transport$1.run(Transport.java:148)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
     [java]     at 
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
     [java]     at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
     [java]     at java.lang.Thread.run(Thread.java:534)
     [java]     at 
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
     [java]     at 
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
     [java]     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
     [java]     at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
     [java]     at javax.naming.InitialContext.lookup(InitialContext.java:347)
     [java]     at src.HelloClient.main(HelloClient.java:38)

jboss.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN"
"http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd";>

     <enterprise-beans>
         <ejb-name>Hello</ejb-name>
         <jndi-name>HelloLocalHome</jndi-name>
         <configuration-name>Standard Stateless SessionBean</configuration-name>
     </enterprise-beans>


ejb-jar.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" 
"http://java.sun.com/dtd/ejb-jar_2_0.dtd";>

<ejb-jar>
 <enterprise-beans>
  
   <ejb-name>Hello</ejb-name>
   examples.HelloHome
   examples.Hello
   <local-home>examples.HelloLocalHome</local-home>
   src.HelloLocal
   <ejb-class>examples.HelloBean</ejb-class>
   <session-type>Stateless</session-type>
   <transaction-type>Container</transaction-type>
  
 </enterprise-beans>
</ejb-jar>



HelloClient.java:

package src;

import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Properties;
import javax.rmi.PortableRemoteObject;
import src.Hello;
import src.HelloHome;
/**
 * This class is an example of client code which invokes
 * methods on a simple stateless session bean.
 */
public class HelloClient {

        public static void main(String[] args) throws Exception {
                /*
                 * Setup properties for JNDI initialization.
                 *
                 * These properties will be read-in from
                 * the command-line.
                 */
                Properties props = System.getProperties();

                /*
                 * Obtain the JNDI initial context.
                 *
                 * The initial context is a starting point for
                 * connecting to a JNDI tree. We choose our JNDI
                 * driver, the network location of the server, etc
                 * by passing in the environment properties.
                 */
                Context ctx = new InitialContext(props);

                /*
                 * Get a reference to the home object - the
                 * factory for Hello EJB Objects
                 */
                Object obj = ctx.lookup("HelloHome");


                /*
                 * Home objects are RMI-IIOP objects, and so
                 * they must be cast into RMI-IIOP objects
                 * using a special RMI-IIOP cast.
                 *
                 * See Appendix X for more details on this.
                 */
                HelloHome home = (HelloHome)
                        javax.rmi.PortableRemoteObject.narrow(
                                obj, HelloHome.class);

                /*
                 * Use the factory to create the Hello EJB Object
                 */
                Hello hello = home.create();

                /*
                 * Call the hello() method on the EJB object.  The
                 * EJB object will delegate the call to the bean,
                 * receive the result, and return it to us.
                 *
                 * We then print the result to the screen.
                 */
                System.out.println(hello.hello());

                /*
                 * Done with EJB Object, so remove it.
                 * The container will destroy the EJB object.
                 */
                hello.remove();
        }
}


build.xml file is:
<?xml version="1.0"?>

<!--Esempio: Hello World-->



  
  
  
  
  
  

  <!-- Build classpath -->
  
        
            
        
        
        
  

  

<!--Provo a compilare-->

 
         
   

<!--Costruisco la dirctory-->






    

      
          
      
      
          
      
     
   
  
<!--Provo ad eseguire-->

    





    
    
  

  
    
  



PLEASE,Can anyone help me??
Thanks very much in advance.

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

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


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to