[jboss-user] [Remoting] - Re: Problem calling EJB3 method via HTTP only
mengyi
do-not-reply at jboss.com
Tue Sep 4 04:16:33 EDT 2007
Hi,
I have read the wiki on ejb3 over http/s. But i am still getting problems at the very fundamental level,
Exception in thread "main" javax.naming.CommunicationException: Operation failed [Root exception is java.rmi.ServerException: IOE; nested exception is:
| java.net.ConnectException: Connection refused: connect]
| at org.jboss.naming.interceptors.ExceptionInterceptor.invoke(ExceptionInterceptor.java:65)
|
I am using httpd 2.2 sitting in front of jboss421GA and using mod_jk-1.2.25-httpd-2.2.4.so. My ideal setup would be :
1. remote client -->http://mydomain.com/invoker/JNDIFactory-->ajp://localhost:8009/...
2. remote client --->https://mydomain.com/<ejb invoke>-->ajp://localhost:8009/....
And also, i'd configure ssl client cert auth at the httpd level.
So actually, do i need ejb over http/s??? If not, how should i go about it?
If yes, what's wrong with the following config...
PLEASE HELP ME OUT......
mod_jk.conf
| JkMount /invoker/* loadbalancer
| JkMount /servlet-invoker/* loadbalancer
| JkMount /jmx-console/* loadbalancer
| JkMount /web-console/* loadbalancer
|
workers.properties
# list of workers that will be used
| # for mapping requests
| # The configuration directives are valid
| # for the mod_jk version 1.2.18 and later
| #
| worker.list=loadbalancer
|
| # Define Node1
| # modify the host as your host IP or DNS name.
| worker.node1.port=8009
| worker.node1.host=localhost
| worker.node1.type=ajp13
| worker.node1.lbfactor=1
| # worker.node1.connection_pool_size=10 (1)
|
| # Load-balancing behaviour
| worker.loadbalancer.type=lb
| worker.loadbalancer.balance_workers=node1
|
| # Status worker for managing load balancer
| #worker.status.type=status
|
jboss-web.deployer/server.xml, i didn't touch it as i don't https.
ejb3.deployer/META-INF/jboss-service.xml, i have only added in http portion
<mbean code="org.jboss.remoting.transport.Connector"
| name="jboss.remoting:service=Connector,transport=Servlet"
| display-name="Servlet transport Connector">
| <depends>jboss.aop:service=AspectDeployer</depends>
| <attribute name="InvokerLocator">
| servlet://${jboss.bind.address}:8080/servlet-invoker/ServerInvokerServlet
| </attribute>
|
| <attribute name="Configuration">
| <handlers>
| <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
| </handlers>
| </attribute>
| </mbean>
servlet-invoker.war, specifically the WEB-INF/web.xml , i commented out the https part.
<?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE web-app PUBLIC
| "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
| "http://java.sun.com/dtd/web-app_2_3.dtd">
|
| <!-- The the JBossRemoting server invoker servlet web.xml descriptor
| $Id: web.xml,v 1.1 2005/06/16 21:12:48 telrod Exp $
| -->
| <web-app>
| <servlet>
| <servlet-name>ServerInvokerServlet</servlet-name>
| <description>The ServerInvokerServlet receives requests via HTTP
| protocol from within a web container and passes it onto the
| ServletServerInvoker for processing.
| </description>
| <servlet-class>org.jboss.remoting.transport.servlet.web.ServerInvokerServlet</servlet-class>
| <init-param>
| <param-name>invokerName</param-name>
| <param-value>jboss.remoting:service=invoker,transport=servlet</param-value>
| <description>The servlet server invoker</description>
| </init-param>
| <load-on-startup>1</load-on-startup>
| </servlet>
| <!-- <servlet>
| <servlet-name>SSLServerInvokerServlet</servlet-name>
| <description>The ServerInvokerServlet receives requests via HTTPS
| protocol from within a web container and passes it onto the
| ServletServerInvoker for processing.
| </description>
| <servlet-class>org.jboss.remoting.transport.servlet.web.ServerInvokerServlet</servlet-class>
| <init-param>
| <param-name>locatorUrl</param-name>
| <param-value>sslservlet://localhost:8443/servlet-invoker/SSLServerInvokerServlet</param-value>
| <description>The ssl servlet server invoker locator url</description>
| </init-param>
| <load-on-startup>1</load-on-startup>
| </servlet> -->
| <servlet-mapping>
| <servlet-name>ServerInvokerServlet</servlet-name>
| <url-pattern>/ServerInvokerServlet/*</url-pattern>
| </servlet-mapping>
| <!-- <servlet-mapping>
| <servlet-name>SSLServerInvokerServlet</servlet-name>
| <url-pattern>/SSLServerInvokerServlet/*</url-pattern>
| </servlet-mapping> -->
| </web-app>
|
|
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory");
| env.setProperty(Context.PROVIDER_URL, "http://mydomain.com/invoker/JNDIFactory");
| env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
| InitialContext ctx = new InitialContext(env);
| Calculator calculator = (Calculator) ctx.lookup("CalculatorHttpBean/remote");
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080735#4080735
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080735
More information about the jboss-user
mailing list