Hi Tom,
I have tried the instruction from the site you given which is
http://www.jboss.org/wiki/Wiki.jsp?page=UsingJBossBehindAFirewall
but unfortunately still no luck!
Hereby, i post all my related source code and configuration file for your
reference.
Thank in advance,
Wikey
My testing client code
================
import java.net.InetAddress;
import java.util.Hashtable;
import httpTest.interfaces.HttpTest;
import httpTest.interfaces.HttpTestHome;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
/**
* User: len
* Date: Dec 4, 2004
* Time: 12:48:24 AM
* @author Marilen Corciovei
* @version $Id: HttpTestRemote.java,v 1.1.1.1 2004/12/03 23:55:10 len Exp $
*/
public class HttpTestRemote {
private static int limit = 5;
public static void main(String[] args) {
HttpTestHome home = null;
try {
if (args.length == 0)
throw new Exception("IP and port not
specified");
System.out.println("hostname:" +
InetAddress.getLocalHost());
String ip = args[0];
Hashtable env = new Hashtable();
env.put(
Context.INITIAL_CONTEXT_FACTORY,
"org.jboss.naming.HttpNamingContextFactory");
//Context.
env.put(
Context.PROVIDER_URL,
"http://" + ip + "/invoker/JNDIFactory");
InitialContext iniCtx = new InitialContext(env);
Object objref = iniCtx.lookup("ejb/HttpTest");
//Context context = new InitialContext();
//context.getEnvironment();
//Object ref = context.lookup("ejb/HttpTest");
home =
(HttpTestHome) PortableRemoteObject.narrow(
objref,
HttpTestHome.class);
HttpTest bean = home.create();
String result = bean.simpleMethod("I am a remote
client");
bean.remove();
System.out.println("result = " + result);
} catch (Exception e) {
//do not handle this (out of scope)
e.printStackTrace();
}
}
}
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 >
<![CDATA[No Description.]]>
<display-name>HttpTest</display-name>
<enterprise-beans>
<!-- Session Beans -->
<![CDATA[Description for HttpTest]]>
<display-name>Name for HttpTest</display-name>
<ejb-name>HttpTest</ejb-name>
httpTest.interfaces.HttpTestHome
httpTest.interfaces.HttpTest
<ejb-class>httpTest.ejb.HttpTestBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
</enterprise-beans>
<!-- Relationships -->
<!-- Assembly Descriptor -->
<assembly-descriptor >
<!-- finder permissions -->
<!-- transactions -->
<!-- finder transactions -->
</assembly-descriptor>
</ejb-jar>
C:\jboss-4.0.0\server\all\conf\jboss-service.xml snippet
=======================================
<!-- RMI/JRMP invoker -->
4444
jboss:service=TransactionManager
1099
1098
C:\jboss-4.0.0\server\all\deploy\http-invoker.sar\META-INF\jboss-service.xml
=======================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server>
<!-- The HTTP invoker service configration-->
http://www.abc.com:8001/invoker/EJBInvokerServlet
http://www.abc:8001/invoker/EJBInvokerHAServlet
<!-- Expose the Naming service interface via HTTP -->
<!-- The Naming service we are proxying -->
jboss:service=Naming
http://www.abc:8001/invoker/JMXInvokerServlet
org.jnp.interfaces.Naming
<!-- Expose the Naming service interface via clustered HTTP. This maps to the
ReadOnlyJNDIFactory servlet URL-->
jboss:service=Naming
http://www.abc:8001/invoker/JMXInvokerServlet
org.jnp.interfaces.Naming
run.bat snippet
===========
set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m
-Djava.rmi.server.hostname=www.abc.com -Djava.rmi.server.useLocalHostname=false
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3872680#3872680
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3872680
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development